* Initializes all the elements in the Save Game screen. * @param game Pointer to the core game. * @param origin Game section that originated this state. */
| 37 | * @param origin Game section that originated this state. |
| 38 | */ |
| 39 | ListSaveState::ListSaveState(Game *game, OptionsOrigin origin) : ListGamesState(game, origin, 1, false), _selected(L""), _previousSelectedRow(-1), _selectedRow(-1) |
| 40 | { |
| 41 | // Create objects |
| 42 | _edtSave = new TextEdit(this, 168, 9, 0, 0); |
| 43 | _btnSaveGame = new TextButton(_game->getSavedGame()->isIronman() ? 200 : 80, 16, 60, 172); |
| 44 | |
| 45 | add(_edtSave); |
| 46 | add(_btnSaveGame); |
| 47 | |
| 48 | // Set up objects |
| 49 | |
| 50 | _txtTitle->setText(tr("STR_SELECT_SAVE_POSITION")); |
| 51 | |
| 52 | if (_game->getSavedGame()->isIronman()) |
| 53 | { |
| 54 | _btnCancel->setVisible(false); |
| 55 | } |
| 56 | else |
| 57 | { |
| 58 | _btnCancel->setX(180); |
| 59 | } |
| 60 | |
| 61 | _btnSaveGame->setColor(Palette::blockOffset(8)+5); |
| 62 | _btnSaveGame->setText(tr("STR_SAVE_GAME")); |
| 63 | _btnSaveGame->onMouseClick((ActionHandler)&ListSaveState::btnSaveGameClick); |
| 64 | |
| 65 | _edtSave->setColor(Palette::blockOffset(8)+10); |
| 66 | _edtSave->setVisible(false); |
| 67 | _edtSave->onKeyboardPress((ActionHandler)&ListSaveState::edtSaveKeyPress); |
| 68 | |
| 69 | centerAllSurfaces(); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * |
nothing calls this directly
no test coverage detected