MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / btnOkClick

Method btnOkClick

src/Geoscape/MonthlyReportState.cpp:242–282  ·  view source on GitHub ↗

* Returns to the previous screen. * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

240 * @param action Pointer to an action.
241 */
242void MonthlyReportState::btnOkClick(Action *)
243{
244 if (!_gameOver)
245 {
246 _game->popState();
247 if (_psi)
248 {
249 _game->pushState(new PsiTrainingState(_game));
250 }
251 // Autosave
252 if (_game->getSavedGame()->isIronman())
253 {
254 _game->pushState(new SaveGameState(_game, OPT_GEOSCAPE, SAVE_IRONMAN));
255 }
256 else if (Options::autosave)
257 {
258 _game->pushState(new SaveGameState(_game, OPT_GEOSCAPE, SAVE_AUTO_GEOSCAPE));
259 }
260 }
261 else
262 {
263 if (_txtFailure->getVisible())
264 {
265 _game->popState();
266 _game->pushState(new DefeatState(_game));
267 }
268 else
269 {
270 _window->setColor(Palette::blockOffset(8)+10);
271 _txtTitle->setVisible(false);
272 _txtMonth->setVisible(false);
273 _txtRating->setVisible(false);
274 _txtChange->setVisible(false);
275 _txtDesc->setVisible(false);
276 _btnOk->setVisible(false);
277 _btnBigOk->setVisible(true);
278 _txtFailure->setVisible(true);
279 _game->getResourcePack()->playMusic("GMLOSE");
280 }
281 }
282}
283
284/**
285 * Update all our activity counters, gather all our scores,

Callers

nothing calls this directly

Calls 9

pushStateMethod · 0.80
isIronmanMethod · 0.80
getSavedGameMethod · 0.80
playMusicMethod · 0.80
popStateMethod · 0.45
getVisibleMethod · 0.45
setColorMethod · 0.45
setVisibleMethod · 0.45
getResourcePackMethod · 0.45

Tested by

no test coverage detected