Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added VassalGameFileName property #12763

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -2278,6 +2277,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 @@ -2319,6 +2321,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