Skip to content

Commit

Permalink
Merge pull request #5460 from IllianiCBT/stratCon_deployUndeploy
Browse files Browse the repository at this point in the history
Refined Deploy/Undeploy Menu Behavior for GM Permissions.
  • Loading branch information
HammerGS authored Dec 22, 2024
2 parents ceff727 + 8cfdce5 commit 919ceb4
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 919ceb4

Please sign in to comment.