Skip to content

Commit

Permalink
Make Sleep's dummy window less obtrusive. Also fix a few minor doc er…
Browse files Browse the repository at this point in the history
…rors (parameters).
  • Loading branch information
riverwanderer committed Nov 21, 2024
1 parent 96cbe4e commit f97a55b
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions vassal-app/src/main/java/VASSAL/script/ExpressionInterpreter.java
Original file line number Diff line number Diff line change
Expand Up @@ -1047,7 +1047,7 @@ public Object sumLocation(Object property, Object location, Object map, Object e
*
* @param property Property Name to sum
* @param locationName Location Name to match
* @param mapName Map to check
* @param map Map to check
* @param filter Optional PieceFilter to check expression match
* @return
*/
Expand Down Expand Up @@ -1131,7 +1131,7 @@ public Object countMapLocation(Object locationName, Object mapName, Object prope
* Lowest-level CountLocation function called by all other versions
* @param locationName Location Name to search for
* @param map Map to search on
* @param propValue null if no property was supplied, or property name if supplied
* @param property null if no property was supplied, or property name if supplied
* @param filter Option filter implementing Property Match Expression
* @return Count of pieces
*/
Expand Down Expand Up @@ -1183,8 +1183,8 @@ public Object sumZone(Object property, Object zone, Object map, Object expressio
* Lowest-level SumZone function called by all other versions
*
* @param property Property Name to sum
* @param zone Zone Name to match
* @param mapName Map to check
* @param zoneName Zone Name to match
* @param map Map to check
* @param filter Optional PieceFilter to check expression match
* @return
*/
Expand Down Expand Up @@ -1267,7 +1267,7 @@ public Object countZone(Object zoneName, Object mapName, Object property, Object
* Lowest-level CountZone function called by all other versions
* @param zoneName Zone Name to search for
* @param map Map to search on
* @param propValue null if no property was supplied, or value of supplied property
* @param property null if no property was supplied, or value of supplied property
* @param filter Option filter implementing Property Match Expression
* @return Count of pieces
*/
Expand Down Expand Up @@ -1326,7 +1326,6 @@ public Object sumMap(Object property, Object map, Object expression, PropertySou
* Lowest-level SumMap function called by all other versions
* @param propertyName Property to sum
* @param map Map to search on
* @param propValue null if no property was supplied, or value of supplied property
* @param filter Option filter implementing Property Match Expression
* @return Count of pieces
*/
Expand Down Expand Up @@ -1419,9 +1418,8 @@ public Object countMap(Object map, Object property, Object expression, PropertyS

/**
* Lowest-level CountMap function called by all other versions
* @param propertyName Property to sum
* @param map Map to search on
* @param propValue null if no property was supplied, or value of supplied property
* @param map Map to search on
* @param propertyName null if no property was supplied, or value of supplied property
* @param filter Option filter implementing Property Match Expression
* @return Count of pieces
*/
Expand Down Expand Up @@ -2012,7 +2010,7 @@ public Object audit(Object message, Object conditionOrOptionList, Object optionL
* Refresh the screen, then delay for the specified number of milliseconds
*
* This is not pretty, but is the only way I have found to force a proper UI refresh
* - Open a modal dialog box way offscreen. This forces a an actual real Swing UI refresh, then hangs the UI
* - Open a modal dialog box way offscreen. This forces an actual real Swing UI refresh, then hangs the UI
* - Start a new thread that closes the dialog box after a specified delay
*
* @param ms Milliseconds to delay
Expand All @@ -2023,13 +2021,13 @@ public Object sleep(Object ms, PropertySource ps) {

final int milliSeconds = IntPropValue(ms);
final JDialog dialog = new JDialog(GameModule.getGameModule().getPlayerWindow(), true);
dialog.setLocation(-5000, -5000);
SwingUtilities.invokeLater(new DialogCloser(dialog, milliSeconds));

dialog.setLocation(-5000, -5000); // Like as not, the OS will put the window in top leftmost position
SwingUtilities.invokeLater(new DialogCloser(dialog, milliSeconds));
dialog.setUndecorated(true); // keeps the dialog box invisible by virtue of zero content.
dialog.setVisible(true);
return "";
}


}

0 comments on commit f97a55b

Please sign in to comment.