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

Method init

src/Geoscape/GeoscapeState.cpp:504–534  ·  view source on GitHub ↗

* Updates the timer display and resets the palette * since it's bound to change on other screens. */

Source from the content-addressed store, hash-verified

502 * since it's bound to change on other screens.
503 */
504void GeoscapeState::init()
505{
506 State::init();
507 timeDisplay();
508
509 _globe->onMouseClick((ActionHandler)&GeoscapeState::globeClick);
510 _globe->onMouseOver(0);
511 _globe->rotateStop();
512 _globe->setFocus(true);
513 _globe->draw();
514
515 // Pop up save screen if it's a new ironman game
516 if (_game->getSavedGame()->isIronman() && _game->getSavedGame()->getName().empty())
517 {
518 popup(new ListSaveState(_game, OPT_GEOSCAPE));
519 }
520
521 // Set music if it's not already playing
522 if (_dogfights.empty() && !_dogfightStartTimer->isRunning())
523 {
524 if (_game->getSavedGame()->getMonthsPassed() == -1)
525 {
526 _game->getResourcePack()->playMusic("GMGEO1");
527 }
528 else
529 {
530 _game->getResourcePack()->playMusic("GMGEO", true);
531 }
532 }
533 _globe->unsetNewBaseHover();
534}
535
536/**
537 * Runs the game timer and handles popups.

Callers

nothing calls this directly

Calls 15

initFunction · 0.85
onMouseClickMethod · 0.80
onMouseOverMethod · 0.80
rotateStopMethod · 0.80
isIronmanMethod · 0.80
getSavedGameMethod · 0.80
isRunningMethod · 0.80
getMonthsPassedMethod · 0.80
playMusicMethod · 0.80
unsetNewBaseHoverMethod · 0.80
setFocusMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected