Skip to content

Commit

Permalink
Merge pull request #12763 from riverwanderer/VassalGameFileName-property
Browse files Browse the repository at this point in the history
Added VassalGameFileName property
  • Loading branch information
uckelman authored Jan 17, 2024
2 parents 3051309 + a91b8bc commit 0867270
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 5 additions & 2 deletions vassal-app/src/main/java/VASSAL/build/GameModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,8 @@ public class GameModule extends AbstractConfigurable
public static final String MODULE_OTHER2_PROPERTY = "ModuleOther2"; //NON-NLS
public static final String MODULE_VASSAL_VERSION_CREATED_PROPERTY = "VassalVersionCreated"; //NON-NLS
public static final String MODULE_VASSAL_VERSION_RUNNING_PROPERTY = "VassalVersionRunning"; //NON-NLS

public static final String MODULE_CURRENT_LOCALE = "CurrentLanguage"; //NON-NLS
public static final String MODULE_CURRENT_LOCALE_NAME = "CurrentLanguageName"; //NON-NLS

public static final String DRAWING_MOUSEOVER_PROPERTY = "DrawingMouseover"; //NON-NLS
public static final String DRAWING_MOUSEOVER_INDEX_PROPERTY = "DrawingMouseoverIndex"; //NON-NLS

Expand All @@ -230,6 +228,7 @@ public class GameModule extends AbstractConfigurable
private static final char COMMAND_SEPARATOR = KeyEvent.VK_ESCAPE;

public static final String RECENT_GAMES = "RecentGames"; //NON-NLS
private static final String GAME_FILE_PROPERTY = "VassalGameFileName"; //NON-NLS

private final List<MenuItemProxy> openRecentItems = new ArrayList<>();

Expand Down Expand Up @@ -2281,6 +2280,9 @@ else if (GameModule.MODULE_CURRENT_LOCALE.equals(key)) {
else if (GameModule.MODULE_CURRENT_LOCALE_NAME.equals(key)) {
return Resources.getLocale().getDisplayName();
}
else if (GAME_FILE_PROPERTY.equals(key)) {
return gameFile;
}
else if (DRAWING_MOUSEOVER_PROPERTY.equals(key)) {
return CounterDetailViewer.isDrawingMouseOver();
}
Expand Down Expand Up @@ -2344,6 +2346,7 @@ public List<String> getPropertyNames() {
l.add(MODULE_CURRENT_LOCALE_NAME);
l.add(MODULE_VASSAL_VERSION_CREATED_PROPERTY);
l.add(MODULE_VASSAL_VERSION_RUNNING_PROPERTY);
l.add(GAME_FILE_PROPERTY);

return l;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,8 @@ A string that uniquely identifies an individual piece and is guaranteed to never
|*PlayerName* |<<GameModule.adoc#top,Game Module>>| Module| The Player Name of the current player
|*PlayerSide* |<<GameModule.adoc#top,Game Module>>| Module| The Side taken by the current player if Sides have been defined in the module
|*VassalVersionCreated* |<<GameModule.adoc#top,Game Module>>| Module| The version number of Vassal that was used to create the current module.
|*VassalVersionRuning* |<<GameModule.adoc#top,Game Module>>| Module| The version number of Vassal that is currently running.
|*VassalVersionRunning* |<<GameModule.adoc#top,Game Module>>| Module| The version number of Vassal that is currently running.
|*VassalGameFileName* |<<GameModule.adoc#top,Game Module>>| Module| The last game file opened by the current player.
|===

===== Property names provided by VASSAL Components that can be accessed by traits, but are dependent on the module
Expand Down

0 comments on commit 0867270

Please sign in to comment.