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

Method CraftsState

src/Basescape/CraftsState.cpp:46–116  ·  view source on GitHub ↗

* Initializes all the elements in the Equip Craft screen. * @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

44 * @param base Pointer to the base to get info from.
45 */
46CraftsState::CraftsState(Game *game, Base *base) : State(game), _base(base)
47{
48 // Create objects
49 _window = new Window(this, 320, 200, 0, 0);
50 _btnOk = new TextButton(288, 16, 16, 176);
51 _txtTitle = new Text(298, 17, 16, 8);
52 _txtBase = new Text(298, 17, 16, 24);
53 _txtName = new Text(94, 9, 16, 40);
54 _txtStatus = new Text(50, 9, 110, 40);
55 _txtWeapon = new Text(50, 17, 160, 40);
56 _txtCrew = new Text(58, 9, 210, 40);
57 _txtHwp = new Text(46, 9, 268, 40);
58 _lstCrafts = new TextList(288, 118, 8, 58);
59
60 // Set palette
61 setPalette("PAL_BASESCAPE", 3);
62
63 add(_window);
64 add(_btnOk);
65 add(_txtTitle);
66 add(_txtBase);
67 add(_txtName);
68 add(_txtStatus);
69 add(_txtWeapon);
70 add(_txtCrew);
71 add(_txtHwp);
72 add(_lstCrafts);
73
74 centerAllSurfaces();
75
76 // Set up objects
77 _window->setColor(Palette::blockOffset(15)+1);
78 _window->setBackground(_game->getResourcePack()->getSurface("BACK14.SCR"));
79
80 _btnOk->setColor(Palette::blockOffset(13)+10);
81 _btnOk->setText(tr("STR_OK"));
82 _btnOk->onMouseClick((ActionHandler)&CraftsState::btnOkClick);
83 _btnOk->onKeyboardPress((ActionHandler)&CraftsState::btnOkClick, Options::keyCancel);
84
85 _txtTitle->setColor(Palette::blockOffset(15)+1);
86 _txtTitle->setBig();
87 _txtTitle->setText(tr("STR_INTERCEPTION_CRAFT"));
88
89 _txtBase->setColor(Palette::blockOffset(15)+1);
90 _txtBase->setBig();
91 _txtBase->setText(tr("STR_BASE_").arg(_base->getName()));
92
93 _txtName->setColor(Palette::blockOffset(15)+1);
94 _txtName->setText(tr("STR_NAME_UC"));
95
96 _txtStatus->setColor(Palette::blockOffset(15)+1);
97 _txtStatus->setText(tr("STR_STATUS"));
98
99 _txtWeapon->setColor(Palette::blockOffset(15)+1);
100 _txtWeapon->setText(tr("STR_WEAPON_SYSTEMS"));
101 _txtWeapon->setWordWrap(true);
102
103 _txtCrew->setColor(Palette::blockOffset(15)+1);

Callers

nothing calls this directly

Calls 15

onMouseClickMethod · 0.80
onKeyboardPressMethod · 0.80
setColumnsMethod · 0.80
setMarginMethod · 0.80
argMethod · 0.60
setColorMethod · 0.45
setBackgroundMethod · 0.45
getSurfaceMethod · 0.45
getResourcePackMethod · 0.45
setTextMethod · 0.45
setBigMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected