Skip to content

Commit

Permalink
Revert "12260-Pre & Post Refresh Hotkeys (vassalengine#12694)"
Browse files Browse the repository at this point in the history
This reverts commit 0ee8714.
  • Loading branch information
riverwanderer committed Sep 29, 2023
1 parent 1147014 commit fd1be0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import VASSAL.i18n.Resources;
import VASSAL.tools.BrowserSupport;
import VASSAL.tools.ErrorDialog;
import VASSAL.tools.NamedKeyStroke;
import VASSAL.tools.swing.FlowLabel;
import VASSAL.tools.swing.SwingUtils;
import net.miginfocom.swing.MigLayout;
Expand Down Expand Up @@ -341,10 +340,6 @@ public void execute(Set<String> options, Command command) throws IllegalBuildExc
}
}

// About to commence refreshing the game, allow a custom start...
GameModule.getGameModule().fireKeyStroke(NamedKeyStroke.of("VassalGHKpreRefresh"));


/*
* 2. Build a list in visual order of all stacks, decks, mats and other pieces that need refreshing
*/
Expand Down Expand Up @@ -541,11 +536,8 @@ else if (!decksToDelete.isEmpty()) {
log(Resources.getString("GameRefresher.refreshable_decks", refreshable));
log(Resources.getString(options.contains("DeleteOldDecks") ? "GameRefresher.deletable_decks" : "GameRefresher.deletable_decks_2", deletable)); //NON-NLS
log(Resources.getString(options.contains("AddNewDecks") ? "GameRefresher.addable_decks" : "GameRefresher.addable_decks_2", addable)); //NON-NLS

}
}
// After all refreshing, allow a custom finish...
GameModule.getGameModule().fireKeyStroke(NamedKeyStroke.of("VassalGHKpostRefresh"));
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Whenever a piece is created in a VASSAL game, the Id of the definition used to c

The Game Refresher works by matching the Id in each piece in the current game to the Id's of all piece definitions in the current module to find the new definition. If a match is found, then the piece is replaced with one created from the new defintion. Then each trait in the new Piece is checked to see if there is an EXACTLY matching trait in the old definition. If an EXACT match is found, then the 'state' of the old trait is copied over (e.g. what is the current layer showing, or current rotation facing).

Problems occur when the definition used to create the piece no longer exists in the module, or if traits are modified slightly so that they no longer EXACTLY match the old piece. There are various options in the Game Refresher dialog that can be used to help match and update these pieces and traits. In addition to these options, <<#RefreshHotkeys,special hotkeys>> can be used to perform custom maintenance routines which you have designed.
Problems occur when the definition used to create the piece no longer exists in the module, or if traits are modified slightly so that they no longer EXACTLY match the old piece. There are various options in the Game Refresher dialog that can be used to help match and update these pieces and traits.

[.text-center]
image:images/GameRefresher.png[]
Expand Down Expand Up @@ -61,7 +61,7 @@ Remove Decks from the game that no longer exist in the module. See the <<#DeckRe

*Add decks to game which have been added to the module since this game was created (empty deck will be added):*::

Add Decks to the game that have been added to the module. See the <<#DeckRefresher,Deck Refresher>> section below for full details.
Add Decks to teh game that have been added to the module. See the <<#DeckRefresher,Deck Refresher>> section below for full details.


|===
Expand All @@ -81,12 +81,3 @@ If you select the _Delete decks_ option, then any deck found in the current game

If you select the _Add decks_ option, then any _new_ deck found in the module definition that does not exist in the game being refreshed will be _added_. Note this will not add any _contents_ (e.g., cards) to the deck, it will only add the deck. If you need to add contents you will need to arrange to add them separately, e.g., from a piece palette, or dragged in from some other location.

[#RefreshHotkeys]
==== Pre & Post-Refresh Hotkeys
If this option is checked, the Refresher will trigger special hotkeys. _VassalGHKpreRefresh_ is triggered before refreshing and _VassalGHKpostRefresh_ after refreshing. You may use this feature to perform maintenance that you wish to carry out on Predefined Setup or game files. Potential uses include converting counters or populating a new deck.

Design and test your maintenance actions carefully. You can use _Refresh Counters_ to do one-off tests. Also, remember that Startup GKCs are not executed during Refresh Predefined Setups.

After a Refeshing Predefined Setups, save your module as a different file name so you can do re-runs on the original if need be.

Once you are done, consider disabling or removing the maintenance components so that further refreshes don’t trigger them accidentally.

0 comments on commit fd1be0f

Please sign in to comment.