Skip to content

Commit

Permalink
Merge pull request #6527 from Scoppio/feat/auto-gif
Browse files Browse the repository at this point in the history
feat/gif your game
  • Loading branch information
HammerGS authored Feb 11, 2025
2 parents fc8c970 + 75caf49 commit 1d59a70
Show file tree
Hide file tree
Showing 7 changed files with 298 additions and 56 deletions.
2 changes: 2 additions & 0 deletions megamek/i18n/megamek/client/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -1278,6 +1278,8 @@ CommonSettingsDialog.entityOwnerColor=Add a border to the unit label
CommonSettingsDialog.floatingIso=Floating isometric (no hex sides in isometric mode)
CommonSettingsDialog.gameSummaryBV.name=Save game summary image of board
CommonSettingsDialog.gameSummaryBV.tooltip=At the end of certain phases, save an image of the board to {0}, creating a visual summary of the progression of the game.
CommonSettingsDialog.showUnitDisplayNamesOnMinimap.name=Show unit display name on minimap
CommonSettingsDialog.showUnitDisplayNamesOnMinimap.tooltip=Useful when you want to persist the game summary with the unit names. Helps to navigate the targets at a glance on a large map.
CommonSettingsDialog.gameSummaryMM.name=Save game summary image of minimap
CommonSettingsDialog.gameSummaryMM.tooltip=At the end of certain phases, save an image of the minimap to {0}, creating a visual summary of the progression of the game.
CommonSettingsDialog.generateNames=Generate a random name for the pilots of new units.
Expand Down
11 changes: 9 additions & 2 deletions megamek/src/megamek/client/ui/swing/CommonSettingsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,8 @@ private <T> void moveElement(DefaultListModel<T> srcModel, int srcIndex, int trg
Messages.getString("CommonSettingsDialog.gameSummaryBV.name"));
private final JCheckBox gameSummaryMM = new JCheckBox(
Messages.getString("CommonSettingsDialog.gameSummaryMM.name"));

private final JCheckBox showUnitDisplayNamesOnMinimap = new JCheckBox(
Messages.getString("CommonSettingsDialog.showUnitDisplayNamesOnMinimap.name"));
private JComboBox<String> skinFiles;
private JComboBox<UITheme> uiThemes;

Expand Down Expand Up @@ -1674,6 +1675,8 @@ private JPanel getMiniMapPanel() {
comps.add(checkboxEntry(drawFacingArrowsOnMiniMap, null));
comps.add(checkboxEntry(drawSensorRangeOnMiniMap, null));
comps.add(checkboxEntry(paintBordersOnMiniMap, null));
comps.add(checkboxEntry(showUnitDisplayNamesOnMinimap,
Messages.getString("CommonSettingsDialog.showUnitDisplayNamesOnMinimap.tooltip")));

SpinnerNumberModel movePathPersistenceModel = new SpinnerNumberModel(GUIP.getMovePathPersistenceOnMiniMap(), 0, 100, 1);
movePathPersistenceOnMiniMap = new JSpinner(movePathPersistenceModel);
Expand Down Expand Up @@ -2082,6 +2085,7 @@ public void setVisible(boolean visible) {
drawFacingArrowsOnMiniMap.setSelected(GUIP.getDrawFacingArrowsOnMiniMap());
drawSensorRangeOnMiniMap.setSelected(GUIP.getDrawSensorRangeOnMiniMap());
paintBordersOnMiniMap.setSelected(GUIP.paintBorders());
showUnitDisplayNamesOnMinimap.setSelected(GUIP.showUnitDisplayNamesOnMinimap());
levelhighlight.setSelected(GUIP.getLevelHighlight());
shadowMap.setSelected(GUIP.getShadowMap());
hexInclines.setSelected(GUIP.getHexInclines());
Expand Down Expand Up @@ -2473,6 +2477,7 @@ protected void okAction() {
GUIP.setDrawFacingArrowsOnMiniMap(drawFacingArrowsOnMiniMap.isSelected());
GUIP.setDrawSensorRangeOnMiniMap(drawSensorRangeOnMiniMap.isSelected());
GUIP.setPaintBorders(paintBordersOnMiniMap.isSelected());
GUIP.setShowUnitDisplayNamesOnMinimap(showUnitDisplayNamesOnMinimap.isSelected());
try {
GUIP.setButtonsPerRow(Integer.parseInt(buttonsPerRow.getText()));
} catch (Exception ex) {
Expand Down Expand Up @@ -2576,7 +2581,7 @@ protected void okAction() {
GUIP.setAutoSelectNextUnit(useAutoSelectNext.isSelected());
GUIP.setGameSummaryBoardView(gameSummaryBV.isSelected());
GUIP.setGameSummaryMinimap(gameSummaryMM.isSelected());

GUIP.setShowUnitDisplayNamesOnMinimap(showUnitDisplayNamesOnMinimap.isSelected());
UITheme newUITheme = (UITheme) uiThemes.getSelectedItem();
String oldUITheme = GUIP.getUITheme();
if (!oldUITheme.equals(newUITheme.getClassName())) {
Expand Down Expand Up @@ -2961,6 +2966,8 @@ public void itemStateChanged(ItemEvent event) {
GUIP.setPaintBorders(paintBordersOnMiniMap.isSelected());
} else if (source.equals(movePathPersistenceOnMiniMap)) {
GUIP.setMovePathPersistenceOnMiniMap((int) movePathPersistenceOnMiniMap.getValue());
} else if (source.equals(showUnitDisplayNamesOnMinimap)) {
GUIP.setShowUnitDisplayNamesOnMinimap(showUnitDisplayNamesOnMinimap.isSelected());
}
}

Expand Down
11 changes: 10 additions & 1 deletion megamek/src/megamek/client/ui/swing/GUIPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ public class GUIPreferences extends PreferenceStoreProxy {
public static final String SPLIT_PANE_A_DIVIDER_LOCATION = "SplitPaneADividerLocation";
public static final String GAME_SUMMARY_BOARD_VIEW = "GameSummaryBoardView";
public static final String GAME_SUMMARY_MINIMAP = "GameSummaryMinimap";
public static final String SHOW_UNIT_DISPLAY_NAMES_ON_MINIMAP = "ShowUnitDisplayNamesOnMinimap";
public static final String ENTITY_OWNER_LABEL_COLOR = "EntityOwnerLabelColor";
public static final String UNIT_LABEL_BORDER = "EntityOwnerLabelColor";
public static final String TEAM_COLORING = "EntityTeamLabelColor";
Expand Down Expand Up @@ -688,7 +689,7 @@ protected GUIPreferences() {
store.setDefault(MINI_MAP_SHOW_FACING_ARROW, true);
store.setDefault(MINI_MAP_PAINT_BORDERS, true);
store.setDefault(MINI_MAP_MOVE_PATH_PERSISTENCE, 2);

store.setDefault(SHOW_UNIT_DISPLAY_NAMES_ON_MINIMAP, false);
store.setDefault(MOVE_DISPLAY_TAB_DURING_PHASES, true);
store.setDefault(FIRE_DISPLAY_TAB_DURING_PHASES, true);

Expand Down Expand Up @@ -1077,6 +1078,10 @@ public boolean getGameSummaryMinimap() {
return store.getBoolean(GAME_SUMMARY_MINIMAP);
}

public boolean showUnitDisplayNamesOnMinimap() {
return store.getBoolean(SHOW_UNIT_DISPLAY_NAMES_ON_MINIMAP);
}

public boolean getEntityOwnerLabelColor() {
return store.getBoolean(ENTITY_OWNER_LABEL_COLOR);
}
Expand Down Expand Up @@ -1922,6 +1927,10 @@ public void setGameSummaryMinimap(boolean state) {
store.setValue(GAME_SUMMARY_MINIMAP, state);
}

public void setShowUnitDisplayNamesOnMinimap(boolean state) {
store.setValue(SHOW_UNIT_DISPLAY_NAMES_ON_MINIMAP, state);
}

public void setEntityOwnerLabelColor(boolean i) {
store.setValue(ENTITY_OWNER_LABEL_COLOR, i);
}
Expand Down
Loading

0 comments on commit 1d59a70

Please sign in to comment.