Skip to content

Commit

Permalink
Merge pull request #4917 from MegaMek/mechview_cockpits
Browse files Browse the repository at this point in the history
Show cockpit type on MechView even for standard.
  • Loading branch information
neoancient authored Nov 28, 2023
2 parents 0aaf73a + a5db106 commit 6f2e4ea
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
10 changes: 10 additions & 0 deletions megamek/src/megamek/common/Mech.java
Original file line number Diff line number Diff line change
Expand Up @@ -3902,6 +3902,16 @@ public String getGyroTypeString() {
}

public String getCockpitTypeString() {
if (isIndustrial()) {
switch (getCockpitType()) {
case COCKPIT_STANDARD:
return Mech.getCockpitTypeString(COCKPIT_INDUSTRIAL) + " (Adv. FCS)";
case COCKPIT_PRIMITIVE:
return Mech.getCockpitTypeString(COCKPIT_PRIMITIVE_INDUSTRIAL) + " (Adv. FCS)";
case COCKPIT_SUPERHEAVY:
return Mech.getCockpitTypeString(COCKPIT_SUPERHEAVY_INDUSTRIAL) + " (Adv. FCS)";
}
}
return Mech.getCockpitTypeString(getCockpitType());
}

Expand Down
17 changes: 6 additions & 11 deletions megamek/src/megamek/common/MechView.java
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,8 @@ public MechView(final Entity entity, final boolean showDetail, final boolean use
}
sBasic.add(new LabeledElement(Messages.getString("MechView.HeatSinks"), hsString.toString()));

if (a.getCockpitType() != Mech.COCKPIT_STANDARD) {
sBasic.add(new LabeledElement(Messages.getString("MechView.Cockpit"),
a.getCockpitTypeString()));
}
sBasic.add(new LabeledElement(Messages.getString("MechView.Cockpit"),
a.getCockpitTypeString()));
}

if (isMech) {
Expand All @@ -436,13 +434,10 @@ public MechView(final Entity entity, final boolean showDetail, final boolean use
.append(" damaged)").append(warningEnd());
}
sBasic.add(new LabeledElement(aMech.getHeatSinkTypeName() + "s", hsString.toString()));
if ((aMech.getCockpitType() != Mech.COCKPIT_STANDARD)
|| aMech.hasArmoredCockpit()) {
sBasic.add(new LabeledElement(Messages.getString("MechView.Cockpit"),
aMech.getCockpitTypeString()
+ (aMech.hasArmoredCockpit() ? " (armored)" : "")));

}
sBasic.add(new LabeledElement(Messages.getString("MechView.Cockpit"),
aMech.getCockpitTypeString()
+ (aMech.hasArmoredCockpit() ? " (armored)" : "")));

String gyroString = aMech.getGyroTypeString();
if (aMech.getGyroHits() > 0) {
gyroString += " " + warningStart() + "(" + aMech.getGyroHits()
Expand Down

0 comments on commit 6f2e4ea

Please sign in to comment.