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

Method btnOkClick

src/Geoscape/ConfirmNewBaseState.cpp:113–125  ·  view source on GitHub ↗

* Go to the Place Access Lift screen. * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

111 * @param action Pointer to an action.
112 */
113void ConfirmNewBaseState::btnOkClick(Action *)
114{
115 if (_game->getSavedGame()->getFunds() >= _cost)
116 {
117 _game->getSavedGame()->setFunds(_game->getSavedGame()->getFunds() - _cost);
118 _game->getSavedGame()->getBases()->push_back(_base);
119 _game->pushState(new BaseNameState(_game, _base, _globe, false));
120 }
121 else
122 {
123 _game->pushState(new ErrorMessageState(_game, "STR_NOT_ENOUGH_MONEY", _palette, Palette::blockOffset(8)+10, "BACK01.SCR", 0));
124 }
125}
126
127/**
128 * Returns to the previous screen.

Callers

nothing calls this directly

Calls 5

getFundsMethod · 0.80
getSavedGameMethod · 0.80
setFundsMethod · 0.80
getBasesMethod · 0.80
pushStateMethod · 0.80

Tested by

no test coverage detected