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

Method TransferBaseState

src/Basescape/TransferBaseState.cpp:44–124  ·  view source on GitHub ↗

* Initializes all the elements in the Select Destination Base window. * @param game Pointer to the core game. * @param base Pointer to the base to get info from. */

Source from the content-addressed store, hash-verified

42 * @param base Pointer to the base to get info from.
43 */
44TransferBaseState::TransferBaseState(Game *game, Base *base) : State(game), _base(base), _bases()
45{
46 // Create objects
47 _window = new Window(this, 280, 140, 20, 30);
48 _btnCancel = new TextButton(264, 16, 28, 146);
49 _txtTitle = new Text(270, 17, 25, 38);
50 _txtFunds = new Text(250, 9, 30, 54);
51 _txtName = new Text(130, 17, 28, 64);
52 _txtArea = new Text(130, 17, 160, 64);
53 _lstBases = new TextList(248, 64, 28, 80);
54
55 // Set palette
56 setPalette("PAL_BASESCAPE", 4);
57
58 add(_window);
59 add(_btnCancel);
60 add(_txtTitle);
61 add(_txtFunds);
62 add(_txtName);
63 add(_txtArea);
64 add(_lstBases);
65
66 centerAllSurfaces();
67
68 // Set up objects
69 _window->setColor(Palette::blockOffset(13)+5);
70 _window->setBackground(_game->getResourcePack()->getSurface("BACK13.SCR"));
71
72 _btnCancel->setColor(Palette::blockOffset(13)+5);
73 _btnCancel->setText(tr("STR_CANCEL"));
74 _btnCancel->onMouseClick((ActionHandler)&TransferBaseState::btnCancelClick);
75 _btnCancel->onKeyboardPress((ActionHandler)&TransferBaseState::btnCancelClick, Options::keyCancel);
76
77 _txtTitle->setColor(Palette::blockOffset(13)+5);
78 _txtTitle->setBig();
79 _txtTitle->setAlign(ALIGN_CENTER);
80 _txtTitle->setText(tr("STR_SELECT_DESTINATION_BASE"));
81
82 _txtFunds->setColor(Palette::blockOffset(13)+5);
83 _txtFunds->setSecondaryColor(Palette::blockOffset(13));
84 _txtFunds->setText(tr("STR_CURRENT_FUNDS").arg(Text::formatFunding(_game->getSavedGame()->getFunds())));
85
86 _txtName->setColor(Palette::blockOffset(13)+5);
87 _txtName->setText(tr("STR_NAME"));
88 _txtName->setBig();
89
90 _txtArea->setColor(Palette::blockOffset(13)+5);
91 _txtArea->setText(tr("STR_AREA"));
92 _txtArea->setBig();
93
94 _lstBases->setColor(Palette::blockOffset(15)+1);
95 _lstBases->setArrowColor(Palette::blockOffset(13)+5);
96 _lstBases->setColumns(2, 130, 116);
97 _lstBases->setSelectable(true);
98 _lstBases->setBackground(_window);
99 _lstBases->setMargin(2);
100 _lstBases->onMouseClick((ActionHandler)&TransferBaseState::lstBasesClick);
101

Callers

nothing calls this directly

Calls 15

onMouseClickMethod · 0.80
onKeyboardPressMethod · 0.80
getFundsMethod · 0.80
getSavedGameMethod · 0.80
setColumnsMethod · 0.80
setMarginMethod · 0.80
getBasesMethod · 0.80
getRegionsMethod · 0.80
insideRegionMethod · 0.80
addRowMethod · 0.80
setCellColorMethod · 0.80
argMethod · 0.60

Tested by

no test coverage detected