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

Method NoContainmentState

src/Battlescape/NoContainmentState.cpp:36–67  ·  view source on GitHub ↗

* Initializes all the elements in the No Containment screen. * @param game Pointer to the core game. */

Source from the content-addressed store, hash-verified

34 * @param game Pointer to the core game.
35 */
36NoContainmentState::NoContainmentState(Game *game) : State(game)
37{
38 // Create objects
39 _window = new Window(this, 320, 200, 0, 0);
40 _btnOk = new TextButton(120, 18, 100, 174);
41 _txtTitle = new Text(220, 64, 50, 8);
42
43 // Set palette
44 setPalette("PAL_GEOSCAPE", 0);
45
46 add(_window);
47 add(_btnOk);
48 add(_txtTitle);
49
50 centerAllSurfaces();
51
52 // Set up objects
53 _window->setColor(Palette::blockOffset(15)-1);
54 _window->setBackground(_game->getResourcePack()->getSurface("BACK01.SCR"));
55
56 _btnOk->setColor(Palette::blockOffset(8)+5);
57 _btnOk->setText(tr("STR_OK"));
58 _btnOk->onMouseClick((ActionHandler)&NoContainmentState::btnOkClick);
59 _btnOk->onKeyboardPress((ActionHandler)&NoContainmentState::btnOkClick, Options::keyOk);
60 _btnOk->onKeyboardPress((ActionHandler)&NoContainmentState::btnOkClick, Options::keyCancel);
61
62 _txtTitle->setColor(Palette::blockOffset(8)+5);
63 _txtTitle->setText(tr("STR_ALIEN_DIES_NO_ALIEN_CONTAINMENT_FACILITY"));
64 _txtTitle->setAlign(ALIGN_CENTER);
65 _txtTitle->setBig();
66 _txtTitle->setWordWrap(true);
67}
68
69/**
70 *

Callers

nothing calls this directly

Calls 10

onMouseClickMethod · 0.80
onKeyboardPressMethod · 0.80
setColorMethod · 0.45
setBackgroundMethod · 0.45
getSurfaceMethod · 0.45
getResourcePackMethod · 0.45
setTextMethod · 0.45
setAlignMethod · 0.45
setBigMethod · 0.45
setWordWrapMethod · 0.45

Tested by

no test coverage detected