Skip to content

Commit

Permalink
Merge pull request #1349 from MegaMek/infantry_refresh
Browse files Browse the repository at this point in the history
Conventional infantry fixes
  • Loading branch information
SJuliez authored Dec 26, 2023
2 parents 37aa5ff + 9d360f3 commit 7adc1d0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions megameklab/src/megameklab/ui/infantry/CIStructureTab.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public class CIStructureTab extends ITab implements InfantryBuildListener {
public static final int T_MOUNT = 4;
public static final int T_AUGMENTATION = 5;


private BasicInfoView panBasicInfo;
private CIPlatoonTypeView panPlatoonType;
private CIWeaponView panWeapons;
Expand Down Expand Up @@ -424,6 +425,8 @@ public void platoonSizeChanged(int numSquads, int squadSize) {
getInfantry().setSquadSize(squadSize);
getInfantry().autoSetInternal();
panPlatoonType.setFromEntity(getInfantry());
refresh.refreshStatus();
refresh.refreshPreview();
}

@Override
Expand All @@ -440,10 +443,11 @@ public void specializationsChanged() {
public void numSecondaryChanged(final int count) {
if (getInfantry().getSecondaryWeapon() == null) {
getInfantry().setSecondaryWeaponsPerSquad(0);
} else if (count == 0) {
UnitUtil.replaceMainWeapon(getInfantry(), null, true);
getInfantry().setSpecializations(getInfantry().getSpecializations() & ~Infantry.TAG_TROOPS);
} else {
if (count == 0) {
UnitUtil.replaceMainWeapon(getInfantry(), null, true);
getInfantry().setSpecializations(getInfantry().getSpecializations() & ~Infantry.TAG_TROOPS);
}
getInfantry().setSecondaryWeaponsPerSquad(count);
}
refresh.refreshStatus();
Expand Down

0 comments on commit 7adc1d0

Please sign in to comment.