Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add UI for defining unique lights #4553

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented Dec 11, 2023

Identify the Bug or Feature request

Addresses #3087
Improves #331 / #4356

Description of the Change

Adds a new text box to the Edit Token dialog where light sources can be added. The syntax is the same as in the Campaign Properties dialog, except that no categories are supported. The text box is only enabled when a GM is editing the token, in keeping with the trusted requirements of the macro functions.

Some minor attached changes:

  1. Fix the width of the terrain modifer so it can actually show its valuie.
  2. To save some horizontal space, and to just be less noisy in general, we only include lumens values if they are not the default of +100.

Before (1.14):
image

After:
image

Possible Drawbacks

Config tabs is getting more crowded. No good place to put help text as in Campaign Properties

Documentation Notes

It is possible to add unique lights to a token using the Edit Token dialog, Config tab. The syntax is the same as for campaign properties, except that categories cannot be used.
unique-light-sources

Release Notes

  • Added a text box to the Edit Token dialog for defining unique lights.

This change is Reviewable

New `LightSyntax` defines the syntax of lights, handling both parsing and rendering as strings. The logic is essentially
what it was in `CampaignPropertiesDialog`, but has been decomposed so that lights can be used without or without
categories.

In the same vein, `SightSyntax` defines the syntax of sights, though not extra functionality has been built into it.
This saves some horizontal space in the common case of using the default lumens value.
Disable unique light sources panel for non-GMs; player can still see the definitions, no harm in that.

Some layout changes were necessary to prevent the portrait etc. from shrinking too much. The terrain modifier input
width was fixed as well.
@kwvanderlinde kwvanderlinde changed the title Factor light & sight syntax out of campaign properties dialog Add UI for defining unique lights Dec 11, 2023
@cwisniew cwisniew added this pull request to the merge queue Dec 15, 2023
@cwisniew cwisniew added the feature Adding functionality that adds value label Dec 15, 2023
Merged via the queue into RPTools:develop with commit 53d8009 Dec 15, 2023
4 checks passed
@kwvanderlinde kwvanderlinde deleted the feature/331-unique-light-source-ui-minimal branch December 15, 2023 17:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Adding functionality that adds value
Projects
Development

Successfully merging this pull request may close these issues.

2 participants