Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BA boosters/partial wing: update checks and gui #1366

Merged
merged 1 commit into from
Jan 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 0 additions & 43 deletions megameklab/src/megameklab/ui/battleArmor/BAEnhancementView.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ public void removeListener(BABuildListener l) {
private final JCheckBox chkMechJumpBooster = new JCheckBox();
private final JCheckBox chkMyomerBooster = new JCheckBox();

private ITechManager techManager;
private boolean ignoreEvents = false;

private final EquipmentType partialWing = EquipmentType.get(EquipmentTypeLookup.BA_PARTIAL_WING);
Expand All @@ -55,7 +54,6 @@ public void removeListener(BABuildListener l) {
private final EquipmentType myomerBooster = EquipmentType.get(EquipmentTypeLookup.BA_MYOMER_BOOSTER);

public BAEnhancementView(ITechManager techManager) {
this.techManager = techManager;
initUI();
}

Expand Down Expand Up @@ -93,53 +91,12 @@ private void initUI() {
}

public void setFromEntity(BattleArmor ba) {
if ((ba.getMovementMode() == EntityMovementMode.INF_JUMP)
&& (ba.getOriginalJumpMP() > 0)
&& !ba.hasWorkingMisc(MiscType.F_JUMP_BOOSTER)
&& techManager.isLegal(partialWing)) {
chkPartialWing.setEnabled(true);
ignoreEvents = true;
chkPartialWing.setSelected(ba.hasWorkingMisc(MiscType.F_PARTIAL_WING));
ignoreEvents = false;
} else {
chkPartialWing.setEnabled(false);
chkPartialWing.setSelected(false);
}

if ((ba.getMovementMode() == EntityMovementMode.INF_JUMP)
&& (ba.getOriginalJumpMP() > 0)
&& !ba.hasWorkingMisc(MiscType.F_PARTIAL_WING)
&& techManager.isLegal(jumpBooster)) {
chkJumpBooster.setEnabled(true);
ignoreEvents = true;
chkJumpBooster.setSelected(ba.hasWorkingMisc(MiscType.F_JUMP_BOOSTER));
ignoreEvents = false;
} else {
chkJumpBooster.setEnabled(false);
chkJumpBooster.setSelected(false);
}

if (techManager.isLegal(mechJumpBooster)
&& !ba.hasWorkingMisc(MiscType.F_MASC)) {
chkMechJumpBooster.setEnabled(true);
ignoreEvents = true;
chkMechJumpBooster.setSelected(ba.hasWorkingMisc(MiscType.F_MECHANICAL_JUMP_BOOSTER));
ignoreEvents = false;
} else {
chkMechJumpBooster.setEnabled(false);
chkMechJumpBooster.setSelected(false);
}

if (techManager.isLegal(myomerBooster)
&& !ba.hasWorkingMisc(MiscType.F_MECHANICAL_JUMP_BOOSTER)) {
chkMyomerBooster.setEnabled(true);
ignoreEvents = true;
chkMyomerBooster.setSelected(ba.hasWorkingMisc(MiscType.F_MASC));
ignoreEvents = false;
} else {
chkMyomerBooster.setEnabled(false);
chkMyomerBooster.setSelected(false);
}
}

@Override
Expand Down
Loading