feat(Draw): Add default draw colours for special shapes #1494
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
HAS DATABASE MIGRATION
When drawing walls/windows/doors you often tend to swap between colours and usually you want to use the same colours for the same type of shape.
This PR adds a new feature that automatically sets the colours of the shape to be drawn depending on the draw tool configuration.
When the logic isDoor checkbox is marked, the shape will get the default door colours attached.
When vision lock & movement lock are set, the default wall colours are attached.
When only movement lock is set, the default window colour is set.
These default colours can be configured in the client settings and thus configured on a global or campaign specific level.
Furthermore doors have 2 specific colours: open and closed. These will automatically update when you toggle a door and a default colour is configured.
When changing the default colours all shapes that have been drawn since this PR landed, will automatically update to match the new colour.
Because there might be confusion, by default the colour pickers will become nonfunctional in the draw tool when one of the aforementioned conditions is met. You can however still select custom colours when necessary by unchecking the new 'prefer default colours' checkbox in the draw tool's vision settings, which will re-enable the colour picker. When such a shape is drawn, it will ignore all future changes to the default colours as well.
If you edit the colour of a shape affected by default colours through its edit dialog, it will no longer adhere to default colour changes and have a unique colour from then on.