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

Method init

src/Basescape/BasescapeState.cpp:201–223  ·  view source on GitHub ↗

* The player can change the selected base * or change info on other screens. */

Source from the content-addressed store, hash-verified

199 * or change info on other screens.
200 */
201void BasescapeState::init()
202{
203 State::init();
204
205 setBase(_base);
206 _view->setBase(_base);
207 _mini->draw();
208 _edtBase->setText(_base->getName());
209
210 // Get area
211 for (std::vector<Region*>::iterator i = _game->getSavedGame()->getRegions()->begin(); i != _game->getSavedGame()->getRegions()->end(); ++i)
212 {
213 if ((*i)->getRules()->insideRegion(_base->getLongitude(), _base->getLatitude()))
214 {
215 _txtLocation->setText(tr((*i)->getRules()->getType()));
216 break;
217 }
218 }
219
220 _txtFunds->setText(tr("STR_FUNDS").arg(Text::formatFunding(_game->getSavedGame()->getFunds())));
221
222 _btnNewBase->setVisible(_game->getSavedGame()->getBases()->size() < MiniBaseView::MAX_BASES);
223}
224
225/**
226 * Changes the base currently displayed on screen.

Callers

nothing calls this directly

Calls 15

initFunction · 0.85
getRegionsMethod · 0.80
getSavedGameMethod · 0.80
insideRegionMethod · 0.80
getFundsMethod · 0.80
getBasesMethod · 0.80
argMethod · 0.60
setBaseMethod · 0.45
drawMethod · 0.45
setTextMethod · 0.45
getNameMethod · 0.45
getRulesMethod · 0.45

Tested by

no test coverage detected