Skip to content

Commit

Permalink
Refined "Undeploy" menu behavior for GM permissions.
Browse files Browse the repository at this point in the history
Updated "Undeploy Force" and "Undeploy Unit" menu items to include "(GM)" labels and adjusted their enabled state to consider GM status. Ensured General Managers can override Strategic Con options when applicable. Improved clarity and functionality for deployment management.
  • Loading branch information
IllianiCBT committed Dec 20, 2024
1 parent 9c87518 commit 8cfdce5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions MekHQ/src/mekhq/gui/adapter/TOEMouseAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -1134,10 +1134,10 @@ protected Optional<JPopupMenu> createPopupMenu() {
}

if (StaticChecks.areAllForcesDeployed(forces)) {
menuItem = new JMenuItem("Undeploy Force");
menuItem = new JMenuItem("Undeploy Force (GM)");
menuItem.setActionCommand(TOEMouseAdapter.COMMAND_UNDEPLOY_FORCE + forceIds);
menuItem.addActionListener(this);
menuItem.setEnabled(!gui.getCampaign().getCampaignOptions().isUseStratCon());
menuItem.setEnabled(gui.getCampaign().isGM() || !gui.getCampaign().getCampaignOptions().isUseStratCon());
popup.add(menuItem);
}

Expand Down Expand Up @@ -1635,10 +1635,10 @@ protected Optional<JPopupMenu> createPopupMenu() {
}

if (StaticChecks.areAllUnitsDeployed(units)) {
menuItem = new JMenuItem("Undeploy Unit");
menuItem = new JMenuItem("Undeploy Unit (GM)");
menuItem.setActionCommand(TOEMouseAdapter.COMMAND_UNDEPLOY_UNIT + unitIds);
menuItem.addActionListener(this);
menuItem.setEnabled(!gui.getCampaign().getCampaignOptions().isUseStratCon());
menuItem.setEnabled(gui.getCampaign().isGM() || !gui.getCampaign().getCampaignOptions().isUseStratCon());
popup.add(menuItem);
}

Expand Down
4 changes: 2 additions & 2 deletions MekHQ/src/mekhq/gui/adapter/UnitTableMouseAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -1006,10 +1006,10 @@ protected Optional<JPopupMenu> createPopupMenu() {
}

if (oneDeployed) {
menuItem = new JMenuItem("Undeploy Unit");
menuItem = new JMenuItem("Undeploy Unit (GM)");
menuItem.setActionCommand(COMMAND_UNDEPLOY);
menuItem.addActionListener(this);
menuItem.setEnabled(!gui.getCampaign().getCampaignOptions().isUseStratCon());
menuItem.setEnabled(gui.getCampaign().isGM() || !gui.getCampaign().getCampaignOptions().isUseStratCon());
menu.add(menuItem);
}

Expand Down

0 comments on commit 8cfdce5

Please sign in to comment.