Skip to content

Commit

Permalink
manual shutdown no option needed
Browse files Browse the repository at this point in the history
  • Loading branch information
DM0000 committed Nov 2, 2024
1 parent f19b659 commit 63abcb5
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 29 deletions.
30 changes: 16 additions & 14 deletions megamek/src/megamek/client/ui/swing/GameOptionsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -483,13 +483,15 @@ private void addOption(JPanel groupPanel, IOption option) {
//Set to the maximum velocity if over
option.setValue(CapitalMissileBayWeapon.CAPITAL_MISSILE_MAX_VELOCITY);
}
} else if (option.getName().equals(OptionsConstants.RPG_BEGIN_SHUTDOWN)) {
if ((options.getOption(OptionsConstants.RPG_MANUAL_SHUTDOWN)).booleanValue()) {
optionComp.setEditable(editable);
} else {
optionComp.setEditable(false);
}
} else if (option.getName().equals(OptionsConstants.ADVANCED_ALTERNATE_MASC_ENHANCED)) {
}
// else if (option.getName().equals(OptionsConstants.RPG_BEGIN_SHUTDOWN)) {
// if ((options.getOption(OptionsConstants.RPG_MANUAL_SHUTDOWN)).booleanValue()) {
// optionComp.setEditable(editable);
// } else {
// optionComp.setEditable(false);
// }
// }
else if (option.getName().equals(OptionsConstants.ADVANCED_ALTERNATE_MASC_ENHANCED)) {
if ((options.getOption(OptionsConstants.ADVANCED_ALTERNATE_MASC)).booleanValue()) {
optionComp.setEditable(editable);
} else {
Expand Down Expand Up @@ -729,13 +731,13 @@ public void optionClicked(DialogOptionComponent clickedComp, IOption option, boo
comp_i.resetToDefault();
}
}
if (option.getName().equals(OptionsConstants.RPG_MANUAL_SHUTDOWN)) {
comps = optionComps.get(OptionsConstants.RPG_BEGIN_SHUTDOWN);
for (DialogOptionComponent comp_i : comps) {
comp_i.setEditable(state);
comp_i.setSelected(false);
}
}
// if (option.getName().equals(OptionsConstants.RPG_MANUAL_SHUTDOWN)) {
// comps = optionComps.get(OptionsConstants.RPG_BEGIN_SHUTDOWN);
// for (DialogOptionComponent comp_i : comps) {
// comp_i.setEditable(state);
// comp_i.setSelected(false);
// }
// }
if (option.getName().equals(OptionsConstants.ADVANCED_ALTERNATE_MASC)) {
comps = optionComps.get(OptionsConstants.ADVANCED_ALTERNATE_MASC_ENHANCED);
for (DialogOptionComponent comp_i : comps) {
Expand Down
20 changes: 10 additions & 10 deletions megamek/src/megamek/client/ui/swing/MovementDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,13 @@ public String getHotKeyDesc() {
* @return An array of valid commands for the given parameters
*/
public static MoveCommand[] values(int f, GameOptions opts, boolean forwardIni) {
boolean manualShutdown = false;
boolean manualShutdown = true;
boolean selfDestruct = false;
boolean advVehicle = false;
boolean vtolStrafe = false;

if (opts != null) {
manualShutdown = opts.booleanOption(OptionsConstants.RPG_MANUAL_SHUTDOWN);
// manualShutdown = opts.booleanOption(OptionsConstants.RPG_MANUAL_SHUTDOWN);
selfDestruct = opts.booleanOption(OptionsConstants.ADVANCED_TACOPS_SELF_DESTRUCT);
advVehicle = opts.booleanOption(OptionsConstants.ADVGRNDMOV_VEHICLE_ADVANCED_MANEUVERS);
vtolStrafe = opts.booleanOption(OptionsConstants.ADVCOMBAT_VTOL_STRAFING);
Expand Down Expand Up @@ -2616,10 +2616,10 @@ private void updateShutdownButton() {
return;
}

if (!clientgui.getClient().getGame().getOptions()
.booleanOption(OptionsConstants.RPG_MANUAL_SHUTDOWN)) {
return;
}
// if (!clientgui.getClient().getGame().getOptions()
// .booleanOption(OptionsConstants.RPG_MANUAL_SHUTDOWN)) {
// return;
// }

if (ce instanceof Infantry) {
return;
Expand All @@ -2635,10 +2635,10 @@ private void updateStartupButton() {
return;
}

if (!clientgui.getClient().getGame().getOptions()
.booleanOption(OptionsConstants.RPG_MANUAL_SHUTDOWN)) {
return;
}
// if (!clientgui.getClient().getGame().getOptions()
// .booleanOption(OptionsConstants.RPG_MANUAL_SHUTDOWN)) {
// return;
// }

if (ce instanceof Infantry) {
return;
Expand Down
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/options/GameOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ public synchronized void initialize() {
addOption(rpg, OptionsConstants.RPG_ARTILLERY_SKILL, false);
addOption(rpg, OptionsConstants.RPG_TOUGHNESS, false);
addOption(rpg, OptionsConstants.RPG_CONDITIONAL_EJECTION, false);
addOption(rpg, OptionsConstants.RPG_MANUAL_SHUTDOWN, false);
// addOption(rpg, OptionsConstants.RPG_MANUAL_SHUTDOWN, false);
addOption(rpg, OptionsConstants.RPG_BEGIN_SHUTDOWN, false);
}

Expand Down
2 changes: 1 addition & 1 deletion megamek/src/megamek/common/options/OptionsConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ public class OptionsConstants {
public static final String RPG_ARTILLERY_SKILL = "artillery_skill";
public static final String RPG_TOUGHNESS = "toughness";
public static final String RPG_CONDITIONAL_EJECTION = "conditional_ejection";
public static final String RPG_MANUAL_SHUTDOWN = "manual_shutdown";
// public static final String RPG_MANUAL_SHUTDOWN = "manual_shutdown";
public static final String RPG_BEGIN_SHUTDOWN = "begin_shutdown";

private OptionsConstants() { }
Expand Down
8 changes: 5 additions & 3 deletions megamek/src/megamek/server/ServerHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,11 @@ public static void resolveAeroHeat(Game game, Entity entity, Vector<Report> vPha
int roll = Compute.d6(2);
if (roll >= 8) {
entity.setTaserShutdownRounds(0);
if (!(game.getOptions().booleanOption(
OptionsConstants.RPG_MANUAL_SHUTDOWN)
&& entity.isManualShutdown())) {
if (!(
// game.getOptions().booleanOption(
// OptionsConstants.RPG_MANUAL_SHUTDOWN)
// &&
entity.isManualShutdown())) {
entity.setShutDown(false);
}
entity.setBATaserShutdown(false);
Expand Down

0 comments on commit 63abcb5

Please sign in to comment.