* Returns to the previous screen. * @param action Pointer to an action. */
| 240 | * @param action Pointer to an action. |
| 241 | */ |
| 242 | void 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, |
nothing calls this directly
no test coverage detected