diff --git a/megameklab/resources/megameklab/resources/Views.properties b/megameklab/resources/megameklab/resources/Views.properties index 4bc10d132..791d0e752 100644 --- a/megameklab/resources/megameklab/resources/Views.properties +++ b/megameklab/resources/megameklab/resources/Views.properties @@ -150,6 +150,8 @@ AdvAeroChassisView.chkSail.text=Sail AdvAeroChassisView.chkSail.tooltip=Energy collection sail can charge a jump system or batteries. AdvAeroChassisView.chkModular.text=Modular AdvAeroChassisView.chkModular.tooltip=A modular space station is more expensive to produce but faster to build. This has no effect on play other than cost. +AdvAeroChassisView.chkKFAdapter.text=KF Adapter +AdvAeroChassisView.chkKFAdapter.tooltip=Adding a KF adapter makes it possible to move the station by JumpShip. This has no effect on play other than cost. AdvAeroChassisView.chkMilitary.text=Military AdvAeroChassisView.chkMilitary.tooltip=A military space station can make more frequent facing changes. AdvAeroChassisView.cbBaseType.text=Vessel Type: diff --git a/megameklab/src/megameklab/ui/largeAero/WSChassisView.java b/megameklab/src/megameklab/ui/largeAero/WSChassisView.java index 1356be62a..b363aa900 100644 --- a/megameklab/src/megameklab/ui/largeAero/WSChassisView.java +++ b/megameklab/src/megameklab/ui/largeAero/WSChassisView.java @@ -65,8 +65,9 @@ public void removeListener(AdvancedAeroBuildListener l) { final private JCheckBox chkSail = new JCheckBox(); final private JCheckBox chkMilitary = new JCheckBox(); final private JSpinner spnSI = new JSpinner(spnSIModel); + final private ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views"); - private ITechManager techManager; + private final ITechManager techManager; private int baseType; private int maxTonnage; private int minTonnage; @@ -80,7 +81,6 @@ public WSChassisView(ITechManager techManager) { } public void initUI() { - ResourceBundle resourceMap = ResourceBundle.getBundle("megameklab.resources.Views"); setLayout(new GridBagLayout()); GridBagConstraints gbc = new GridBagConstraints(); cbBaseType.setModel(new DefaultComboBoxModel<>(resourceMap.getString("AdvAeroChassisView.cbBaseType.values").split(","))); @@ -212,7 +212,7 @@ public void setFromEntity(Jumpship craft) { chkMilitary.addActionListener(this); chkModular.removeActionListener(this); chkModular.setSelected(craft.hasETypeFlag(Entity.ETYPE_SPACE_STATION) - && ((SpaceStation) craft).isModular()); + && ((SpaceStation) craft).isModularOrKFAdapter()); chkModular.addActionListener(this); @@ -252,8 +252,20 @@ public void refresh() { chkLFBattery.setVisible((baseType != TYPE_STATION) && techManager.isLegal(Jumpship.getLFBatteryTA())); chkMilitary.setVisible((baseType == TYPE_STATION)); + if (baseType == TYPE_STATION) { + if ((getTonnage() <= SpaceStation.MODULAR_MININUM_WEIGHT) + && techManager.isLegal(SpaceStation.getKFAdapterTA())) { + chkModular.setText(resourceMap.getString("AdvAeroChassisView.chkKFAdapter.text")); + chkModular.setToolTipText(resourceMap.getString("AdvAeroChassisView.chkKFAdapter.tooltip")); + } else if ((getTonnage() > SpaceStation.MODULAR_MININUM_WEIGHT) + && techManager.isLegal(SpaceStation.getModularTA())) { + chkModular.setText(resourceMap.getString("AdvAeroChassisView.chkModular.text")); + chkModular.setToolTipText(resourceMap.getString("AdvAeroChassisView.chkModular.tooltip")); + } + } chkModular.setVisible((baseType == TYPE_STATION) - && techManager.isLegal(SpaceStation.getModularTA())); + && techManager.isLegal(getTonnage() <= 100000.0 ? + SpaceStation.getKFAdapterTA() : SpaceStation.getModularTA())); } private void refreshTonnage() { diff --git a/megameklab/src/megameklab/ui/largeAero/WSStructureTab.java b/megameklab/src/megameklab/ui/largeAero/WSStructureTab.java index 15d438887..1fc2147a2 100644 --- a/megameklab/src/megameklab/ui/largeAero/WSStructureTab.java +++ b/megameklab/src/megameklab/ui/largeAero/WSStructureTab.java @@ -395,7 +395,7 @@ public void militaryChanged(boolean military) { @Override public void modularChanged(boolean modular) { if (getJumpship() instanceof SpaceStation) { - ((SpaceStation) getJumpship()).setModular(modular); + ((SpaceStation) getJumpship()).setModularOrKFAdapter(modular); } refresh.refreshPreview(); refresh.refreshStatus();