diff --git a/MekHQ/resources/mekhq/resources/GUI.properties b/MekHQ/resources/mekhq/resources/GUI.properties index 41f981b216..2aa1b7ed6b 100644 --- a/MekHQ/resources/mekhq/resources/GUI.properties +++ b/MekHQ/resources/mekhq/resources/GUI.properties @@ -762,6 +762,8 @@ PersonnelFilter.ADMINISTRATOR_TRANSPORT.text=Administrators (Transport) PersonnelFilter.ADMINISTRATOR_TRANSPORT.toolTipText=Display transport-focused administrators PersonnelFilter.ADMINISTRATOR_HR.text=Administrators (HR) PersonnelFilter.ADMINISTRATOR_HR.toolTipText=Display human resources-focused administrators +PersonnelFilter.KIDS.text=Children +PersonnelFilter.KIDS.toolTipText=Display all personnel under 13. PersonnelFilter.DEPENDENT.text=Dependents PersonnelFilter.DEPENDENT.toolTipText=Display active personnel with the Dependent primary role. PersonnelFilter.FOUNDER.text=Founders diff --git a/MekHQ/src/mekhq/gui/PersonnelTab.java b/MekHQ/src/mekhq/gui/PersonnelTab.java index f1f25989ec..5f038d8e16 100644 --- a/MekHQ/src/mekhq/gui/PersonnelTab.java +++ b/MekHQ/src/mekhq/gui/PersonnelTab.java @@ -280,7 +280,7 @@ public void filterPersonnel() { personnelSorter.setRowFilter(new RowFilter<>() { @Override public boolean include(Entry entry) { - return filter.getFilteredInformation(entry.getModel().getPerson(entry.getIdentifier())); + return filter.getFilteredInformation(entry.getModel().getPerson(entry.getIdentifier()), getCampaignGui().getCampaign().getLocalDate()); } }); } diff --git a/MekHQ/src/mekhq/gui/dialog/PersonnelMarketDialog.java b/MekHQ/src/mekhq/gui/dialog/PersonnelMarketDialog.java index ff91e99b9a..c605fa6bd9 100644 --- a/MekHQ/src/mekhq/gui/dialog/PersonnelMarketDialog.java +++ b/MekHQ/src/mekhq/gui/dialog/PersonnelMarketDialog.java @@ -419,7 +419,7 @@ private void filterPersonnel() { sorter.setRowFilter(new RowFilter<>() { @Override public boolean include(Entry entry) { - return nGroup.getFilteredInformation(entry.getModel().getPerson(entry.getIdentifier())); + return nGroup.getFilteredInformation(entry.getModel().getPerson(entry.getIdentifier()), hqView.getCampaign().getLocalDate()); } }); } diff --git a/MekHQ/src/mekhq/gui/dialog/RetirementDefectionDialog.java b/MekHQ/src/mekhq/gui/dialog/RetirementDefectionDialog.java index a2e7e2e295..869409deae 100644 --- a/MekHQ/src/mekhq/gui/dialog/RetirementDefectionDialog.java +++ b/MekHQ/src/mekhq/gui/dialog/RetirementDefectionDialog.java @@ -590,7 +590,7 @@ public boolean include(Entry && !rdTracker.getRetirees(contract).contains(person.getId())) { return false; } else { - return nGroup.getFilteredInformation(person); + return nGroup.getFilteredInformation(person, hqView.getCampaign().getLocalDate()); } } }); diff --git a/MekHQ/src/mekhq/gui/enums/PersonnelFilter.java b/MekHQ/src/mekhq/gui/enums/PersonnelFilter.java index 828cd03f20..be403695ca 100644 --- a/MekHQ/src/mekhq/gui/enums/PersonnelFilter.java +++ b/MekHQ/src/mekhq/gui/enums/PersonnelFilter.java @@ -22,6 +22,7 @@ import mekhq.campaign.personnel.Person; import mekhq.campaign.personnel.enums.PersonnelRole; +import java.time.LocalDate; import java.util.Arrays; import java.util.List; import java.util.ResourceBundle; @@ -62,7 +63,7 @@ public enum PersonnelFilter { ASTECH("PersonnelFilter.ASTECH.text", "PersonnelFilter.ASTECH.toolTipText", false, true), MEDICAL("PersonnelFilter.MEDICAL.text", "PersonnelFilter.MEDICAL.toolTipText", true, false), DOCTOR("PersonnelFilter.DOCTOR.text", "PersonnelFilter.DOCTOR.toolTipText", false, true), - MEDIC("PersonnelFilter.MEDIC.text", "PersonnelFilter.MEDIC.toolTipText", false, true), + MEDIC("PersonnelFilter.MEDIC.text", "PersonnelFilter.MEDIC.toolTipText", false, true), ADMINISTRATOR("PersonnelFilter.ADMINISTRATOR.text", "PersonnelFilter.ADMINISTRATOR.toolTipText", true, false), ADMINISTRATOR_COMMAND("PersonnelFilter.ADMINISTRATOR_COMMAND.text", "PersonnelFilter.ADMINISTRATOR_COMMAND.toolTipText", false, true), ADMINISTRATOR_LOGISTICS("PersonnelFilter.ADMINISTRATOR_LOGISTICS.text", "PersonnelFilter.ADMINISTRATOR_LOGISTICS.toolTipText", false, true), @@ -73,6 +74,7 @@ public enum PersonnelFilter { //region Expanded Personnel Tab Filters FOUNDER("PersonnelFilter.FOUNDER.text", "PersonnelFilter.FOUNDER.toolTipText", false, false), + KIDS("PersonnelFilter.KIDS.text", "PersonnelFilter.KIDS.toolTipText"), PRISONER("PersonnelFilter.PRISONER.text", "PersonnelFilter.PRISONER.toolTipText", false, false), INACTIVE("PersonnelFilter.INACTIVE.text", "PersonnelFilter.INACTIVE.toolTipText", false, false), MIA("PersonnelFilter.MIA.text", "PersonnelFilter.MIA.toolTipText", false, false), @@ -348,7 +350,7 @@ public static List getAllIndividualRoleFilters() { return Arrays.asList(values()); } - public boolean getFilteredInformation(final Person person) { + public boolean getFilteredInformation(final Person person, LocalDate currentDate) { final boolean active = person.getStatus().isActive() && !person.getPrisonerStatus().isCurrentPrisoner(); switch (this) { case ALL: @@ -468,6 +470,8 @@ public boolean getFilteredInformation(final Person person) { return active && person.getPrimaryRole().isDependent(); case FOUNDER: return person.isFounder(); + case KIDS: + return person.isChild(currentDate); case PRISONER: return person.getPrisonerStatus().isCurrentPrisoner() || person.getPrisonerStatus().isBondsman(); case INACTIVE: