From fa84c014368b1f9ba26c76db329f8db0bb35e9f0 Mon Sep 17 00:00:00 2001 From: riverwanderer <58135975+riverwanderer@users.noreply.github.com> Date: Thu, 21 Sep 2023 11:11:50 +0100 Subject: [PATCH] Must untranslate side to derive property name. --- .../VASSAL/build/module/PlayerRoster.java | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/vassal-app/src/main/java/VASSAL/build/module/PlayerRoster.java b/vassal-app/src/main/java/VASSAL/build/module/PlayerRoster.java index 20aa5a9c3b..d4a8c105a0 100644 --- a/vassal-app/src/main/java/VASSAL/build/module/PlayerRoster.java +++ b/vassal-app/src/main/java/VASSAL/build/module/PlayerRoster.java @@ -521,13 +521,12 @@ public Component getControls() { alreadyTaken.add(p.getLocalizedSide()); } - // Scan VassalHideSide_ properties for module-controlled exclusions + // Scan module VassalHideSide_ properties to exclude side when true + // The properties are named for untranslated sides! for (int i = 0; i < availableSides.size(); i++) { // search of sides - if (Boolean.valueOf((String) GameModule.getGameModule().getProperty("VassalHideSide_" + availableSides.get(i)))) { - String hideSide = translateSide(availableSides.get(i)); - if (!alreadyTaken.contains(hideSide)) { - alreadyTaken.add(hideSide); - } + final String s = availableSides.get(i); + if (Boolean.valueOf((String) GameModule.getGameModule().getProperty("VassalHideSide_" + untranslateSide(s))) && !alreadyTaken.contains(s)) { + alreadyTaken.add(s); } } @@ -845,13 +844,12 @@ protected String promptForSide(String newSide) { availableSides.clear(); availableSides.addAll(sides); - // Scan VassalHideSide_ properties for module-controlled exclusions (when true) + // Scan module VassalHideSide_ properties to exclude side when true + // The properties are named for untranslated sides! for (int i = 0; i < availableSides.size(); i++) { // search of sides - if (Boolean.valueOf((String) GameModule.getGameModule().getProperty("VassalHideSide_" + availableSides.get(i)))) { - String hideSide = translateSide(availableSides.get(i)); - if (!alreadyTaken.contains(hideSide)) { - alreadyTaken.add(hideSide); - } + final String s = availableSides.get(i); + if (Boolean.valueOf((String) GameModule.getGameModule().getProperty("VassalHideSide_" + untranslateSide(s))) && !alreadyTaken.contains(s)) { + alreadyTaken.add(s); } } }