From 234164c91cc84450143ee56850f591316726495b Mon Sep 17 00:00:00 2001 From: Psi <189469115+psikomonkie@users.noreply.github.com> Date: Mon, 25 May 2026 17:51:59 -0400 Subject: [PATCH] PR: MekHQ Client Options to not fire surplus temp personnel on new day --- .../resources/mekhq/resources/GUI.properties | 20 +++ MekHQ/src/mekhq/MHQConstants.java | 10 ++ MekHQ/src/mekhq/MHQOptions.java | 80 ++++++++++++ .../mekhq/campaign/CampaignNewDayManager.java | 77 ++++++++--- .../mekhq/gui/dialog/MHQOptionsDialog.java | 120 ++++++++++++++++++ 5 files changed, 286 insertions(+), 21 deletions(-) diff --git a/MekHQ/resources/mekhq/resources/GUI.properties b/MekHQ/resources/mekhq/resources/GUI.properties index b8a00a90b9f..fde65d7e1e6 100644 --- a/MekHQ/resources/mekhq/resources/GUI.properties +++ b/MekHQ/resources/mekhq/resources/GUI.properties @@ -1013,6 +1013,26 @@ chkNewDayVesselGunnerPoolFill.toolTipText=Automatically fill the Vessel Gunner p chkNewDayVesselCrewPoolFill.text=Fill Vessel Crew Pool chkNewDayVesselCrewPoolFill.toolTipText=Automatically fill the Vessel Crew pool immediately upon selecting new day,\ \ and distribute to vessel units. +chkNewDayAstechPoolNoRelease.text=└ Do Not Release Surplus Astechs +chkNewDayAstechPoolNoRelease.toolTipText=When filling the Astech pool on new day, only hire to cover shortfalls. Surplus astechs are not released. +chkNewDayMedicPoolNoRelease.text=└ Do Not Release Surplus Medics +chkNewDayMedicPoolNoRelease.toolTipText=When filling the Medic pool on new day, only hire to cover shortfalls. Surplus medics are not released. +chkNewDaySoldierPoolNoRelease.text=└ Do Not Release Surplus Soldiers +chkNewDaySoldierPoolNoRelease.toolTipText=When filling the Soldier pool on new day, only hire to cover shortfalls. Surplus soldiers are not released. +chkNewDayBattleArmorPoolNoRelease.text=└ Do Not Release Surplus Battle Armor Crew +chkNewDayBattleArmorPoolNoRelease.toolTipText=When filling the Battle Armor pool on new day, only hire to cover shortfalls. Surplus crew are not released. +chkNewDayVehicleCrewGroundPoolNoRelease.text=└ Do Not Release Surplus Vehicle Crew (Ground) +chkNewDayVehicleCrewGroundPoolNoRelease.toolTipText=When filling the Vehicle Crew (Ground) pool on new day, only hire to cover shortfalls. Surplus crew are not released. +chkNewDayVehicleCrewVTOLPoolNoRelease.text=└ Do Not Release Surplus Vehicle Crew (VTOL) +chkNewDayVehicleCrewVTOLPoolNoRelease.toolTipText=When filling the Vehicle Crew (VTOL) pool on new day, only hire to cover shortfalls. Surplus crew are not released. +chkNewDayVehicleCrewNavalPoolNoRelease.text=└ Do Not Release Surplus Vehicle Crew (Naval) +chkNewDayVehicleCrewNavalPoolNoRelease.toolTipText=When filling the Vehicle Crew (Naval) pool on new day, only hire to cover shortfalls. Surplus crew are not released. +chkNewDayVesselPilotPoolNoRelease.text=└ Do Not Release Surplus Vessel Pilots +chkNewDayVesselPilotPoolNoRelease.toolTipText=When filling the Vessel Pilot pool on new day, only hire to cover shortfalls. Surplus pilots are not released. +chkNewDayVesselGunnerPoolNoRelease.text=└ Do Not Release Surplus Vessel Gunners +chkNewDayVesselGunnerPoolNoRelease.toolTipText=When filling the Vessel Gunner pool on new day, only hire to cover shortfalls. Surplus gunners are not released. +chkNewDayVesselCrewPoolNoRelease.text=└ Do Not Release Surplus Vessel Crew +chkNewDayVesselCrewPoolNoRelease.toolTipText=When filling the Vessel Crew pool on new day, only hire to cover shortfalls. Surplus crew are not released. chkNewDayMRMS.text=Run Mass Repair / Mass Salvage chkNewDayMRMS.toolTipText=Automatically run Mass Repair and/or Mass Salvage (based on the currently saved options) during new day processing. chkNewDayOptimizeMedicalAssignments.text=Optimize Medical Assignments diff --git a/MekHQ/src/mekhq/MHQConstants.java b/MekHQ/src/mekhq/MHQConstants.java index fc8d9565eef..7065fe26018 100644 --- a/MekHQ/src/mekhq/MHQConstants.java +++ b/MekHQ/src/mekhq/MHQConstants.java @@ -181,6 +181,16 @@ public final class MHQConstants extends SuiteConstants { public static final String NEW_DAY_VESSEL_PILOT_POOL_FILL = "newDayVesselPilotPoolFill"; public static final String NEW_DAY_VESSEL_GUNNER_POOL_FILL = "newDayVesselGunnerPoolFill"; public static final String NEW_DAY_VESSEL_CREW_POOL_FILL = "newDayVesselCrewPoolFill"; + public static final String NEW_DAY_AS_TECH_POOL_NO_RELEASE = "newDayAstechPoolNoRelease"; + public static final String NEW_DAY_MEDIC_POOL_NO_RELEASE = "newDayMedicPoolNoRelease"; + public static final String NEW_DAY_SOLDIER_POOL_NO_RELEASE = "newDaySoldierPoolNoRelease"; + public static final String NEW_DAY_BATTLE_ARMOR_POOL_NO_RELEASE = "newDayBattleArmorPoolNoRelease"; + public static final String NEW_DAY_VEHICLE_CREW_GROUND_POOL_NO_RELEASE = "newDayVehicleCrewGroundPoolNoRelease"; + public static final String NEW_DAY_VEHICLE_CREW_VTOL_POOL_NO_RELEASE = "newDayVehicleCrewVTOLPoolNoRelease"; + public static final String NEW_DAY_VEHICLE_CREW_NAVAL_POOL_NO_RELEASE = "newDayVehicleCrewNavalPoolNoRelease"; + public static final String NEW_DAY_VESSEL_PILOT_POOL_NO_RELEASE = "newDayVesselPilotPoolNoRelease"; + public static final String NEW_DAY_VESSEL_GUNNER_POOL_NO_RELEASE = "newDayVesselGunnerPoolNoRelease"; + public static final String NEW_DAY_VESSEL_CREW_POOL_NO_RELEASE = "newDayVesselCrewPoolNoRelease"; public static final String NEW_DAY_MRMS = "newDayMRMS"; public static final String NEW_DAY_OPTIMIZE_MEDICAL_ASSIGNMENTS = "NewDayOptimizeMedicalAssignments"; public static final String NEW_DAY_AUTOMATE_MAINTENANCE_ASSIGNMENTS = "NewDayAutomateMaintenanceAssignments"; diff --git a/MekHQ/src/mekhq/MHQOptions.java b/MekHQ/src/mekhq/MHQOptions.java index d1d79f39064..2b207c14d0f 100644 --- a/MekHQ/src/mekhq/MHQOptions.java +++ b/MekHQ/src/mekhq/MHQOptions.java @@ -915,6 +915,86 @@ public void setNewDayVesselCrewPoolFill(final boolean value) { userPreferences.node(MHQConstants.NEW_DAY_NODE).putBoolean(MHQConstants.NEW_DAY_VESSEL_CREW_POOL_FILL, value); } + public boolean getNewDayAsTechPoolNoRelease() { + return userPreferences.node(MHQConstants.NEW_DAY_NODE).getBoolean(MHQConstants.NEW_DAY_AS_TECH_POOL_NO_RELEASE, false); + } + + public void setNewDayAsTechPoolNoRelease(final boolean value) { + userPreferences.node(MHQConstants.NEW_DAY_NODE).putBoolean(MHQConstants.NEW_DAY_AS_TECH_POOL_NO_RELEASE, value); + } + + public boolean getNewDayMedicPoolNoRelease() { + return userPreferences.node(MHQConstants.NEW_DAY_NODE).getBoolean(MHQConstants.NEW_DAY_MEDIC_POOL_NO_RELEASE, false); + } + + public void setNewDayMedicPoolNoRelease(final boolean value) { + userPreferences.node(MHQConstants.NEW_DAY_NODE).putBoolean(MHQConstants.NEW_DAY_MEDIC_POOL_NO_RELEASE, value); + } + + public boolean getNewDaySoldierPoolNoRelease() { + return userPreferences.node(MHQConstants.NEW_DAY_NODE).getBoolean(MHQConstants.NEW_DAY_SOLDIER_POOL_NO_RELEASE, false); + } + + public void setNewDaySoldierPoolNoRelease(final boolean value) { + userPreferences.node(MHQConstants.NEW_DAY_NODE).putBoolean(MHQConstants.NEW_DAY_SOLDIER_POOL_NO_RELEASE, value); + } + + public boolean getNewDayBattleArmorPoolNoRelease() { + return userPreferences.node(MHQConstants.NEW_DAY_NODE).getBoolean(MHQConstants.NEW_DAY_BATTLE_ARMOR_POOL_NO_RELEASE, false); + } + + public void setNewDayBattleArmorPoolNoRelease(final boolean value) { + userPreferences.node(MHQConstants.NEW_DAY_NODE).putBoolean(MHQConstants.NEW_DAY_BATTLE_ARMOR_POOL_NO_RELEASE, value); + } + + public boolean getNewDayVehicleCrewGroundPoolNoRelease() { + return userPreferences.node(MHQConstants.NEW_DAY_NODE).getBoolean(MHQConstants.NEW_DAY_VEHICLE_CREW_GROUND_POOL_NO_RELEASE, false); + } + + public void setNewDayVehicleCrewGroundPoolNoRelease(final boolean value) { + userPreferences.node(MHQConstants.NEW_DAY_NODE).putBoolean(MHQConstants.NEW_DAY_VEHICLE_CREW_GROUND_POOL_NO_RELEASE, value); + } + + public boolean getNewDayVehicleCrewVTOLPoolNoRelease() { + return userPreferences.node(MHQConstants.NEW_DAY_NODE).getBoolean(MHQConstants.NEW_DAY_VEHICLE_CREW_VTOL_POOL_NO_RELEASE, false); + } + + public void setNewDayVehicleCrewVTOLPoolNoRelease(final boolean value) { + userPreferences.node(MHQConstants.NEW_DAY_NODE).putBoolean(MHQConstants.NEW_DAY_VEHICLE_CREW_VTOL_POOL_NO_RELEASE, value); + } + + public boolean getNewDayVehicleCrewNavalPoolNoRelease() { + return userPreferences.node(MHQConstants.NEW_DAY_NODE).getBoolean(MHQConstants.NEW_DAY_VEHICLE_CREW_NAVAL_POOL_NO_RELEASE, false); + } + + public void setNewDayVehicleCrewNavalPoolNoRelease(final boolean value) { + userPreferences.node(MHQConstants.NEW_DAY_NODE).putBoolean(MHQConstants.NEW_DAY_VEHICLE_CREW_NAVAL_POOL_NO_RELEASE, value); + } + + public boolean getNewDayVesselPilotPoolNoRelease() { + return userPreferences.node(MHQConstants.NEW_DAY_NODE).getBoolean(MHQConstants.NEW_DAY_VESSEL_PILOT_POOL_NO_RELEASE, false); + } + + public void setNewDayVesselPilotPoolNoRelease(final boolean value) { + userPreferences.node(MHQConstants.NEW_DAY_NODE).putBoolean(MHQConstants.NEW_DAY_VESSEL_PILOT_POOL_NO_RELEASE, value); + } + + public boolean getNewDayVesselGunnerPoolNoRelease() { + return userPreferences.node(MHQConstants.NEW_DAY_NODE).getBoolean(MHQConstants.NEW_DAY_VESSEL_GUNNER_POOL_NO_RELEASE, false); + } + + public void setNewDayVesselGunnerPoolNoRelease(final boolean value) { + userPreferences.node(MHQConstants.NEW_DAY_NODE).putBoolean(MHQConstants.NEW_DAY_VESSEL_GUNNER_POOL_NO_RELEASE, value); + } + + public boolean getNewDayVesselCrewPoolNoRelease() { + return userPreferences.node(MHQConstants.NEW_DAY_NODE).getBoolean(MHQConstants.NEW_DAY_VESSEL_CREW_POOL_NO_RELEASE, false); + } + + public void setNewDayVesselCrewPoolNoRelease(final boolean value) { + userPreferences.node(MHQConstants.NEW_DAY_NODE).putBoolean(MHQConstants.NEW_DAY_VESSEL_CREW_POOL_NO_RELEASE, value); + } + public boolean getNewDayMRMS() { return userPreferences.node(MHQConstants.NEW_DAY_NODE).getBoolean(MHQConstants.NEW_DAY_MRMS, false); } diff --git a/MekHQ/src/mekhq/campaign/CampaignNewDayManager.java b/MekHQ/src/mekhq/campaign/CampaignNewDayManager.java index 7d553840ac0..f50aea4bc03 100644 --- a/MekHQ/src/mekhq/campaign/CampaignNewDayManager.java +++ b/MekHQ/src/mekhq/campaign/CampaignNewDayManager.java @@ -105,6 +105,7 @@ import megamek.codeUtilities.StringUtility; import megamek.common.options.OptionsConstants; import megamek.logging.MMLogger; +import mekhq.MHQOptions; import mekhq.MekHQ; import mekhq.campaign.Campaign.AdministratorSpecialization; import mekhq.campaign.campaignOptions.CampaignOptions; @@ -249,52 +250,86 @@ public boolean newDay() { // clear previous retirement information campaign.getTurnoverRetirementInformation().clear(); - // Refill Automated Pools, if the options are selected - if (MekHQ.getMHQOptions().getNewDayAsTechPoolFill()) { - campaign.resetAsTechPool(); + // Refill Automated Pools, if the options are selected. + // When "no release" is also set, only hire to cover shortfalls (skip firing surplus). + final MHQOptions mhqOptions = MekHQ.getMHQOptions(); + if (mhqOptions.getNewDayAsTechPoolFill()) { + if (mhqOptions.getNewDayAsTechPoolNoRelease()) { + campaign.fillAsTechPool(); + } else { + campaign.resetAsTechPool(); + } } - if (MekHQ.getMHQOptions().getNewDayMedicPoolFill()) { - campaign.resetMedicPool(); + if (mhqOptions.getNewDayMedicPoolFill()) { + if (mhqOptions.getNewDayMedicPoolNoRelease()) { + campaign.fillMedicPool(); + } else { + campaign.resetMedicPool(); + } } - if (MekHQ.getMHQOptions().getNewDaySoldierPoolFill()) { - campaign.resetTempCrewPoolForRole(PersonnelRole.SOLDIER); + if (mhqOptions.getNewDaySoldierPoolFill()) { + if (!mhqOptions.getNewDaySoldierPoolNoRelease()) { + campaign.emptyTempCrewPoolForRole(PersonnelRole.SOLDIER); + } + campaign.fillTempCrewPoolForRole(PersonnelRole.SOLDIER); campaign.distributeTempCrewPoolToUnits(PersonnelRole.SOLDIER); } - if (MekHQ.getMHQOptions().getNewDayBattleArmorPoolFill()) { - campaign.resetTempCrewPoolForRole(PersonnelRole.BATTLE_ARMOUR); + if (mhqOptions.getNewDayBattleArmorPoolFill()) { + if (!mhqOptions.getNewDayBattleArmorPoolNoRelease()) { + campaign.emptyTempCrewPoolForRole(PersonnelRole.BATTLE_ARMOUR); + } + campaign.fillTempCrewPoolForRole(PersonnelRole.BATTLE_ARMOUR); campaign.distributeTempCrewPoolToUnits(PersonnelRole.BATTLE_ARMOUR); } - if (MekHQ.getMHQOptions().getNewDayVehicleCrewGroundPoolFill()) { - campaign.resetTempCrewPoolForRole(PersonnelRole.VEHICLE_CREW_GROUND); + if (mhqOptions.getNewDayVehicleCrewGroundPoolFill()) { + if (!mhqOptions.getNewDayVehicleCrewGroundPoolNoRelease()) { + campaign.emptyTempCrewPoolForRole(PersonnelRole.VEHICLE_CREW_GROUND); + } + campaign.fillTempCrewPoolForRole(PersonnelRole.VEHICLE_CREW_GROUND); campaign.distributeTempCrewPoolToUnits(PersonnelRole.VEHICLE_CREW_GROUND); } - if (MekHQ.getMHQOptions().getNewDayVehicleCrewVTOLPoolFill()) { - campaign.resetTempCrewPoolForRole(PersonnelRole.VEHICLE_CREW_VTOL); + if (mhqOptions.getNewDayVehicleCrewVTOLPoolFill()) { + if (!mhqOptions.getNewDayVehicleCrewVTOLPoolNoRelease()) { + campaign.emptyTempCrewPoolForRole(PersonnelRole.VEHICLE_CREW_VTOL); + } + campaign.fillTempCrewPoolForRole(PersonnelRole.VEHICLE_CREW_VTOL); campaign.distributeTempCrewPoolToUnits(PersonnelRole.VEHICLE_CREW_VTOL); } - if (MekHQ.getMHQOptions().getNewDayVehicleCrewNavalPoolFill()) { - campaign.resetTempCrewPoolForRole(PersonnelRole.VEHICLE_CREW_NAVAL); + if (mhqOptions.getNewDayVehicleCrewNavalPoolFill()) { + if (!mhqOptions.getNewDayVehicleCrewNavalPoolNoRelease()) { + campaign.emptyTempCrewPoolForRole(PersonnelRole.VEHICLE_CREW_NAVAL); + } + campaign.fillTempCrewPoolForRole(PersonnelRole.VEHICLE_CREW_NAVAL); campaign.distributeTempCrewPoolToUnits(PersonnelRole.VEHICLE_CREW_NAVAL); } - if (MekHQ.getMHQOptions().getNewDayVesselPilotPoolFill()) { - campaign.resetTempCrewPoolForRole(PersonnelRole.VESSEL_PILOT); + if (mhqOptions.getNewDayVesselPilotPoolFill()) { + if (!mhqOptions.getNewDayVesselPilotPoolNoRelease()) { + campaign.emptyTempCrewPoolForRole(PersonnelRole.VESSEL_PILOT); + } + campaign.fillTempCrewPoolForRole(PersonnelRole.VESSEL_PILOT); campaign.distributeTempCrewPoolToUnits(PersonnelRole.VESSEL_PILOT); } - if (MekHQ.getMHQOptions().getNewDayVesselGunnerPoolFill()) { - campaign.resetTempCrewPoolForRole(PersonnelRole.VESSEL_GUNNER); + if (mhqOptions.getNewDayVesselGunnerPoolFill()) { + if (!mhqOptions.getNewDayVesselGunnerPoolNoRelease()) { + campaign.emptyTempCrewPoolForRole(PersonnelRole.VESSEL_GUNNER); + } + campaign.fillTempCrewPoolForRole(PersonnelRole.VESSEL_GUNNER); campaign.distributeTempCrewPoolToUnits(PersonnelRole.VESSEL_GUNNER); } - if (MekHQ.getMHQOptions().getNewDayVesselCrewPoolFill()) { - campaign.resetTempCrewPoolForRole(PersonnelRole.VESSEL_CREW); + if (mhqOptions.getNewDayVesselCrewPoolFill()) { + if (!mhqOptions.getNewDayVesselCrewPoolNoRelease()) { + campaign.emptyTempCrewPoolForRole(PersonnelRole.VESSEL_CREW); + } + campaign.fillTempCrewPoolForRole(PersonnelRole.VESSEL_CREW); campaign.distributeTempCrewPoolToUnits(PersonnelRole.VESSEL_CREW); } diff --git a/MekHQ/src/mekhq/gui/dialog/MHQOptionsDialog.java b/MekHQ/src/mekhq/gui/dialog/MHQOptionsDialog.java index 90392b11249..3a40d3865c3 100644 --- a/MekHQ/src/mekhq/gui/dialog/MHQOptionsDialog.java +++ b/MekHQ/src/mekhq/gui/dialog/MHQOptionsDialog.java @@ -184,15 +184,25 @@ public class MHQOptionsDialog extends AbstractMHQButtonDialog { // region New Day private JCheckBox chkNewDayAsTechPoolFill; + private JCheckBox chkNewDayAsTechPoolNoRelease; private JCheckBox chkNewDayMedicPoolFill; + private JCheckBox chkNewDayMedicPoolNoRelease; private JCheckBox chkNewDaySoldierPoolFill; + private JCheckBox chkNewDaySoldierPoolNoRelease; private JCheckBox chkNewDayBattleArmorPoolFill; + private JCheckBox chkNewDayBattleArmorPoolNoRelease; private JCheckBox chkNewDayVehicleCrewGroundPoolFill; + private JCheckBox chkNewDayVehicleCrewGroundPoolNoRelease; private JCheckBox chkNewDayVehicleCrewVTOLPoolFill; + private JCheckBox chkNewDayVehicleCrewVTOLPoolNoRelease; private JCheckBox chkNewDayVehicleCrewNavalPoolFill; + private JCheckBox chkNewDayVehicleCrewNavalPoolNoRelease; private JCheckBox chkNewDayVesselPilotPoolFill; + private JCheckBox chkNewDayVesselPilotPoolNoRelease; private JCheckBox chkNewDayVesselGunnerPoolFill; + private JCheckBox chkNewDayVesselGunnerPoolNoRelease; private JCheckBox chkNewDayVesselCrewPoolFill; + private JCheckBox chkNewDayVesselCrewPoolNoRelease; private JCheckBox chkNewDayMRMS; private JCheckBox chkNewDayOptimizeMedicalAssignments; private JCheckBox chkNewDayAutomaticallyAssignUnmaintainedUnits; @@ -961,45 +971,105 @@ private JPanel createNewDayTab() { chkNewDayAsTechPoolFill.setToolTipText(resources.getString("chkNewDayAstechPoolFill.toolTipText")); chkNewDayAsTechPoolFill.setName("chkNewDayAsTechPoolFill"); + chkNewDayAsTechPoolNoRelease = new JCheckBox(resources.getString("chkNewDayAstechPoolNoRelease.text")); + chkNewDayAsTechPoolNoRelease.setToolTipText(resources.getString("chkNewDayAstechPoolNoRelease.toolTipText")); + chkNewDayAsTechPoolNoRelease.setName("chkNewDayAsTechPoolNoRelease"); + chkNewDayAsTechPoolFill.addItemListener(e -> + chkNewDayAsTechPoolNoRelease.setEnabled(chkNewDayAsTechPoolFill.isSelected())); + chkNewDayMedicPoolFill = new JCheckBox(resources.getString("chkNewDayMedicPoolFill.text")); chkNewDayMedicPoolFill.setToolTipText(resources.getString("chkNewDayMedicPoolFill.toolTipText")); chkNewDayMedicPoolFill.setName("chkNewDayMedicPoolFill"); + chkNewDayMedicPoolNoRelease = new JCheckBox(resources.getString("chkNewDayMedicPoolNoRelease.text")); + chkNewDayMedicPoolNoRelease.setToolTipText(resources.getString("chkNewDayMedicPoolNoRelease.toolTipText")); + chkNewDayMedicPoolNoRelease.setName("chkNewDayMedicPoolNoRelease"); + chkNewDayMedicPoolFill.addItemListener(e -> + chkNewDayMedicPoolNoRelease.setEnabled(chkNewDayMedicPoolFill.isSelected())); + chkNewDaySoldierPoolFill = new JCheckBox(resources.getString("chkNewDaySoldierPoolFill.text")); chkNewDaySoldierPoolFill.setToolTipText(resources.getString("chkNewDaySoldierPoolFill.toolTipText")); chkNewDaySoldierPoolFill.setName("chkNewDaySoldierPoolFill"); + chkNewDaySoldierPoolNoRelease = new JCheckBox(resources.getString("chkNewDaySoldierPoolNoRelease.text")); + chkNewDaySoldierPoolNoRelease.setToolTipText(resources.getString("chkNewDaySoldierPoolNoRelease.toolTipText")); + chkNewDaySoldierPoolNoRelease.setName("chkNewDaySoldierPoolNoRelease"); + chkNewDaySoldierPoolFill.addItemListener(e -> + chkNewDaySoldierPoolNoRelease.setEnabled(chkNewDaySoldierPoolFill.isSelected())); + chkNewDayBattleArmorPoolFill = new JCheckBox(resources.getString("chkNewDayBattleArmorPoolFill.text")); chkNewDayBattleArmorPoolFill.setToolTipText(resources.getString("chkNewDayBattleArmorPoolFill.toolTipText")); chkNewDayBattleArmorPoolFill.setName("chkNewDayBattleArmorPoolFill"); + chkNewDayBattleArmorPoolNoRelease = new JCheckBox(resources.getString("chkNewDayBattleArmorPoolNoRelease.text")); + chkNewDayBattleArmorPoolNoRelease.setToolTipText(resources.getString("chkNewDayBattleArmorPoolNoRelease.toolTipText")); + chkNewDayBattleArmorPoolNoRelease.setName("chkNewDayBattleArmorPoolNoRelease"); + chkNewDayBattleArmorPoolFill.addItemListener(e -> + chkNewDayBattleArmorPoolNoRelease.setEnabled(chkNewDayBattleArmorPoolFill.isSelected())); + chkNewDayVehicleCrewGroundPoolFill = new JCheckBox(resources.getString("chkNewDayVehicleCrewGroundPoolFill.text")); chkNewDayVehicleCrewGroundPoolFill.setToolTipText(resources.getString( "chkNewDayVehicleCrewGroundPoolFill.toolTipText")); chkNewDayVehicleCrewGroundPoolFill.setName("chkNewDayVehicleCrewGroundPoolFill"); + chkNewDayVehicleCrewGroundPoolNoRelease = new JCheckBox(resources.getString("chkNewDayVehicleCrewGroundPoolNoRelease.text")); + chkNewDayVehicleCrewGroundPoolNoRelease.setToolTipText(resources.getString("chkNewDayVehicleCrewGroundPoolNoRelease.toolTipText")); + chkNewDayVehicleCrewGroundPoolNoRelease.setName("chkNewDayVehicleCrewGroundPoolNoRelease"); + chkNewDayVehicleCrewGroundPoolFill.addItemListener(e -> + chkNewDayVehicleCrewGroundPoolNoRelease.setEnabled(chkNewDayVehicleCrewGroundPoolFill.isSelected())); + chkNewDayVehicleCrewVTOLPoolFill = new JCheckBox(resources.getString("chkNewDayVehicleCrewVTOLPoolFill.text")); chkNewDayVehicleCrewVTOLPoolFill.setToolTipText(resources.getString( "chkNewDayVehicleCrewVTOLPoolFill.toolTipText")); chkNewDayVehicleCrewVTOLPoolFill.setName("chkNewDayVehicleCrewVTOLPoolFill"); + chkNewDayVehicleCrewVTOLPoolNoRelease = new JCheckBox(resources.getString("chkNewDayVehicleCrewVTOLPoolNoRelease.text")); + chkNewDayVehicleCrewVTOLPoolNoRelease.setToolTipText(resources.getString("chkNewDayVehicleCrewVTOLPoolNoRelease.toolTipText")); + chkNewDayVehicleCrewVTOLPoolNoRelease.setName("chkNewDayVehicleCrewVTOLPoolNoRelease"); + chkNewDayVehicleCrewVTOLPoolFill.addItemListener(e -> + chkNewDayVehicleCrewVTOLPoolNoRelease.setEnabled(chkNewDayVehicleCrewVTOLPoolFill.isSelected())); + chkNewDayVehicleCrewNavalPoolFill = new JCheckBox(resources.getString("chkNewDayVehicleCrewNavalPoolFill.text")); chkNewDayVehicleCrewNavalPoolFill.setToolTipText(resources.getString( "chkNewDayVehicleCrewNavalPoolFill.toolTipText")); chkNewDayVehicleCrewNavalPoolFill.setName("chkNewDayVehicleCrewNavalPoolFill"); + chkNewDayVehicleCrewNavalPoolNoRelease = new JCheckBox(resources.getString("chkNewDayVehicleCrewNavalPoolNoRelease.text")); + chkNewDayVehicleCrewNavalPoolNoRelease.setToolTipText(resources.getString("chkNewDayVehicleCrewNavalPoolNoRelease.toolTipText")); + chkNewDayVehicleCrewNavalPoolNoRelease.setName("chkNewDayVehicleCrewNavalPoolNoRelease"); + chkNewDayVehicleCrewNavalPoolFill.addItemListener(e -> + chkNewDayVehicleCrewNavalPoolNoRelease.setEnabled(chkNewDayVehicleCrewNavalPoolFill.isSelected())); + chkNewDayVesselPilotPoolFill = new JCheckBox(resources.getString("chkNewDayVesselPilotPoolFill.text")); chkNewDayVesselPilotPoolFill.setToolTipText(resources.getString("chkNewDayVesselPilotPoolFill.toolTipText")); chkNewDayVesselPilotPoolFill.setName("chkNewDayVesselPilotPoolFill"); + chkNewDayVesselPilotPoolNoRelease = new JCheckBox(resources.getString("chkNewDayVesselPilotPoolNoRelease.text")); + chkNewDayVesselPilotPoolNoRelease.setToolTipText(resources.getString("chkNewDayVesselPilotPoolNoRelease.toolTipText")); + chkNewDayVesselPilotPoolNoRelease.setName("chkNewDayVesselPilotPoolNoRelease"); + chkNewDayVesselPilotPoolFill.addItemListener(e -> + chkNewDayVesselPilotPoolNoRelease.setEnabled(chkNewDayVesselPilotPoolFill.isSelected())); + chkNewDayVesselGunnerPoolFill = new JCheckBox(resources.getString("chkNewDayVesselGunnerPoolFill.text")); chkNewDayVesselGunnerPoolFill.setToolTipText(resources.getString("chkNewDayVesselGunnerPoolFill.toolTipText")); chkNewDayVesselGunnerPoolFill.setName("chkNewDayVesselGunnerPoolFill"); + chkNewDayVesselGunnerPoolNoRelease = new JCheckBox(resources.getString("chkNewDayVesselGunnerPoolNoRelease.text")); + chkNewDayVesselGunnerPoolNoRelease.setToolTipText(resources.getString("chkNewDayVesselGunnerPoolNoRelease.toolTipText")); + chkNewDayVesselGunnerPoolNoRelease.setName("chkNewDayVesselGunnerPoolNoRelease"); + chkNewDayVesselGunnerPoolFill.addItemListener(e -> + chkNewDayVesselGunnerPoolNoRelease.setEnabled(chkNewDayVesselGunnerPoolFill.isSelected())); + chkNewDayVesselCrewPoolFill = new JCheckBox(resources.getString("chkNewDayVesselCrewPoolFill.text")); chkNewDayVesselCrewPoolFill.setToolTipText(resources.getString("chkNewDayVesselCrewPoolFill.toolTipText")); chkNewDayVesselCrewPoolFill.setName("chkNewDayVesselCrewPoolFill"); + chkNewDayVesselCrewPoolNoRelease = new JCheckBox(resources.getString("chkNewDayVesselCrewPoolNoRelease.text")); + chkNewDayVesselCrewPoolNoRelease.setToolTipText(resources.getString("chkNewDayVesselCrewPoolNoRelease.toolTipText")); + chkNewDayVesselCrewPoolNoRelease.setName("chkNewDayVesselCrewPoolNoRelease"); + chkNewDayVesselCrewPoolFill.addItemListener(e -> + chkNewDayVesselCrewPoolNoRelease.setEnabled(chkNewDayVesselCrewPoolFill.isSelected())); + chkNewDayMRMS = new JCheckBox(resources.getString("chkNewDayMRMS.text")); chkNewDayMRMS.setToolTipText(resources.getString("chkNewDayMRMS.toolTipText")); chkNewDayMRMS.setName("chkNewDayMRMS"); @@ -1078,15 +1148,25 @@ public Component getListCellRendererComponent(final JList list, final Object layout.setVerticalGroup(layout.createSequentialGroup() .addComponent(chkNewDayAsTechPoolFill) + .addComponent(chkNewDayAsTechPoolNoRelease) .addComponent(chkNewDayMedicPoolFill) + .addComponent(chkNewDayMedicPoolNoRelease) .addComponent(chkNewDaySoldierPoolFill) + .addComponent(chkNewDaySoldierPoolNoRelease) .addComponent(chkNewDayBattleArmorPoolFill) + .addComponent(chkNewDayBattleArmorPoolNoRelease) .addComponent(chkNewDayVehicleCrewGroundPoolFill) + .addComponent(chkNewDayVehicleCrewGroundPoolNoRelease) .addComponent(chkNewDayVehicleCrewVTOLPoolFill) + .addComponent(chkNewDayVehicleCrewVTOLPoolNoRelease) .addComponent(chkNewDayVehicleCrewNavalPoolFill) + .addComponent(chkNewDayVehicleCrewNavalPoolNoRelease) .addComponent(chkNewDayVesselPilotPoolFill) + .addComponent(chkNewDayVesselPilotPoolNoRelease) .addComponent(chkNewDayVesselGunnerPoolFill) + .addComponent(chkNewDayVesselGunnerPoolNoRelease) .addComponent(chkNewDayVesselCrewPoolFill) + .addComponent(chkNewDayVesselCrewPoolNoRelease) .addComponent(chkNewDayMRMS) .addComponent(chkNewDayOptimizeMedicalAssignments) .addComponent(chkNewDayAutomaticallyAssignUnmaintainedUnits) @@ -1102,15 +1182,25 @@ public Component getListCellRendererComponent(final JList list, final Object layout.setHorizontalGroup(layout.createParallelGroup(Alignment.LEADING) .addComponent(chkNewDayAsTechPoolFill) + .addComponent(chkNewDayAsTechPoolNoRelease) .addComponent(chkNewDayMedicPoolFill) + .addComponent(chkNewDayMedicPoolNoRelease) .addComponent(chkNewDaySoldierPoolFill) + .addComponent(chkNewDaySoldierPoolNoRelease) .addComponent(chkNewDayBattleArmorPoolFill) + .addComponent(chkNewDayBattleArmorPoolNoRelease) .addComponent(chkNewDayVehicleCrewGroundPoolFill) + .addComponent(chkNewDayVehicleCrewGroundPoolNoRelease) .addComponent(chkNewDayVehicleCrewVTOLPoolFill) + .addComponent(chkNewDayVehicleCrewVTOLPoolNoRelease) .addComponent(chkNewDayVehicleCrewNavalPoolFill) + .addComponent(chkNewDayVehicleCrewNavalPoolNoRelease) .addComponent(chkNewDayVesselPilotPoolFill) + .addComponent(chkNewDayVesselPilotPoolNoRelease) .addComponent(chkNewDayVesselGunnerPoolFill) + .addComponent(chkNewDayVesselGunnerPoolNoRelease) .addComponent(chkNewDayVesselCrewPoolFill) + .addComponent(chkNewDayVesselCrewPoolNoRelease) .addComponent(chkNewDayMRMS) .addComponent(chkNewDayOptimizeMedicalAssignments) .addComponent(chkNewDayAutomaticallyAssignUnmaintainedUnits) @@ -1648,17 +1738,27 @@ protected void okAction() { options.setMaximumNumberOfAutoSavesValue((Integer) spinnerSavedGamesCount.getValue()); options.setNewDayAsTechPoolFill(chkNewDayAsTechPoolFill.isSelected()); + options.setNewDayAsTechPoolNoRelease(chkNewDayAsTechPoolNoRelease.isSelected()); options.setNewDayMedicPoolFill(chkNewDayMedicPoolFill.isSelected()); + options.setNewDayMedicPoolNoRelease(chkNewDayMedicPoolNoRelease.isSelected()); options.setNewDayMRMS(chkNewDayMRMS.isSelected()); options.setNewDayOptimizeMedicalAssignments(chkNewDayOptimizeMedicalAssignments.isSelected()); options.setNewDaySoldierPoolFill(chkNewDaySoldierPoolFill.isSelected()); + options.setNewDaySoldierPoolNoRelease(chkNewDaySoldierPoolNoRelease.isSelected()); options.setNewDayBattleArmorPoolFill(chkNewDayBattleArmorPoolFill.isSelected()); + options.setNewDayBattleArmorPoolNoRelease(chkNewDayBattleArmorPoolNoRelease.isSelected()); options.setNewDayVehicleCrewGroundPoolFill(chkNewDayVehicleCrewGroundPoolFill.isSelected()); + options.setNewDayVehicleCrewGroundPoolNoRelease(chkNewDayVehicleCrewGroundPoolNoRelease.isSelected()); options.setNewDayVehicleCrewVTOLPoolFill(chkNewDayVehicleCrewVTOLPoolFill.isSelected()); + options.setNewDayVehicleCrewVTOLPoolNoRelease(chkNewDayVehicleCrewVTOLPoolNoRelease.isSelected()); options.setNewDayVehicleCrewNavalPoolFill(chkNewDayVehicleCrewNavalPoolFill.isSelected()); + options.setNewDayVehicleCrewNavalPoolNoRelease(chkNewDayVehicleCrewNavalPoolNoRelease.isSelected()); options.setNewDayVesselPilotPoolFill(chkNewDayVesselPilotPoolFill.isSelected()); + options.setNewDayVesselPilotPoolNoRelease(chkNewDayVesselPilotPoolNoRelease.isSelected()); options.setNewDayVesselGunnerPoolFill(chkNewDayVesselGunnerPoolFill.isSelected()); + options.setNewDayVesselGunnerPoolNoRelease(chkNewDayVesselGunnerPoolNoRelease.isSelected()); options.setNewDayVesselCrewPoolFill(chkNewDayVesselCrewPoolFill.isSelected()); + options.setNewDayVesselCrewPoolNoRelease(chkNewDayVesselCrewPoolNoRelease.isSelected()); options .setNewDayAutomaticallyAssignUnmaintainedUnits(chkNewDayAutomaticallyAssignUnmaintainedUnits.isSelected()); options.setNewMonthQuickTrain(chkNewMonthQuickTrain.isSelected()); @@ -1857,15 +1957,35 @@ private void setInitialState() { spinnerSavedGamesCount.setValue(options.getMaximumNumberOfAutoSavesValue()); chkNewDayAsTechPoolFill.setSelected(options.getNewDayAsTechPoolFill()); + chkNewDayAsTechPoolNoRelease.setSelected(options.getNewDayAsTechPoolNoRelease()); + chkNewDayAsTechPoolNoRelease.setEnabled(chkNewDayAsTechPoolFill.isSelected()); chkNewDayMedicPoolFill.setSelected(options.getNewDayMedicPoolFill()); + chkNewDayMedicPoolNoRelease.setSelected(options.getNewDayMedicPoolNoRelease()); + chkNewDayMedicPoolNoRelease.setEnabled(chkNewDayMedicPoolFill.isSelected()); chkNewDaySoldierPoolFill.setSelected(MekHQ.getMHQOptions().getNewDaySoldierPoolFill()); + chkNewDaySoldierPoolNoRelease.setSelected(MekHQ.getMHQOptions().getNewDaySoldierPoolNoRelease()); + chkNewDaySoldierPoolNoRelease.setEnabled(chkNewDaySoldierPoolFill.isSelected()); chkNewDayBattleArmorPoolFill.setSelected(MekHQ.getMHQOptions().getNewDayBattleArmorPoolFill()); + chkNewDayBattleArmorPoolNoRelease.setSelected(MekHQ.getMHQOptions().getNewDayBattleArmorPoolNoRelease()); + chkNewDayBattleArmorPoolNoRelease.setEnabled(chkNewDayBattleArmorPoolFill.isSelected()); chkNewDayVehicleCrewGroundPoolFill.setSelected(MekHQ.getMHQOptions().getNewDayVehicleCrewGroundPoolFill()); + chkNewDayVehicleCrewGroundPoolNoRelease.setSelected(MekHQ.getMHQOptions().getNewDayVehicleCrewGroundPoolNoRelease()); + chkNewDayVehicleCrewGroundPoolNoRelease.setEnabled(chkNewDayVehicleCrewGroundPoolFill.isSelected()); chkNewDayVehicleCrewVTOLPoolFill.setSelected(MekHQ.getMHQOptions().getNewDayVehicleCrewVTOLPoolFill()); + chkNewDayVehicleCrewVTOLPoolNoRelease.setSelected(MekHQ.getMHQOptions().getNewDayVehicleCrewVTOLPoolNoRelease()); + chkNewDayVehicleCrewVTOLPoolNoRelease.setEnabled(chkNewDayVehicleCrewVTOLPoolFill.isSelected()); chkNewDayVehicleCrewNavalPoolFill.setSelected(MekHQ.getMHQOptions().getNewDayVehicleCrewNavalPoolFill()); + chkNewDayVehicleCrewNavalPoolNoRelease.setSelected(MekHQ.getMHQOptions().getNewDayVehicleCrewNavalPoolNoRelease()); + chkNewDayVehicleCrewNavalPoolNoRelease.setEnabled(chkNewDayVehicleCrewNavalPoolFill.isSelected()); chkNewDayVesselPilotPoolFill.setSelected(MekHQ.getMHQOptions().getNewDayVesselPilotPoolFill()); + chkNewDayVesselPilotPoolNoRelease.setSelected(MekHQ.getMHQOptions().getNewDayVesselPilotPoolNoRelease()); + chkNewDayVesselPilotPoolNoRelease.setEnabled(chkNewDayVesselPilotPoolFill.isSelected()); chkNewDayVesselGunnerPoolFill.setSelected(MekHQ.getMHQOptions().getNewDayVesselGunnerPoolFill()); + chkNewDayVesselGunnerPoolNoRelease.setSelected(MekHQ.getMHQOptions().getNewDayVesselGunnerPoolNoRelease()); + chkNewDayVesselGunnerPoolNoRelease.setEnabled(chkNewDayVesselGunnerPoolFill.isSelected()); chkNewDayVesselCrewPoolFill.setSelected(MekHQ.getMHQOptions().getNewDayVesselCrewPoolFill()); + chkNewDayVesselCrewPoolNoRelease.setSelected(MekHQ.getMHQOptions().getNewDayVesselCrewPoolNoRelease()); + chkNewDayVesselCrewPoolNoRelease.setEnabled(chkNewDayVesselCrewPoolFill.isSelected()); chkNewDayMRMS.setSelected(options.getNewDayMRMS()); chkNewDayOptimizeMedicalAssignments.setSelected(options.getNewDayOptimizeMedicalAssignments()); chkNewDayAutomaticallyAssignUnmaintainedUnits.setSelected(options