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

Method ListSaveState

src/Menu/ListSaveState.cpp:39–70  ·  view source on GitHub ↗

* Initializes all the elements in the Save Game screen. * @param game Pointer to the core game. * @param origin Game section that originated this state. */

Source from the content-addressed store, hash-verified

37 * @param origin Game section that originated this state.
38 */
39ListSaveState::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 *

Callers

nothing calls this directly

Calls 8

isIronmanMethod · 0.80
getSavedGameMethod · 0.80
onMouseClickMethod · 0.80
onKeyboardPressMethod · 0.80
setTextMethod · 0.45
setVisibleMethod · 0.45
setXMethod · 0.45
setColorMethod · 0.45

Tested by

no test coverage detected