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

Bring back unique light sources (no new macro functions) #5067

Merged

Commits on Nov 22, 2024

  1. Add support in the model for unique light sources

    - Methods on `Token` to add or delete unique light sources and look them up.
    - Support in `AttachedLightSource` to resolve against a `Token` in addition to a `Campaign`.
    - Support in `TokenDto` to transfer unique light sources.
    
    Attaching (turning on) a unique light source works exactly as for a campaign light source: the ID is added to the
    list. The only difference in behaviour between unique and campaign light sources is where the definition lives.
    kwvanderlinde committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    b58cf07 View commit details
    Browse the repository at this point in the history
  2. Tweak method in ServerCommand for attaching light sources

    The new version is not an overload of `updateTokenProperty()` but has a more descriptive name. It also does not rely on
    the caller deciding which `Token.Update` value to use. Instead, a `boolean` is accepted to toggle the light source on or
    off, and the method will pick one of the two valid `Token.Update` value based on that.
    kwvanderlinde committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    edf869c View commit details
    Browse the repository at this point in the history
  3. Add support in existing macros for unique light sources

    This only adds the ability to write a `"$token"` category in `getLights()`, `setLight()`, and `hasLightSource()` to
    restrict the operation to unique light sources on the given token, rather than restricting it to a campaign category. It
    also extends the wildcard (`"*"`) support in these functions to also look for unique light sources on the token.
    kwvanderlinde committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    f7847db View commit details
    Browse the repository at this point in the history
  4. Add support in the UI for unique light sources

    The Edit Token dialog now sports a textbox where unique light sources can be defined. The syntax is identical to the light
    syntax in the Campaign Properties dialog except that categories are not supported.
    
    If a token has unique light sources, its context menu will display them under "Light Sources". They will be in their own
    "Unique" category, separated from the campaign categories. The functionality is identical to that for campaign lights.
    kwvanderlinde committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    f8d507b View commit details
    Browse the repository at this point in the history
  5. Add support in UVTT importer for unique lights

    The importer will synthesize unique lights for each light in the UVTT file. The range will be taken from the light's
    `"range"` field, and the lumens will be set to 100. The colour will be set to the light's `"color"` field, unless the
    map image has baked lighting in - in that case, the unique light source will be clear. The `IGNORES-VBL` flag will be
    set if the light's `"shadow"` flag is `false`.
    
    All light properties are now written to the GM notes. Previously we wrote a hand-picked subset, but now everything is
    there. This avoids any chance of missing some in the future if the UVTT format adds additional properties.
    
    There are a few limitations with the import:
    1. UVTT does not include the shape or texture of the light, so imported lights are always treated as circles.
    2. We have no equivalent to "intensity" so that remains unused.
    kwvanderlinde committed Nov 22, 2024
    Configuration menu
    Copy the full SHA
    4305f69 View commit details
    Browse the repository at this point in the history