Skip to content

Commit

Permalink
Add noNationSlug to the Config, used when a town has no nation.
Browse files Browse the repository at this point in the history
  • Loading branch information
LlmDl committed Dec 20, 2023
1 parent e56c893 commit 41d39b7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -2,7 +2,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.dynmap</groupId>
<artifactId>Dynmap-Towny</artifactId>
<version>0.97</version>
<version>0.98</version>

<build>
<resources>
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/dynmap/towny/DynmapTownyPlugin.java
Expand Up @@ -95,6 +95,7 @@ public class DynmapTownyPlugin extends JavaPlugin {
boolean chat_sendlogin;
boolean chat_sendquit;
String chatformat;
String noNationSlug;
private final TaskScheduler scheduler;

public DynmapTownyPlugin() {
Expand Down Expand Up @@ -429,7 +430,7 @@ private String formatInfoWindow(Town town, TownBlockType btype) {
v = v.replace("%bank%", TownyEconomyHandler.getFormattedBalance(town.getAccount().getCachedBalance()));
v = v.replace("%upkeep%", TownyEconomyHandler.getFormattedBalance(TownySettings.getTownUpkeepCost(town)));
}
String nation = town.hasNation() ? town.getNationOrNull().getName() : "";
String nation = town.hasNation() ? town.getNationOrNull().getName() : noNationSlug;

v = v.replace("%nation%", nation);

Expand Down Expand Up @@ -1034,6 +1035,7 @@ private void activate() {
set.setHideByDefault(cfg.getBoolean("layer.hidebydefault", false));
use3d = cfg.getBoolean("use3dregions", false);
infowindow = cfg.getString("infowindow", DEF_INFOWINDOW);
noNationSlug = cfg.getString("noNationSlug", "");
/* See if we need to show commercial areas */
show_shops = cfg.getBoolean("layer.showShops", false);
show_arenas = cfg.getBoolean("layer.showArenas", false);
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/config.yml
Expand Up @@ -33,6 +33,8 @@ dynamic-town-colors: true

# Format for popup - substitute values for macros
infowindow: '<div class="infowindow"><span style="font-size:120%;">%regionname% (%nation%)</span><br /> Mayor <span style="font-weight:bold;">%playerowners%</span><br /> Associates <span style="font-weight:bold;">%playermanagers%</span><br/>Flags<br /><span style="font-weight:bold;">%flags%</span></div>'
# What is shown in the info window's %nation% when a town has no nation.
noNationSlug: ""

regionstyle:
strokeColor: "#FF0000"
Expand Down

0 comments on commit 41d39b7

Please sign in to comment.