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

Added config option to enable/disable dynamic town colours #24

Merged
merged 1 commit into from
Aug 6, 2021

Conversation

Goosius1
Copy link

@Goosius1 Goosius1 commented Aug 6, 2021

DESCRIPTION

  • Currently server admins are requesting a way to enable the dynamic-nation-colour feature without also enabling the dynamic-town-colours feature.
  • I looked into it but could not find a straightforward way.

IMPLEMENTATION

  • Added new config option to enable/disable dynamic town colours.
  • This can be combined in any combination with the existing switch for dynamic nation colours.
  • Also updated the pom to the next version.

TESTING

  • Tested all combinations of the 2 switches.

@Goosius1 Goosius1 self-assigned this Aug 6, 2021
Copy link
Member

@Warriorrrr Warriorrrr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, got one thing that could be added

Comment on lines +563 to +570
//CALCULATE FILL COLOUR
if (dynamicTownColorsEnabled) {
//Here we know the server is using town colors. This takes top priority for fill
colorHexCode = town.getMapColorHexCode();
if(!colorHexCode.isEmpty()) {
//If town has a color, use it
townFillColorInteger = Integer.parseInt(colorHexCode, 16);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nation's map color could be used as a fallback here, in case the town has not set a map color yet

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • I considered that
  • The only scenario this fallback could happen is when a server had already been using nation colours, and just upgraded the system to allow special town colours.
  • In this scenario, players could be very familiar with the scheme of a single colour in each town, indicating nation allegiance.
  • Assume as standard that the players & maybe staff do not read the release information on the town colour feature.
  • With the indicated fallback, at first nothing would change, but they would soon see just ONE or TWO towns diverge from the familiar scheme, causing them to potentially think that a bug was happening, and causing scattered confusion.
  • Without the indicated fallback, town fill instead falls back to the default dynmap colour. Thus the server will immediately see ALL towns suddenly fill red, which will be an unmistakeable signal for them to wake up and notice/discuss the new feature, which I hope will be a better experience & introduction to the feature than the previous.

@Warriorrrr Warriorrrr added the enhancement New feature or request label Aug 6, 2021
@Goosius1 Goosius1 merged commit e8adfc6 into TownyAdvanced:master Aug 6, 2021
@Goosius1 Goosius1 deleted the add_dtcolour_config_option branch August 6, 2021 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants