* The player can change the selected base * or change info on other screens. */
| 199 | * or change info on other screens. |
| 200 | */ |
| 201 | void 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. |
nothing calls this directly
no test coverage detected