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

Method TestState

src/Menu/TestState.cpp:47–119  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

45 * @param game Pointer to the core game.
46 */
47TestState::TestState(Game *game) : State(game)
48{
49 // Create objects
50 _window = new Window(this, 300, 180, 10, 10);
51 _text = new Text(280, 120, 20, 50);
52 _button = new TextButton(100, 20, 110, 150);
53 _list = new TextList(300, 180, 10, 10);
54 _number = new NumberText(50, 5, 200, 25);
55 _set = _game->getResourcePack()->getSurfaceSet("BASEBITS.PCK");
56 _set->getFrame(1);
57 _slider = new Slider(100, 15, 50, 50);
58 _comboBox = new ComboBox(this, 80, 16, 98, 100);
59 // Set palette
60 setPalette("PAL_BASESCAPE", 2);
61
62 add(_window);
63 add(_button);
64 add(_text);
65 add(_list);
66 add(_number);
67 add(_slider);
68 add(_comboBox);
69
70 centerAllSurfaces();
71
72 // Set up objects
73 _window->setColor(Palette::blockOffset(15)+1);
74 _window->setBackground(_game->getResourcePack()->getSurface("BACK04.SCR"));
75
76 _button->setColor(Palette::blockOffset(15)+1);
77 _button->setText(L"LOLOLOL");
78
79 _text->setColor(Palette::blockOffset(15)+1);
80 //_text->setBig();
81 _text->setWordWrap(true);
82 _text->setAlign(ALIGN_CENTER);
83 _text->setVerticalAlign(ALIGN_MIDDLE);
84 //_text->setText(tr("STR_COUNCIL_TERMINATED"));
85
86 _list->setColor(Palette::blockOffset(15)+1);
87 _list->setColumns(3, 100, 50, 100);
88 _list->addRow(2, L"a", L"b");
89 _list->addRow(3, L"lol", L"welp", L"yo");
90 _list->addRow(1, L"0123456789");
91
92 _number->setColor(Palette::blockOffset(15) + 1);
93 _number->setValue(1234567890);
94
95 _slider->setColor(Palette::blockOffset(15)+1);
96
97 std::vector<std::string> difficulty;
98 for (int i = 0; i != 3; ++i)
99 {
100 difficulty.push_back("STR_1_BEGINNER");
101 difficulty.push_back("STR_2_EXPERIENCED");
102 difficulty.push_back("STR_3_VETERAN");
103 difficulty.push_back("STR_4_GENIUS");
104 difficulty.push_back("STR_5_SUPERHUMAN");

Callers

nothing calls this directly

Calls 14

getSurfaceSetMethod · 0.80
getFrameMethod · 0.80
setColumnsMethod · 0.80
addRowMethod · 0.80
setOptionsMethod · 0.80
getResourcePackMethod · 0.45
setColorMethod · 0.45
setBackgroundMethod · 0.45
getSurfaceMethod · 0.45
setTextMethod · 0.45
setWordWrapMethod · 0.45
setAlignMethod · 0.45

Tested by

no test coverage detected