Skip to content

Commit

Permalink
Must untranslate side to derive property name.
Browse files Browse the repository at this point in the history
  • Loading branch information
riverwanderer committed Sep 21, 2023
1 parent 5a515e3 commit fa84c01
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions vassal-app/src/main/java/VASSAL/build/module/PlayerRoster.java
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,12 @@ public Component getControls() {
alreadyTaken.add(p.getLocalizedSide());
}

// Scan VassalHideSide_<side> properties for module-controlled exclusions
// Scan module VassalHideSide_<side> 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);
}
}

Expand Down Expand Up @@ -845,13 +844,12 @@ protected String promptForSide(String newSide) {
availableSides.clear();
availableSides.addAll(sides);

// Scan VassalHideSide_<side> properties for module-controlled exclusions (when true)
// Scan module VassalHideSide_<side> 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);
}
}
}
Expand Down

0 comments on commit fa84c01

Please sign in to comment.