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 macro function getIllumination() #4267

Merged
merged 8 commits into from
Aug 30, 2023

Commits on Aug 28, 2023

  1. Allow empty token views

    Until now, a `PlayerView` with an empty token list and a `PlayerView` with a `null` token list were the same, and both
    would return `true` for `isUsingTokenView()`. We now distinguish these cases to allow token views that happen to not
    have any tokens, which is useful for excluding illumination contributions from personal lights and sight magnifiers.
    
    Existing callers that would pass an empty token list to the `PlayerView(Role, List<Token>)` constructor now call the
    `PlayerView(Role)` in order to keep the same behaviour.
    kwvanderlinde committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    c7dab12 View commit details
    Browse the repository at this point in the history
  2. Fix FunctionUtil.getZoneRendererFromParam() to not return null

    In rare cases, the current zone renderer can be `null`, and `FunctionUtil.getZoneRendererFromParam()` was not handling
    this case despite promising never to return `null` itself.
    kwvanderlinde committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    3bb3729 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    cf76bbf View commit details
    Browse the repository at this point in the history
  4. Add macro function getIllummination()

    Usage: `getIllumination(x, y)`
    
    This basic form of the function uses the current `PlayerView` for the map, so the lumens value returned will match what
    the lumens overlay shows on the client at the given point. Personal lights and sight magnifiers will be accounted for if
    they are in the current view.
    kwvanderlinde committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    55fefc3 View commit details
    Browse the repository at this point in the history
  5. Add optional map parameter to getIllumination()

    New usage: `getIllumination(x, y, mapNameOrId)`
    
    If `mapNameOrId` is provided, the result will be returned for a point on the provided map. If not provided, the result
    will be for the current map.
    kwvanderlinde committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    3e71a1b View commit details
    Browse the repository at this point in the history
  6. Add optional token list parameter to getIllumination()

    New usage: `getIllumination(x, y, mapNameOrId, tokenIds)`
    
    The token list controls allows the player view to be customized. It must be a JSON array of tokens IDs for the current
    zone, with any unknown tokens resulting in an error.
    
    If not provided, the player view will be the current player view for the map.
    
    If the list of token IDs is empty, the `PlayerView` will use a token view but with no tokens involved, i.e., no token
    sight will be accounted for.
    kwvanderlinde committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    c768212 View commit details
    Browse the repository at this point in the history
  7. Support json.null for the token list in getIllumination()

    New usage: `getIllumination(x, y, mapNameOrId, json.null)`
    
    Using `json.null` for this parameter will indicate that a token view will not be used. I.e., the behaviour will match
    the lighting seen when no tokens are selected on the map.
    kwvanderlinde committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    c8408e2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    d1ecf4e View commit details
    Browse the repository at this point in the history