Skip to content

Commit

Permalink
Merge pull request RPTools#4356 from kwvanderlinde/feature/331-unique…
Browse files Browse the repository at this point in the history
…-lights-on-tokens

Add unique light sources on tokens, and macros for manipulating them.
  • Loading branch information
cwisniew authored Nov 4, 2023
2 parents 6f55c9d + 29e4660 commit 7d89f48
Show file tree
Hide file tree
Showing 15 changed files with 600 additions and 226 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -674,18 +674,16 @@ public void updateTokenProperty(Token token, Token.Update update, String value)

@Override
public void updateTokenProperty(Token token, Token.Update update, LightSource value) {
updateTokenProperty(
token, update, TokenPropertyValueDto.newBuilder().setLightSource(value.toDto()).build());
}

@Override
public void updateTokenProperty(
Token token, Token.Update update, LightSource value1, String value2) {
updateTokenProperty(
token,
update,
TokenPropertyValueDto.newBuilder().setLightSource(value1.toDto()).build(),
TokenPropertyValueDto.newBuilder().setStringValue(value2).build());
if (update == Token.Update.createUniqueLightSource) {
// This case requires sending the full light source definition.
updateTokenProperty(
token, update, TokenPropertyValueDto.newBuilder().setLightSource(value.toDto()).build());
} else {
updateTokenProperty(
token,
update,
TokenPropertyValueDto.newBuilder().setLightSourceId(value.getId().toString()).build());
}
}

@Override
Expand Down
Loading

0 comments on commit 7d89f48

Please sign in to comment.