Skip to content

Commit

Permalink
Broaden search for "solo" PlayerSide, including a side in comma-separ…
Browse files Browse the repository at this point in the history
…ated list "VassalSkipSideList". VassalSkipSideList is a Global Translatable Message property.
  • Loading branch information
riverwanderer committed Sep 3, 2023
1 parent 903d382 commit b9be8a5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -622,15 +622,16 @@ protected boolean allSidesAllocated() {

/**
* @param side Name of a side to see if it's a "solo side"
* @return True if the side is "Solo" or begins "Solitaire", "Solo:", "Moderator", "Referee" or "."
* @return True if the side is "Solo" or begins "Solitaire", "Solo:", "Moderator", "Referee" or a Side
* found in the Global Translatable Message Property: VassalSkipSideList (a comma-separated list).
*/
public static boolean isSoloSide(String side) {
return side.startsWith(Resources.getString("PlayerRoster.solitaire")) ||
side.equals(Resources.getString("PlayerRoster.solo")) ||
side.startsWith(Resources.getString("PlayerRoster.solo") + ":") ||
side.startsWith(Resources.getString("PlayerRoster.moderator")) ||
side.startsWith(Resources.getString("PlayerRoster.referee")) ||
side.startsWith(" ");
("," + GameModule.getGameModule().getLocalizedProperty("VassalSkipSideList") + ",").contains("," + side + ",");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Only one player may be assigned to a side.
When joining a game, players will be prompted to take one of the remaining available sides.
Any number of observers (players who belong to no side) are allowed.

When prompting for a side, a next default entry is offered. Certain names are skipped in this process; these are "Solo" and names beginning "Solitaire", "Solo:", "Moderator", "Referee" or a space character. The later may be used to skip any auxiliary sides with any arbitrary name.
When prompting for a side, a next default entry is offered. Certain names are skipped in this process; these are "Solo" and names beginning "Solitaire", "Solo:", "Moderator", "Referee" or name found in the <<GlobalTranslatableMessages.adoc#top, Global Translatable Messages>> property _VassalSkipSideList_. If used, the later should be defined as a comma-separated list of Sides.

The <<Toolbar.adoc#Retire,Retire>> or <<Toolbar.adoc#SwitchSides,Switch Sides>> button, in the main controls toolbar, allows a player to relinquish their side (making it available to the next player joining the game). You can specify the text, icon, and mouse-over tooltip for the toolbar button.
|===
Expand Down

1 comment on commit b9be8a5

@riverwanderer
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Using a property to hold a comma-separated list of additional solo/non-player sides, rather than a prefix to the side name itself.

I assume that using a Global Translatable Message for the side list makes the new function language-proof, for modules where side names have been translated.

Re-tested successfully with C&C Ancients.

Please sign in to comment.