Skip to content

Fix #305: Added Medical Log, Assignment Log, Performance Report #6624

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,12 @@ lblDisplayScenarioLog.text=Expand Scenario Log by Default \u2728
lblDisplayScenarioLog.tooltip=Determines whether the scenario log will be expanded by default
lblDisplayKillRecord.text=Expand Kill Log by Default \u2728
lblDisplayKillRecord.tooltip=Determines whether the kill log will be expanded by default
lblDisplayMedicalRecord.text=Expand Medical Log by Default \uD83C\uDF1F
lblDisplayMedicalRecord.tooltip=Determines whether the medical log will be expanded by default
lblDisplayAssignmentRecord.text=Expand Assignment Log by Default \uD83C\uDF1F
lblDisplayAssignmentRecord.tooltip=Determines whether the assignment log will be expanded by default
lblDisplayPerformanceRecord.text=Expand Performance Report by Default \uD83C\uDF1F
lblDisplayPerformanceRecord.tooltip=Determines whether the Skill, XP and SPA gain log will be expanded by default
# createPersonnelInformationTab
lblPersonnelInformation.text=Personnel Information Options \u270E
lblUseTimeInService.text=Track Time in Service
Expand Down
16 changes: 14 additions & 2 deletions MekHQ/resources/mekhq/resources/GUI.properties
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,22 @@ bulkAssignSinglePortrait.text=Bulk Change Portrait
editLogs.text=Edit Logs
editPersonnelLog.text=Edit Personnel Log
editScenarioLog.text=Edit Scenario Log
editKillLog.text=Edit Kill Log
addSingleLogEntry.text=Add Single Log Entry
addScenarioEntry.text=Add Single Scenario Entry
editMedicalLog.text=Edit Medical Log
editLog.dialog.title=Edit Medical Log for {0}
logController.txtDescription.title=Description
logController.btnAdd.text=Add
logController.btnEdit.text=Edit
logController.btnDelete.text=Delete
editLog.btnOK.text=Done
addSingleLogEntry.text=Add Single Personal Log Entry
addSingleMedicalLogEntry.text=Add Single Medical Log Entry
addSingleAssignmentLogEntry.text=Add Single Assignments Log Entry
addSinglePerformanceLogEntry.text=Add Single Performance Report Entry
editKillLog.text=Edit Kill Log
assignKill.text=Add Single Kill Entry
editAssignmentLog.text=Edit Assignments Log
editPerformanceLog.text=Edit Performance Report
exportPersonnel.text=Export Personnel
sack.text=Sack
wealth.extreme.single=Perform Extreme Expenditure (+%s C-Bills, -1 Wealth)
Expand Down
6 changes: 6 additions & 0 deletions MekHQ/resources/mekhq/resources/PersonViewPanel.properties
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ lblAuntsOrUncles1.text=<html><nobr><b>Aunts/Uncles:</b></nobr></html>;
lblCousins1.text=<html><nobr><b>Cousins:</b></nobr></html>;
scenarioLogHeader.title=Show Scenario Log
scenarioLog.title=Hide Scenario Log
assignmentLogHeader.title=Show Assignments Log
assignmentLog.title=Hide Assignments Log
pnlInjuries.title=Injury Report
pnlSkills.title=Skills and Abilities
pnlAwards.title=Medals and Awards
Expand All @@ -61,6 +63,10 @@ pnlPersonality.title=About
pnlDescription.title=Biography
pnlLogHeader.title=Show Personal Log
pnlLog.title=Hide Personal Log
pnlPerformanceLogHeader.title=Show Performance Report
pnlPerformanceLog.title=Hide Performance Report
pnlMedicalLogHeader.title=Show Medical Log
pnlMedicalLog.title=Hide Medical Log
pnlKillsHeader.title=Show Kill Record
pnlKills.title=Hide Kill Record
lblPermanentInjury.text=permanent injury
Expand Down
10 changes: 5 additions & 5 deletions MekHQ/src/mekhq/campaign/Campaign.java
Original file line number Diff line number Diff line change
Expand Up @@ -9080,7 +9080,7 @@ public void initTimeInService() {
for (Person p : getPersonnel()) {
if (!p.getPrimaryRole().isDependent() && p.getPrisonerStatus().isFree()) {
LocalDate join = null;
for (LogEntry e : p.getPersonnelLog()) {
for (LogEntry e : p.getPersonalLog()) {
if (join == null) {
// If by some nightmare there is no Joined date just use the first entry.
join = e.getDate();
Expand All @@ -9100,7 +9100,7 @@ public void initTimeInRank() {
for (Person p : getPersonnel()) {
if (!p.getPrimaryRole().isDependent() && p.getPrisonerStatus().isFree()) {
LocalDate join = null;
for (LogEntry e : p.getPersonnelLog()) {
for (LogEntry e : p.getPersonalLog()) {
if (join == null) {
// If by some nightmare there is no date from the below, just use the first
// entry.
Expand Down Expand Up @@ -9144,7 +9144,7 @@ public void initAtB(boolean newCampaign) {
*/
LocalDate founding = null;
for (Person p : getPersonnel()) {
for (LogEntry e : p.getPersonnelLog()) {
for (LogEntry e : p.getPersonalLog()) {
if ((founding == null) || e.getDate().isBefore(founding)) {
founding = e.getDate();
}
Expand All @@ -9156,7 +9156,7 @@ public void initAtB(boolean newCampaign) {
* they joined came with that `Mek (which is a less certain assumption)
*/
for (Person p : getPersonnel()) {
LocalDate join = p.getPersonnelLog()
LocalDate join = p.getPersonalLog()
.stream()
.filter(e -> e.getDesc().startsWith("Joined "))
.findFirst()
Expand All @@ -9168,7 +9168,7 @@ public void initAtB(boolean newCampaign) {
if (p.getPrimaryRole().isMekWarrior() ||
(p.getPrimaryRole().isAerospacePilot() && getCampaignOptions().isAeroRecruitsHaveUnits()) ||
p.getPrimaryRole().isProtoMekPilot()) {
for (LogEntry e : p.getPersonnelLog()) {
for (LogEntry e : p.getPersonalLog()) {
if (e.getDate().equals(join) && e.getDesc().startsWith("Assigned to ")) {
String mek = e.getDesc().substring(12);
MekSummary ms = MekSummaryCache.getInstance().getMek(mek);
Expand Down
51 changes: 44 additions & 7 deletions MekHQ/src/mekhq/campaign/CampaignOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ public static String getTechLevelName(final int techLevel) {
private boolean displayPersonnelLog;
private boolean displayScenarioLog;
private boolean displayKillRecord;
private boolean displayMedicalRecord;
private boolean displayAssignmentRecord;
private boolean displayPerformanceRecord;
private boolean rewardComingOfAgeAbilities;

// Expanded Personnel Information
Expand Down Expand Up @@ -774,6 +777,7 @@ public CampaignOptions() {
setDisplayPersonnelLog(false);
setDisplayScenarioLog(false);
setDisplayKillRecord(false);
setDisplayMedicalRecord(false);
setRewardComingOfAgeAbilities(false);

// Expanded Personnel Information
Expand Down Expand Up @@ -1645,6 +1649,30 @@ public void setDisplayKillRecord(final boolean displayKillRecord) {
this.displayKillRecord = displayKillRecord;
}

public boolean isDisplayMedicalRecord() {
return displayMedicalRecord;
}

public void setDisplayMedicalRecord(final boolean displayMedicalRecord) {
this.displayMedicalRecord = displayMedicalRecord;
}

public boolean isDisplayAssignmentRecord() {
return displayAssignmentRecord;
}

public void setDisplayAssignmentRecord(final boolean displayAssignmentRecord) {
this.displayAssignmentRecord = displayAssignmentRecord;
}

public boolean isDisplayPerformanceRecord() {
return displayPerformanceRecord;
}

public void setDisplayPerformanceRecord(final boolean displayPerformanceRecord) {
this.displayPerformanceRecord = displayPerformanceRecord;
}

public boolean isRewardComingOfAgeAbilities() {
return rewardComingOfAgeAbilities;
}
Expand Down Expand Up @@ -4971,6 +4999,9 @@ public void writeToXml(final PrintWriter pw, int indent) {
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "displayPersonnelLog", isDisplayPersonnelLog());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "displayScenarioLog", isDisplayScenarioLog());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "displayKillRecord", isDisplayKillRecord());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "displayMedicalRecord", isDisplayMedicalRecord());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "displayAssignmentRecord", isDisplayAssignmentRecord());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "displayPerformanceRecord", isDisplayPerformanceRecord());
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "rewardComingOfAgeAbilities", isRewardComingOfAgeAbilities());
// endregion General Personnel

Expand Down Expand Up @@ -5744,6 +5775,12 @@ public static CampaignOptions generateCampaignOptionsFromXml(Node wn, Version ve
retVal.setDisplayScenarioLog(Boolean.parseBoolean(wn2.getTextContent().trim()));
} else if (nodeName.equalsIgnoreCase("displayKillRecord")) {
retVal.setDisplayKillRecord(Boolean.parseBoolean(wn2.getTextContent().trim()));
} else if (nodeName.equalsIgnoreCase("displayMedicalRecord")) {
retVal.setDisplayMedicalRecord(Boolean.parseBoolean(wn2.getTextContent().trim()));
} else if (nodeName.equalsIgnoreCase("displayAssignmentRecord")) {
retVal.setDisplayAssignmentRecord(Boolean.parseBoolean(wn2.getTextContent().trim()));
} else if (nodeName.equalsIgnoreCase("displayPerformanceRecord")) {
retVal.setDisplayPerformanceRecord(Boolean.parseBoolean(wn2.getTextContent().trim()));
} else if (nodeName.equalsIgnoreCase("rewardComingOfAgeAbilities")) {
retVal.setRewardComingOfAgeAbilities(Boolean.parseBoolean(wn2.getTextContent().trim()));
// endregion General Personnel
Expand Down Expand Up @@ -5957,9 +5994,9 @@ public static CampaignOptions generateCampaignOptionsFromXml(Node wn, Version ve
if (wn3.getNodeType() != Node.ELEMENT_NODE) {
continue;
}
retVal.getMarriageSurnameWeights()
.put(MergingSurnameStyle.parseFromString(wn3.getNodeName().trim()),
Integer.parseInt(wn3.getTextContent().trim()));
retVal.getMarriageSurnameWeights().put(MergingSurnameStyle.parseFromString(wn3.getNodeName()
.trim()),
Integer.parseInt(wn3.getTextContent().trim()));
}
} else if (nodeName.equalsIgnoreCase("randomMarriageMethod")) {
retVal.setRandomMarriageMethod(RandomMarriageMethod.fromString(wn2.getTextContent().trim()));
Expand Down Expand Up @@ -6099,8 +6136,8 @@ public static CampaignOptions generateCampaignOptionsFromXml(Node wn, Version ve
final Node wn3 = nl2.item(i);
try {
retVal.getEnabledRandomDeathAgeGroups()
.put(AgeGroup.valueOf(wn3.getNodeName()), Boolean.parseBoolean(wn3.getTextContent()
.trim()));
.put(AgeGroup.valueOf(wn3.getNodeName()),
Boolean.parseBoolean(wn3.getTextContent().trim()));
} catch (Exception ignored) {

}
Expand Down Expand Up @@ -6505,8 +6542,8 @@ public static CampaignOptions generateCampaignOptionsFromXml(Node wn, Version ve
} else if (nodeName.equalsIgnoreCase("originSearchRadius")) { // Legacy, 0.49.7 Removal
retVal.getRandomOriginOptions().setOriginSearchRadius(Integer.parseInt(wn2.getTextContent()));
} else if (nodeName.equalsIgnoreCase("extraRandomOrigin")) { // Legacy, 0.49.7 Removal
retVal.getRandomOriginOptions()
.setExtraRandomOrigin(Boolean.parseBoolean(wn2.getTextContent().trim()));
retVal.getRandomOriginOptions().setExtraRandomOrigin(Boolean.parseBoolean(wn2.getTextContent()
.trim()));
} else if (nodeName.equalsIgnoreCase("originDistanceScale")) { // Legacy, 0.49.7 Removal
retVal.getRandomOriginOptions().setOriginDistanceScale(Double.parseDouble(wn2.getTextContent()
.trim()));
Expand Down
Loading
Loading