Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/editor-search-revamp-full-plus-r…
Browse files Browse the repository at this point in the history
…efreshGHK' into editor-search-revamp-full-plus-refreshGHK

# Conflicts:
#	vassal-app/src/main/java/VASSAL/configure/RefreshPredefinedSetupsDialog.java
  • Loading branch information
riverwanderer committed Nov 12, 2023
2 parents 0bba0ab + a99e4b0 commit af43631
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ public class RefreshPredefinedSetupsDialog extends JDialog {
private JCheckBox addNewDecks;
private JTextField pdsFilterBox;
private String pdsFilter;
private JCheckBox alertOn;
private JCheckBox fireHotkeys;
private JCheckBox alertOn;

private static final int FILE_NAME_REPORT_LENGTH = 15;


private final Set<String> options = new HashSet<>();

Expand Down Expand Up @@ -162,6 +165,10 @@ public void stateChanged(ChangeEvent e) {
alertOn = new JCheckBox(Resources.getString("Editor.RefreshPredefinedSetups.alertOn"), false);
panel.add(alertOn);

fireHotkeys = new JCheckBox(Resources.getString("GameRefresher.fire_global_hotkeys"));
fireHotkeys.setSelected(true);
panel.add(fireHotkeys);

// PDS can be set to refresh specific items only, based on a regex
final JPanel filterPanel = new JPanel(new MigLayout(ConfigurerLayout.STANDARD_INSETS_GAPY, "[]rel[grow,fill,push]")); // NON-NLS
filterPanel.add(new JLabel(Resources.getString("Editor.RefreshPredefinedSetups.filter_prompt")), "");
Expand Down Expand Up @@ -347,14 +354,14 @@ private void refreshPredefinedSetups() {
try {
if (pds.refreshWithStatus(options) > 0) {
flaggedFiles++;
lastErrorFile = pdsFile.length() > 15 ? pdsFile.substring(0, 12) + "..." : pdsFile;
lastErrorFile = fixedLength(pdsFile, FILE_NAME_REPORT_LENGTH);
}
refreshCount++;
}
catch (final IOException e) {
ErrorDialog.bug(e);
fails++;
lastErrorFile = pdsFile.length() > 15 ? pdsFile.substring(0, 12) + "..." : pdsFile;
lastErrorFile = fixedLength(pdsFile, FILE_NAME_REPORT_LENGTH);
}
finally {
GameModule.getGameModule().setRefreshingSemaphore(false); //BR// Make sure we definitely lower the semaphore
Expand Down Expand Up @@ -394,4 +401,8 @@ private boolean pdsFileProcessed(List<PredefinedSetup> modulePds, String file) {
return false;
}

private String fixedLength(String text, int length) {
return text.length() > length ? text.substring(0, length - 3) + "..." : text;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
=== Refresh Counters
When you update the <<GamePiece.adoc#top,Game Pieces>>, <<Prototypes.adoc#top,Prototypes>> and <<Decks and Cards.adoc#top,Decks>> in a module, those changes will affect any *future* games started using that module but the changes will not, by default at least, affect pieces in any ongoing games that you load with the new version of the module. VASSAL saved games include the complete definition of each piece in order to maintain saved game compatibility with older versions of a module: so that replays and saves sent to you by someone with an earlier version of the module will continue to work in the same way they always did with the old version.

Since <<GameModule.adoc#PredefinedSetup, Predefined Setups>> for module scenarios are stored internally as saved games, it is often important to module designers to be able to update an existing game to use the latest piece, prototype and deck definitions. That way a module designer can often avoid re-doing complex setups simply because pieces or decks have been updated and improved.
Since the <<GameModule.adoc#PredefinedSetup, Predefined Setups>> for module scenarios are stored internally as saved games, it is often important to module designers to be able to update an existing game to use the latest prototypes. That way a module designer can often avoid re-doing complex setups simply because prototypes have been updated and improved.

To use the refresher on the <<GameModule.adoc#PredefinedSetup, Predefined Setups>> in a module go to the _Editor's_ _Tools_ menu and select _Refresh Pre-Defined Setups_. You will be shown a dialog with several choices affecting the manner in which the operation is to be carried out.

Expand Down

0 comments on commit af43631

Please sign in to comment.