Skip to content

Commit 5cdae07

Browse files
authored
Merge pull request #6624 from IllianiBird/medicalLog
Fix #305: Added Medical Log, Assignment Log, Performance Report
2 parents 416125f + 2e3759c commit 5cdae07

32 files changed

+2111
-1189
lines changed

MekHQ/resources/mekhq/resources/CampaignOptionsDialog.properties

+6
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,12 @@ lblDisplayScenarioLog.text=Expand Scenario Log by Default \u2728
443443
lblDisplayScenarioLog.tooltip=Determines whether the scenario log will be expanded by default
444444
lblDisplayKillRecord.text=Expand Kill Log by Default \u2728
445445
lblDisplayKillRecord.tooltip=Determines whether the kill log will be expanded by default
446+
lblDisplayMedicalRecord.text=Expand Medical Log by Default \uD83C\uDF1F
447+
lblDisplayMedicalRecord.tooltip=Determines whether the medical log will be expanded by default
448+
lblDisplayAssignmentRecord.text=Expand Assignment Log by Default \uD83C\uDF1F
449+
lblDisplayAssignmentRecord.tooltip=Determines whether the assignment log will be expanded by default
450+
lblDisplayPerformanceRecord.text=Expand Performance Report by Default \uD83C\uDF1F
451+
lblDisplayPerformanceRecord.tooltip=Determines whether the Skill, XP and SPA gain log will be expanded by default
446452
# createPersonnelInformationTab
447453
lblPersonnelInformation.text=Personnel Information Options \u270E
448454
lblUseTimeInService.text=Track Time in Service

MekHQ/resources/mekhq/resources/GUI.properties

+14-2
Original file line numberDiff line numberDiff line change
@@ -193,10 +193,22 @@ bulkAssignSinglePortrait.text=Bulk Change Portrait
193193
editLogs.text=Edit Logs
194194
editPersonnelLog.text=Edit Personnel Log
195195
editScenarioLog.text=Edit Scenario Log
196-
editKillLog.text=Edit Kill Log
197-
addSingleLogEntry.text=Add Single Log Entry
198196
addScenarioEntry.text=Add Single Scenario Entry
197+
editMedicalLog.text=Edit Medical Log
198+
editLog.dialog.title=Edit Medical Log for {0}
199+
logController.txtDescription.title=Description
200+
logController.btnAdd.text=Add
201+
logController.btnEdit.text=Edit
202+
logController.btnDelete.text=Delete
203+
editLog.btnOK.text=Done
204+
addSingleLogEntry.text=Add Single Personal Log Entry
205+
addSingleMedicalLogEntry.text=Add Single Medical Log Entry
206+
addSingleAssignmentLogEntry.text=Add Single Assignments Log Entry
207+
addSinglePerformanceLogEntry.text=Add Single Performance Report Entry
208+
editKillLog.text=Edit Kill Log
199209
assignKill.text=Add Single Kill Entry
210+
editAssignmentLog.text=Edit Assignments Log
211+
editPerformanceLog.text=Edit Performance Report
200212
exportPersonnel.text=Export Personnel
201213
sack.text=Sack
202214
wealth.extreme.single=Perform Extreme Expenditure (+%s C-Bills, -1 Wealth)

MekHQ/resources/mekhq/resources/PersonViewPanel.properties

+6
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ lblAuntsOrUncles1.text=<html><nobr><b>Aunts/Uncles:</b></nobr></html>;
5353
lblCousins1.text=<html><nobr><b>Cousins:</b></nobr></html>;
5454
scenarioLogHeader.title=Show Scenario Log
5555
scenarioLog.title=Hide Scenario Log
56+
assignmentLogHeader.title=Show Assignments Log
57+
assignmentLog.title=Hide Assignments Log
5658
pnlInjuries.title=Injury Report
5759
pnlSkills.title=Skills and Abilities
5860
pnlAwards.title=Medals and Awards
@@ -61,6 +63,10 @@ pnlPersonality.title=About
6163
pnlDescription.title=Biography
6264
pnlLogHeader.title=Show Personal Log
6365
pnlLog.title=Hide Personal Log
66+
pnlPerformanceLogHeader.title=Show Performance Report
67+
pnlPerformanceLog.title=Hide Performance Report
68+
pnlMedicalLogHeader.title=Show Medical Log
69+
pnlMedicalLog.title=Hide Medical Log
6470
pnlKillsHeader.title=Show Kill Record
6571
pnlKills.title=Hide Kill Record
6672
lblPermanentInjury.text=permanent injury

MekHQ/src/mekhq/campaign/Campaign.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -9145,7 +9145,7 @@ public void initTimeInService() {
91459145
for (Person p : getPersonnel()) {
91469146
if (!p.getPrimaryRole().isDependent() && p.getPrisonerStatus().isFree()) {
91479147
LocalDate join = null;
9148-
for (LogEntry e : p.getPersonnelLog()) {
9148+
for (LogEntry e : p.getPersonalLog()) {
91499149
if (join == null) {
91509150
// If by some nightmare there is no Joined date just use the first entry.
91519151
join = e.getDate();
@@ -9165,7 +9165,7 @@ public void initTimeInRank() {
91659165
for (Person p : getPersonnel()) {
91669166
if (!p.getPrimaryRole().isDependent() && p.getPrisonerStatus().isFree()) {
91679167
LocalDate join = null;
9168-
for (LogEntry e : p.getPersonnelLog()) {
9168+
for (LogEntry e : p.getPersonalLog()) {
91699169
if (join == null) {
91709170
// If by some nightmare there is no date from the below, just use the first
91719171
// entry.
@@ -9209,7 +9209,7 @@ public void initAtB(boolean newCampaign) {
92099209
*/
92109210
LocalDate founding = null;
92119211
for (Person p : getPersonnel()) {
9212-
for (LogEntry e : p.getPersonnelLog()) {
9212+
for (LogEntry e : p.getPersonalLog()) {
92139213
if ((founding == null) || e.getDate().isBefore(founding)) {
92149214
founding = e.getDate();
92159215
}
@@ -9221,7 +9221,7 @@ public void initAtB(boolean newCampaign) {
92219221
* they joined came with that `Mek (which is a less certain assumption)
92229222
*/
92239223
for (Person p : getPersonnel()) {
9224-
LocalDate join = p.getPersonnelLog()
9224+
LocalDate join = p.getPersonalLog()
92259225
.stream()
92269226
.filter(e -> e.getDesc().startsWith("Joined "))
92279227
.findFirst()
@@ -9233,7 +9233,7 @@ public void initAtB(boolean newCampaign) {
92339233
if (p.getPrimaryRole().isMekWarrior() ||
92349234
(p.getPrimaryRole().isAerospacePilot() && getCampaignOptions().isAeroRecruitsHaveUnits()) ||
92359235
p.getPrimaryRole().isProtoMekPilot()) {
9236-
for (LogEntry e : p.getPersonnelLog()) {
9236+
for (LogEntry e : p.getPersonalLog()) {
92379237
if (e.getDate().equals(join) && e.getDesc().startsWith("Assigned to ")) {
92389238
String mek = e.getDesc().substring(12);
92399239
MekSummary ms = MekSummaryCache.getInstance().getMek(mek);

MekHQ/src/mekhq/campaign/CampaignOptions.java

+44-7
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ public static String getTechLevelName(final int techLevel) {
230230
private boolean displayPersonnelLog;
231231
private boolean displayScenarioLog;
232232
private boolean displayKillRecord;
233+
private boolean displayMedicalRecord;
234+
private boolean displayAssignmentRecord;
235+
private boolean displayPerformanceRecord;
233236
private boolean rewardComingOfAgeAbilities;
234237

235238
// Expanded Personnel Information
@@ -774,6 +777,7 @@ public CampaignOptions() {
774777
setDisplayPersonnelLog(false);
775778
setDisplayScenarioLog(false);
776779
setDisplayKillRecord(false);
780+
setDisplayMedicalRecord(false);
777781
setRewardComingOfAgeAbilities(false);
778782

779783
// Expanded Personnel Information
@@ -1645,6 +1649,30 @@ public void setDisplayKillRecord(final boolean displayKillRecord) {
16451649
this.displayKillRecord = displayKillRecord;
16461650
}
16471651

1652+
public boolean isDisplayMedicalRecord() {
1653+
return displayMedicalRecord;
1654+
}
1655+
1656+
public void setDisplayMedicalRecord(final boolean displayMedicalRecord) {
1657+
this.displayMedicalRecord = displayMedicalRecord;
1658+
}
1659+
1660+
public boolean isDisplayAssignmentRecord() {
1661+
return displayAssignmentRecord;
1662+
}
1663+
1664+
public void setDisplayAssignmentRecord(final boolean displayAssignmentRecord) {
1665+
this.displayAssignmentRecord = displayAssignmentRecord;
1666+
}
1667+
1668+
public boolean isDisplayPerformanceRecord() {
1669+
return displayPerformanceRecord;
1670+
}
1671+
1672+
public void setDisplayPerformanceRecord(final boolean displayPerformanceRecord) {
1673+
this.displayPerformanceRecord = displayPerformanceRecord;
1674+
}
1675+
16481676
public boolean isRewardComingOfAgeAbilities() {
16491677
return rewardComingOfAgeAbilities;
16501678
}
@@ -4971,6 +4999,9 @@ public void writeToXml(final PrintWriter pw, int indent) {
49714999
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "displayPersonnelLog", isDisplayPersonnelLog());
49725000
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "displayScenarioLog", isDisplayScenarioLog());
49735001
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "displayKillRecord", isDisplayKillRecord());
5002+
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "displayMedicalRecord", isDisplayMedicalRecord());
5003+
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "displayAssignmentRecord", isDisplayAssignmentRecord());
5004+
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "displayPerformanceRecord", isDisplayPerformanceRecord());
49745005
MHQXMLUtility.writeSimpleXMLTag(pw, indent, "rewardComingOfAgeAbilities", isRewardComingOfAgeAbilities());
49755006
// endregion General Personnel
49765007

@@ -5744,6 +5775,12 @@ public static CampaignOptions generateCampaignOptionsFromXml(Node wn, Version ve
57445775
retVal.setDisplayScenarioLog(Boolean.parseBoolean(wn2.getTextContent().trim()));
57455776
} else if (nodeName.equalsIgnoreCase("displayKillRecord")) {
57465777
retVal.setDisplayKillRecord(Boolean.parseBoolean(wn2.getTextContent().trim()));
5778+
} else if (nodeName.equalsIgnoreCase("displayMedicalRecord")) {
5779+
retVal.setDisplayMedicalRecord(Boolean.parseBoolean(wn2.getTextContent().trim()));
5780+
} else if (nodeName.equalsIgnoreCase("displayAssignmentRecord")) {
5781+
retVal.setDisplayAssignmentRecord(Boolean.parseBoolean(wn2.getTextContent().trim()));
5782+
} else if (nodeName.equalsIgnoreCase("displayPerformanceRecord")) {
5783+
retVal.setDisplayPerformanceRecord(Boolean.parseBoolean(wn2.getTextContent().trim()));
57475784
} else if (nodeName.equalsIgnoreCase("rewardComingOfAgeAbilities")) {
57485785
retVal.setRewardComingOfAgeAbilities(Boolean.parseBoolean(wn2.getTextContent().trim()));
57495786
// endregion General Personnel
@@ -5957,9 +5994,9 @@ public static CampaignOptions generateCampaignOptionsFromXml(Node wn, Version ve
59575994
if (wn3.getNodeType() != Node.ELEMENT_NODE) {
59585995
continue;
59595996
}
5960-
retVal.getMarriageSurnameWeights()
5961-
.put(MergingSurnameStyle.parseFromString(wn3.getNodeName().trim()),
5962-
Integer.parseInt(wn3.getTextContent().trim()));
5997+
retVal.getMarriageSurnameWeights().put(MergingSurnameStyle.parseFromString(wn3.getNodeName()
5998+
.trim()),
5999+
Integer.parseInt(wn3.getTextContent().trim()));
59636000
}
59646001
} else if (nodeName.equalsIgnoreCase("randomMarriageMethod")) {
59656002
retVal.setRandomMarriageMethod(RandomMarriageMethod.fromString(wn2.getTextContent().trim()));
@@ -6099,8 +6136,8 @@ public static CampaignOptions generateCampaignOptionsFromXml(Node wn, Version ve
60996136
final Node wn3 = nl2.item(i);
61006137
try {
61016138
retVal.getEnabledRandomDeathAgeGroups()
6102-
.put(AgeGroup.valueOf(wn3.getNodeName()), Boolean.parseBoolean(wn3.getTextContent()
6103-
.trim()));
6139+
.put(AgeGroup.valueOf(wn3.getNodeName()),
6140+
Boolean.parseBoolean(wn3.getTextContent().trim()));
61046141
} catch (Exception ignored) {
61056142

61066143
}
@@ -6505,8 +6542,8 @@ public static CampaignOptions generateCampaignOptionsFromXml(Node wn, Version ve
65056542
} else if (nodeName.equalsIgnoreCase("originSearchRadius")) { // Legacy, 0.49.7 Removal
65066543
retVal.getRandomOriginOptions().setOriginSearchRadius(Integer.parseInt(wn2.getTextContent()));
65076544
} else if (nodeName.equalsIgnoreCase("extraRandomOrigin")) { // Legacy, 0.49.7 Removal
6508-
retVal.getRandomOriginOptions()
6509-
.setExtraRandomOrigin(Boolean.parseBoolean(wn2.getTextContent().trim()));
6545+
retVal.getRandomOriginOptions().setExtraRandomOrigin(Boolean.parseBoolean(wn2.getTextContent()
6546+
.trim()));
65106547
} else if (nodeName.equalsIgnoreCase("originDistanceScale")) { // Legacy, 0.49.7 Removal
65116548
retVal.getRandomOriginOptions().setOriginDistanceScale(Double.parseDouble(wn2.getTextContent()
65126549
.trim()));

0 commit comments

Comments
 (0)