@@ -171,7 +171,7 @@ void MapViewState::updateCommercial()
171
171
}
172
172
}
173
173
174
- mMorale .adjustMorale ( commercialCount - luxuryCount);
174
+ mMorale .journalMoraleChange ({ " Commercial - Luxury " , commercialCount - luxuryCount} );
175
175
}
176
176
177
177
@@ -203,43 +203,30 @@ void MapViewState::updateMorale()
203
203
}
204
204
205
205
// positive
206
- mMorale .adjustMorale ( birthCount);
207
- mMorale .adjustMorale ( parkCount);
208
- mMorale .adjustMorale ( recreationCount);
209
- mMorale .adjustMorale ( commercialCount);
206
+ mMorale .journalMoraleChange ({ moraleString (MoraleIndexs::Births), birthCount} );
207
+ mMorale .journalMoraleChange ({ moraleString (MoraleIndexs::Parks), parkCount} );
208
+ mMorale .journalMoraleChange ({ moraleString (MoraleIndexs::Recreation), recreationCount} );
209
+ mMorale .journalMoraleChange ({ moraleString (MoraleIndexs::Commercial), commercialCount} );
210
210
211
211
// negative
212
- mMorale .adjustMorale (-deathCount);
213
- mMorale .adjustMorale (-residentialOverCapacityHit);
214
- mMorale .adjustMorale (-bioWasteAccumulation * 2 );
215
- mMorale .adjustMorale (-structuresDisabled);
216
- mMorale .adjustMorale (-structuresDestroyed);
217
- mMorale .adjustMorale (-foodProductionHit);
218
-
219
- mPopulationPanel .clearMoraleReasons ();
220
- mPopulationPanel .addMoraleReason (moraleString (MoraleIndexs::Births), birthCount);
221
- mPopulationPanel .addMoraleReason (moraleString (MoraleIndexs::Deaths), -deathCount);
222
- mPopulationPanel .addMoraleReason (moraleString (MoraleIndexs::NoFoodProduction), -foodProductionHit);
223
- mPopulationPanel .addMoraleReason (moraleString (MoraleIndexs::Parks), parkCount);
224
- mPopulationPanel .addMoraleReason (moraleString (MoraleIndexs::Recreation), recreationCount);
225
- mPopulationPanel .addMoraleReason (moraleString (MoraleIndexs::Commercial), commercialCount);
226
- mPopulationPanel .addMoraleReason (moraleString (MoraleIndexs::ResidentialOverflow), -residentialOverCapacityHit);
227
- mPopulationPanel .addMoraleReason (moraleString (MoraleIndexs::BiowasteOverflow), bioWasteAccumulation * -2 );
228
- mPopulationPanel .addMoraleReason (moraleString (MoraleIndexs::StructuresDisabled), -structuresDisabled);
229
- mPopulationPanel .addMoraleReason (moraleString (MoraleIndexs::StructuresDestroyed), -structuresDestroyed);
212
+ mMorale .journalMoraleChange ({moraleString (MoraleIndexs::Deaths), -deathCount});
213
+ mMorale .journalMoraleChange ({moraleString (MoraleIndexs::ResidentialOverflow), -residentialOverCapacityHit});
214
+ mMorale .journalMoraleChange ({moraleString (MoraleIndexs::BiowasteOverflow), -bioWasteAccumulation * 2 }); // TODO 2 is a magic number
215
+ mMorale .journalMoraleChange ({moraleString (MoraleIndexs::StructuresDisabled), -structuresDisabled});
216
+ mMorale .journalMoraleChange ({moraleString (MoraleIndexs::StructuresDestroyed), -structuresDestroyed});
217
+ mMorale .journalMoraleChange ({" Food Production Issues" , -foodProductionHit});
218
+
230
219
231
220
for (const auto & moraleReason : mCrimeRateUpdate .moraleChanges ())
232
221
{
233
- mPopulationPanel .addMoraleReason (moraleReason.first , moraleReason.second );
234
- mMorale .adjustMorale (moraleReason.second );
222
+ mMorale .journalMoraleChange ({moraleReason.first , moraleReason.second });
235
223
}
236
224
237
225
mPopulationPanel .crimeRate (mCrimeRateUpdate .meanCrimeRate ());
238
226
239
227
for (const auto & moraleReason : mCrimeExecution .moraleChanges ())
240
228
{
241
- mPopulationPanel .addMoraleReason (moraleReason.first , moraleReason.second );
242
- mMorale .adjustMorale (moraleReason.second );
229
+ mMorale .journalMoraleChange ({moraleReason.first , moraleReason.second });
243
230
}
244
231
}
245
232
@@ -380,7 +367,7 @@ void MapViewState::checkColonyShip()
380
367
{
381
368
if (mLandersColonist > 0 || mLandersCargo > 0 )
382
369
{
383
- mMorale .adjustMorale ( -(mLandersColonist * 50 ) * ColonyShipDeorbitMoraleLossMultiplier.at (mDifficulty ));
370
+ mMorale .journalMoraleChange ({ " Deorbit Disaster! " , -(mLandersColonist * 50 ) * ColonyShipDeorbitMoraleLossMultiplier.at (mDifficulty )} );
384
371
385
372
mLandersColonist = 0 ;
386
373
mLandersCargo = 0 ;
@@ -695,6 +682,8 @@ void MapViewState::nextTurn()
695
682
mNotificationWindow .hide ();
696
683
mNotificationArea .clear ();
697
684
685
+ mMorale .closeJournal ();
686
+
698
687
clearMode ();
699
688
700
689
mPopulationPool .clear ();
0 commit comments