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

Consistently add light options to Campaign Properties #4515

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented Dec 1, 2023

Identify the Bug or Feature request

Addresses #4059

Description of the Change

The light panel update is modified to consistently handle any parameters to a light segment. It is now trivial to get everything rendered in a consistent order (shape/arc/offset, gm/owner, radius/colour/lumens) and exactly when needed.

In addition to showing offset only if needed, it will also be included when set to zero if a previous segment had a non-zero offset. Previously this was not done and so the rendered string would not accurately describe a light with a zero offset.

The sight panel update was also modified, but just to factor out a bit of common functionality.

Possible Drawbacks

Should be none.

Documentation Notes

N/A

Release Notes

  • Fixed cone offsets in the Campaign Properties lights so they aren't repeated unnecessarily, and only appear after the cone keyword.

This change is Reviewable

When iterating over the segments of a light source, instead of separate variables to track previous state we now have a
map that maintains all properties from the previous segment. In the loop we just update the map, and then have a uniform
way to output them to the `StringBuilder`.

The order now matches documentation: shape+arc/offset, owner/gm, radius+colour+lumens. Parameters are only included if
different from the previous occurrence (or from the default for the first occurrence).
Factor out the common shape and distance output rather than repeating the code for all shapes. Also coaelesce the shapes
that have no special logic.
@kwvanderlinde kwvanderlinde force-pushed the feature/4059-be-consistent-about-light-parameters branch from d62edfc to 29bb68d Compare December 1, 2023 09:20
@cwisniew cwisniew added this pull request to the merge queue Dec 1, 2023
@cwisniew cwisniew added the bug label Dec 1, 2023
Merged via the queue into RPTools:develop with commit 1f5e77c Dec 1, 2023
4 checks passed
@kwvanderlinde kwvanderlinde deleted the feature/4059-be-consistent-about-light-parameters branch December 1, 2023 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

2 participants