diff --git a/megameklab/src/megameklab/ui/combatVehicle/CVStructureTab.java b/megameklab/src/megameklab/ui/combatVehicle/CVStructureTab.java index 481110df7..34a7ce50d 100644 --- a/megameklab/src/megameklab/ui/combatVehicle/CVStructureTab.java +++ b/megameklab/src/megameklab/ui/combatVehicle/CVStructureTab.java @@ -71,6 +71,7 @@ private void setUpPanels() { panPatchwork.setVisible(false); } panSummary = new SummaryView(eSource, + new UnitTypeSummaryItem(), new StructureSummaryItem(), new EngineSummaryItem(), new PropulsionSummaryItem(), diff --git a/megameklab/src/megameklab/ui/fighterAero/ASStructureTab.java b/megameklab/src/megameklab/ui/fighterAero/ASStructureTab.java index f1ac68647..61aaf5934 100644 --- a/megameklab/src/megameklab/ui/fighterAero/ASStructureTab.java +++ b/megameklab/src/megameklab/ui/fighterAero/ASStructureTab.java @@ -80,8 +80,10 @@ private void setUpPanels() { panPatchwork.setVisible(false); } panSummary = new SummaryView(eSource, + new UnitTypeSummaryItem(), new StructureSummaryItem(), new EngineSummaryItem(), + new CockpitSummaryItem(), new FuelSummaryItem(), new HeatsinkSummaryItem(), new ControlsSummaryItem(), diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/CockpitSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/CockpitSummaryItem.java index de4eaf617..ad7bac8e1 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/CockpitSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/CockpitSummaryItem.java @@ -1,7 +1,9 @@ package megameklab.ui.generalUnit.summary; +import megamek.common.AeroSpaceFighter; import megamek.common.Entity; import megamek.common.Mech; +import megamek.common.verifier.TestAero; import megamek.common.verifier.TestMech; import megameklab.util.UnitUtil; @@ -15,10 +17,14 @@ public String getName() { @Override public void refresh(Entity entity) { if ((entity instanceof Mech) && (((Mech) entity).getCockpitType() != Mech.COCKPIT_UNKNOWN)) { + Mech mek = (Mech) entity; + availabilityLabel.setText(mek.getCockpitTechAdvancement().getFullRatingName(entity.isClan())); TestMech testMech = (TestMech) UnitUtil.getEntityVerifier(entity); - availabilityLabel.setText(""); weightLabel.setText(formatWeight(testMech.getWeightCockpit(), entity)); critLabel.setText(formatCrits(getCockpitCrits((Mech) entity))); + } else if ((entity instanceof AeroSpaceFighter)) { + AeroSpaceFighter fighter = (AeroSpaceFighter) entity; + availabilityLabel.setText(fighter.getCockpitTechAdvancement().getFullRatingName(entity.isClan())); } else { availabilityLabel.setText(""); weightLabel.setText(""); diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/GyroSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/GyroSummaryItem.java index e4b6e2a90..0fa656284 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/GyroSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/GyroSummaryItem.java @@ -33,8 +33,9 @@ public String getName() { @Override public void refresh(Entity entity) { if ((entity instanceof Mech) && (entity.getGyroType() != Mech.GYRO_NONE)) { + Mech mek = (Mech) entity; + availabilityLabel.setText(mek.getGyroTechAdvancement().getFullRatingName(entity.isClan())); TestMech testMech = (TestMech) UnitUtil.getEntityVerifier(entity); - availabilityLabel.setText(""); weightLabel.setText(formatWeight(testMech.getWeightGyro(), entity)); critLabel.setText(formatCrits(getGyroCrits(entity))); } else { diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/MyomerEnhancementSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/MyomerEnhancementSummaryItem.java index 3e6037652..88c60c4c5 100644 --- a/megameklab/src/megameklab/ui/generalUnit/summary/MyomerEnhancementSummaryItem.java +++ b/megameklab/src/megameklab/ui/generalUnit/summary/MyomerEnhancementSummaryItem.java @@ -38,6 +38,10 @@ public void refresh(Entity entity) { availabilityLabel.setText(enhancement.get().getType().getFullRatingName(entity.isClan())); weightLabel.setText(formatWeight(enhancement.get().getTonnage(), entity)); critLabel.setText(formatCrits(enhancement.get().getCriticals())); + } else { + availabilityLabel.setText(""); + weightLabel.setText(""); + critLabel.setText(""); } } diff --git a/megameklab/src/megameklab/ui/generalUnit/summary/UnitTypeSummaryItem.java b/megameklab/src/megameklab/ui/generalUnit/summary/UnitTypeSummaryItem.java new file mode 100644 index 000000000..efcfd315b --- /dev/null +++ b/megameklab/src/megameklab/ui/generalUnit/summary/UnitTypeSummaryItem.java @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2024 - The MegaMek Team. All Rights Reserved. + * + * This file is part of MegaMekLab. + * + * MegaMek is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * MegaMek is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with MegaMek. If not, see . + */ +package megameklab.ui.generalUnit.summary; + +import megamek.common.Entity; + +public class UnitTypeSummaryItem extends AbstractSummaryItem { + + @Override + public String getName() { + return "Unit Type"; + } + + @Override + public void refresh(Entity entity) { + availabilityLabel.setText(entity.getConstructionTechAdvancement().getFullRatingName(entity.isClan())); + } +} \ No newline at end of file diff --git a/megameklab/src/megameklab/ui/largeAero/DSStructureTab.java b/megameklab/src/megameklab/ui/largeAero/DSStructureTab.java index 644c68d17..d641b19ba 100644 --- a/megameklab/src/megameklab/ui/largeAero/DSStructureTab.java +++ b/megameklab/src/megameklab/ui/largeAero/DSStructureTab.java @@ -70,6 +70,7 @@ private void setUpPanels() { panCrew = new LACrewView(panInfo); panArmorAllocation = new ArmorAllocationView(panInfo, Entity.ETYPE_AERO); panSummary = new SummaryView(eSource, + new UnitTypeSummaryItem(), new StructureSummaryItem(), new EngineSummaryItem(), new FuelSummaryItem(), diff --git a/megameklab/src/megameklab/ui/largeAero/WSStructureTab.java b/megameklab/src/megameklab/ui/largeAero/WSStructureTab.java index c4bafd125..764a6664f 100644 --- a/megameklab/src/megameklab/ui/largeAero/WSStructureTab.java +++ b/megameklab/src/megameklab/ui/largeAero/WSStructureTab.java @@ -73,6 +73,7 @@ private void setUpPanels() { panGravDecks = new WSGravDeckView(); panArmorAllocation = new ArmorAllocationView(panInfo, Entity.ETYPE_AERO); panSummary = new SummaryView(eSource, + new UnitTypeSummaryItem(), new StructureSummaryItem(), new EngineSummaryItem(), new FuelSummaryItem(), diff --git a/megameklab/src/megameklab/ui/mek/BMStructureTab.java b/megameklab/src/megameklab/ui/mek/BMStructureTab.java index f7d576c73..ec40e2faf 100644 --- a/megameklab/src/megameklab/ui/mek/BMStructureTab.java +++ b/megameklab/src/megameklab/ui/mek/BMStructureTab.java @@ -69,6 +69,7 @@ private void setUpPanels() { panArmorAllocation = new ArmorAllocationView(panBasicInfo, Entity.ETYPE_MECH); panPatchwork = new PatchworkArmorView(panBasicInfo); panSummary = new SummaryView(eSource, + new UnitTypeSummaryItem(), new StructureSummaryItem(), new EngineSummaryItem(), new GyroSummaryItem(), @@ -911,6 +912,7 @@ public void enhancementChanged(EquipmentType enhancement) { refresh.refreshBuild(); refresh.refreshPreview(); refresh.refreshStatus(); + refresh.refreshSummary(); } @Override diff --git a/megameklab/src/megameklab/ui/protoMek/PMStructureTab.java b/megameklab/src/megameklab/ui/protoMek/PMStructureTab.java index c25840da6..be01a9f6f 100644 --- a/megameklab/src/megameklab/ui/protoMek/PMStructureTab.java +++ b/megameklab/src/megameklab/ui/protoMek/PMStructureTab.java @@ -80,6 +80,7 @@ private void setUpPanels() { panMovement = new MovementView(panBasicInfo); panArmorAllocation = new ArmorAllocationView(panBasicInfo, Entity.ETYPE_PROTOMECH); panSummary = new SummaryView(eSource, + new UnitTypeSummaryItem(), new StructureSummaryItem(), new EngineSummaryItem(), new HeatsinkSummaryItem(), diff --git a/megameklab/src/megameklab/ui/supportVehicle/SVStructureTab.java b/megameklab/src/megameklab/ui/supportVehicle/SVStructureTab.java index 3d883cee1..19f35d77a 100644 --- a/megameklab/src/megameklab/ui/supportVehicle/SVStructureTab.java +++ b/megameklab/src/megameklab/ui/supportVehicle/SVStructureTab.java @@ -73,6 +73,7 @@ private void setupPanels() { panChassisMod = new SVChassisModView(panBasicInfo); panCrew = new SVCrewView(); panSummary = new SummaryView(eSource, + new UnitTypeSummaryItem(), new StructureSummaryItem(), new EngineSummaryItem(), new FuelSummaryItem(),