diff --git a/MekHQ/resources/mekhq/resources/Campaign.properties b/MekHQ/resources/mekhq/resources/Campaign.properties index aba27e1309..85bf3cc4f7 100644 --- a/MekHQ/resources/mekhq/resources/Campaign.properties +++ b/MekHQ/resources/mekhq/resources/Campaign.properties @@ -39,8 +39,8 @@ LayeredForceIconLayer.LOGO.text=Logos LayeredForceIconLayer.LOGO.toolTipText=This tab contains canon faction logos that can be added to the center of a force icon. #### Anniversaries -anniversaryBirthday.text=%s is %s%s%s today! -anniversaryRecruitment.text=%s celebrates %s%s%s years with %s! +anniversaryBirthday.text=%s is %s%s%s today! +anniversaryRecruitment.text=%s celebrates %s%s%s years with %s! #### Personnel Removal personnelRemoval.text=Old personnel records have been tidied away. diff --git a/MekHQ/src/mekhq/campaign/Campaign.java b/MekHQ/src/mekhq/campaign/Campaign.java index 7868454ddf..92e4c0bd61 100644 --- a/MekHQ/src/mekhq/campaign/Campaign.java +++ b/MekHQ/src/mekhq/campaign/Campaign.java @@ -1463,7 +1463,7 @@ public Person newDependent(boolean baby, Gender gender) { person = newPerson(PersonnelRole.DEPENDENT, PersonnelRole.NONE, new DefaultFactionSelector(getCampaignOptions().getRandomOriginOptions()), new DefaultPlanetSelector(getCampaignOptions().getRandomOriginOptions()), - Gender.RANDOMIZE); + gender); } else { person = newPerson(PersonnelRole.DEPENDENT); } @@ -2250,13 +2250,11 @@ private void updatePartInUseData(PartInUse partInUse, Part incomingPart, boolean ignoreMothballedUnits, PartQuality ignoreSparesUnderQuality) { if (ignoreMothballedUnits && (null != incomingPart.getUnit()) && incomingPart.getUnit().isMothballed()) { - return; } else if ((incomingPart.getUnit() != null) || (incomingPart instanceof MissingPart)) { partInUse.setUseCount(partInUse.getUseCount() + getQuantity(incomingPart)); } else { if (incomingPart.isPresent()) { if (incomingPart.getQuality().toNumeric() < ignoreSparesUnderQuality.toNumeric()) { - return; } else { partInUse.setStoreCount(partInUse.getStoreCount() + getQuantity(incomingPart)); partInUse.addSpare(incomingPart); @@ -2273,7 +2271,7 @@ private void updatePartInUseData(PartInUse partInUse, Part incomingPart, * @param ignoreMothballedUnits don't count parts in mothballed units * @param ignoreSparesUnderQuality don't count spare parts lower than this quality */ - public void updatePartInUse(PartInUse partInUse, boolean ignoreMothballedUnits, + public void updatePartInUse(PartInUse partInUse, boolean ignoreMothballedUnits, PartQuality ignoreSparesUnderQuality) { partInUse.setUseCount(0); partInUse.setStoreCount(0); @@ -2290,7 +2288,7 @@ public void updatePartInUse(PartInUse partInUse, boolean ignoreMothballedUnits, PartInUse newPiu = getPartInUse((Part) maybePart); if (partInUse.equals(newPiu)) { partInUse.setPlannedCount(partInUse.getPlannedCount() - + getQuantity((maybePart instanceof MissingPart) ? + + getQuantity((maybePart instanceof MissingPart) ? ((MissingPart) maybePart).getNewPart() : (Part) maybePart) * maybePart.getQuantity()); } @@ -2334,7 +2332,7 @@ public Set getPartsInUse(boolean ignoreMothballedUnits, inUse.put(partInUse, partInUse); } partInUse.setPlannedCount(partInUse.getPlannedCount() - + getQuantity((maybePart instanceof MissingPart) ? + + getQuantity((maybePart instanceof MissingPart) ? ((MissingPart) maybePart).getNewPart() : (Part) maybePart) * maybePart.getQuantity()); @@ -3770,7 +3768,8 @@ private void processNewDayATB() { AtBMoraleLevel morale = contract.getMoraleLevel(); - String report = "Current enemy condition is '" + morale + "' on contract " + contract.getName() + "

" + morale.getToolTipText() + ""; + String report = "Current enemy condition is " + morale + " on contract " + + contract.getName() + "

" + morale.getToolTipText(); addReport(report); } @@ -4222,8 +4221,7 @@ public boolean newDay() { setLocalDate(getLocalDate().plusDays(1)); // Determine if we have an active contract or not, as this can get used - // elsewhere before - // we actually hit the AtB new day (e.g., personnel market) + // elsewhere before we actually hit the AtB new day (e.g., personnel market) if (getCampaignOptions().isUseAtB()) { setHasActiveContract(); } @@ -4234,6 +4232,8 @@ public boolean newDay() { newReports.clear(); beginReport("" + MekHQ.getMHQOptions().getLongDisplayFormattedDate(getLocalDate()) + ""); + MekHQ.triggerEvent(new NewDayEvent(this)); + // New Year Changes if (getLocalDate().getDayOfYear() == 1) { // News is reloaded @@ -4297,7 +4297,10 @@ public boolean newDay() { processPersonnelRemoval(); } - MekHQ.triggerEvent(new NewDayEvent(this)); + if ((campaignOptions.isEnableAutoAwards()) && (getLocalDate().getDayOfMonth() == 1)) { + AutoAwardsController autoAwardsController = new AutoAwardsController(); + autoAwardsController.ManualController(this, false); + } // this duplicates any turnover information so that it is still available on the // new day. @@ -8002,7 +8005,7 @@ private String doMaintenanceOnUnitPart(Unit u, Part p, Map partsT // } break; } - if (p.getQuality().toNumeric() > oldQuality.toNumeric()) { + if (p.getQuality().toNumeric() > oldQuality.toNumeric()) { partReport += ": " + ReportingUtilities.messageSurroundedBySpanWithColor( MekHQ.getMHQOptions().getFontColorPositiveHexColor(), "new quality is " + p.getQualityName());