diff --git a/MekHQ/resources/mekhq/resources/CampaignGUI.properties b/MekHQ/resources/mekhq/resources/CampaignGUI.properties index 58c4a3e6e0..e8a66d5be2 100644 --- a/MekHQ/resources/mekhq/resources/CampaignGUI.properties +++ b/MekHQ/resources/mekhq/resources/CampaignGUI.properties @@ -273,6 +273,9 @@ choiceUnit.MothballedUnits.filter=All Mothballed Units choiceUnit.UnmaintainedUnits.filter=All Unmaintained Units chkHideMothballed.text=Hide Mothballed chkHideMothballed.toolTipText=Hide mothballed units from the current view +btnAssignTechs.text=Quick Assign Maintenance Techs +btnAssignTechs.toolTipText=Assign maintenance techs to all unmaintained units, where possible. This is identical \ + to the system found in MekHQ Options that assigns techs on new day. lblUnitView.text=View: btnAddMission.toolTipText=Add a new mission. Missions are long-term assignments consisting of multiple scenarios. btnAddMission.text=Add Mission diff --git a/MekHQ/resources/mekhq/resources/GUI.properties b/MekHQ/resources/mekhq/resources/GUI.properties index a205d145de..b36fcbbe64 100644 --- a/MekHQ/resources/mekhq/resources/GUI.properties +++ b/MekHQ/resources/mekhq/resources/GUI.properties @@ -940,6 +940,9 @@ optionStratConDeployConfirmation.toolTipText=This allows you to skip the confirm optionAbandonUnitsConfirmation.text=Hide Abandon Units Confirmation Dialog optionAbandonUnitsConfirmation.toolTipText=This allows you to skip the confirmation dialog which confirms whether \ you are happy abandoning non-jump capable units +optionAssignTechsConfirmation.text=Hide Quick Assign Techs Confirmation Dialog +optionAssignTechsConfirmation.toolTipText=This allows you to skip the confirmation dialog which confirms whether \ + you are happy assigning techs to unmaintained units ## Miscellaneous Tab miscellaneousTab.title=Miscellaneous Options lblUserDir.text=User Files Directory: diff --git a/MekHQ/resources/mekhq/resources/ImmersiveDialogConfirmation.properties b/MekHQ/resources/mekhq/resources/ImmersiveDialogConfirmation.properties index fc2d9784b3..bb6ae52be7 100644 --- a/MekHQ/resources/mekhq/resources/ImmersiveDialogConfirmation.properties +++ b/MekHQ/resources/mekhq/resources/ImmersiveDialogConfirmation.properties @@ -47,3 +47,14 @@ ImmersiveDialogConfirmation.confirmationFactionStandingsUltimatum.text.primary=T select 'confirm,' the consequences of your decision cannot be reversed. ImmersiveDialogConfirmation.confirmationAbandonUnits.text.primary=If you select 'confirm,' all non-jump capable units\ \ will be permanently abandoned or sold (depending on the chosen option). This cannot be reversed. +ImmersiveDialogConfirmation.confirmationAssignTechs.text.primary=If you select 'confirm,' all unmaintained units will\ + \ be assigned a tech (where possible).\ +
Assignment follows the following rules:
\ +- All unmaintained units are sorted so that the most valuable units are assigned techs first.\
+
- All techs are sorted so that the tech with the fewest assigned units first. Tech skill is used as a \
+ tie-breaker.\
+
- Units that already have a tech assigned are ignored.
If selected, on each new day, techs will be assigned to units without tech assignments. This follows the rules \ + outlined above.
diff --git a/MekHQ/src/mekhq/MHQConstants.java b/MekHQ/src/mekhq/MHQConstants.java index 71ff93d968..f84c2eeeab 100644 --- a/MekHQ/src/mekhq/MHQConstants.java +++ b/MekHQ/src/mekhq/MHQConstants.java @@ -241,6 +241,7 @@ public final class MHQConstants extends SuiteConstants { public static final String CONFIRMATION_STRATCON_BATCHALL_BREACH = "confirmationStratConBatchallBreach"; public static final String CONFIRMATION_STRATCON_DEPLOY = "confirmationStratConDeploy"; public static final String CONFIRMATION_ABANDON_UNITS = "confirmationAbandonUnits"; + public static final String CONFIRMATION_ASSIGN_TECHS = "confirmationAssignTechs"; // endregion Nag Tab // region Miscellaneous Options diff --git a/MekHQ/src/mekhq/gui/HangarTab.java b/MekHQ/src/mekhq/gui/HangarTab.java index d62682af1d..a626e35bdb 100644 --- a/MekHQ/src/mekhq/gui/HangarTab.java +++ b/MekHQ/src/mekhq/gui/HangarTab.java @@ -74,7 +74,10 @@ import mekhq.campaign.events.units.UnitRemovedEvent; import mekhq.campaign.unit.Unit; import mekhq.campaign.unit.UnitOrder; +import mekhq.campaign.utilities.AutomatedTechAssignments; import mekhq.gui.adapter.UnitTableMouseAdapter; +import mekhq.gui.baseComponents.immersiveDialogs.ImmersiveDialogConfirmation; +import mekhq.gui.baseComponents.roundedComponents.RoundedJButton; import mekhq.gui.baseComponents.roundedComponents.RoundedLineBorder; import mekhq.gui.enums.MHQTabType; import mekhq.gui.model.UnitTableModel; @@ -86,6 +89,8 @@ import mekhq.gui.sorter.WeightClassSorter; import mekhq.gui.view.UnitViewPanel; +import static mekhq.MHQConstants.CONFIRMATION_ASSIGN_TECHS; + /** * Displays a table of all units in the force. */ @@ -108,6 +113,7 @@ public final class HangarTab extends CampaignGuiTab { private JComboBox