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

Method restart

src/Menu/OptionsBaseState.cpp:160–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160void OptionsBaseState::restart(Game *game, OptionsOrigin origin)
161{
162 if (origin == OPT_MENU)
163 {
164 game->setState(new MainMenuState(game));
165 }
166 else if (origin == OPT_GEOSCAPE)
167 {
168 game->setState(new GeoscapeState(game));
169 }
170 else if (origin == OPT_BATTLESCAPE)
171 {
172 game->setState(new GeoscapeState(game));
173 BattlescapeState *bs = new BattlescapeState(game);
174 game->pushState(bs);
175 game->getSavedGame()->getSavedBattle()->setBattleState(bs);
176 }
177}
178
179/**
180 * Initializes UI colors according to origin.

Callers

nothing calls this directly

Calls 5

setStateMethod · 0.80
pushStateMethod · 0.80
setBattleStateMethod · 0.80
getSavedBattleMethod · 0.80
getSavedGameMethod · 0.80

Tested by

no test coverage detected