| 35 | namespace OpenXcom |
| 36 | { |
| 37 | UfopaediaSelectState::UfopaediaSelectState(Game *game, std::string section) : State(game), _section(section) |
| 38 | { |
| 39 | _screen = false; |
| 40 | |
| 41 | // set background window |
| 42 | _window = new Window(this, 256, 180, 32, 10, POPUP_NONE); |
| 43 | |
| 44 | // set title |
| 45 | _txtTitle = new Text(224, 17, 48, 26); |
| 46 | |
| 47 | // set buttons |
| 48 | _btnOk = new TextButton(224, 16, 48, 166); |
| 49 | _lstSelection = new TextList(224, 104, 40, 50); |
| 50 | |
| 51 | // Set palette |
| 52 | setPalette("PAL_GEOSCAPE", 0); |
| 53 | |
| 54 | add(_window); |
| 55 | add(_txtTitle); |
| 56 | add(_btnOk); |
| 57 | add(_lstSelection); |
| 58 | |
| 59 | centerAllSurfaces(); |
| 60 | |
| 61 | _window->setColor(Palette::blockOffset(15)-1); |
| 62 | _window->setBackground(_game->getResourcePack()->getSurface("BACK01.SCR")); |
| 63 | |
| 64 | _txtTitle->setColor(Palette::blockOffset(8)+10); |
| 65 | _txtTitle->setBig(); |
| 66 | _txtTitle->setAlign(ALIGN_CENTER); |
| 67 | _txtTitle->setText(tr("STR_SELECT_ITEM")); |
| 68 | |
| 69 | _btnOk->setColor(Palette::blockOffset(15)-1); |
| 70 | _btnOk->setText(tr("STR_OK")); |
| 71 | _btnOk->onMouseClick((ActionHandler)&UfopaediaSelectState::btnOkClick); |
| 72 | _btnOk->onKeyboardPress((ActionHandler)&UfopaediaSelectState::btnOkClick,Options::keyCancel); |
| 73 | |
| 74 | _lstSelection->setColor(Palette::blockOffset(8)+5); |
| 75 | _lstSelection->setArrowColor(Palette::blockOffset(15)-1); |
| 76 | _lstSelection->setColumns(1, 206); |
| 77 | _lstSelection->setSelectable(true); |
| 78 | _lstSelection->setBackground(_window); |
| 79 | _lstSelection->setMargin(18); |
| 80 | _lstSelection->setAlign(ALIGN_CENTER); |
| 81 | _lstSelection->onMouseClick((ActionHandler)&UfopaediaSelectState::lstSelectionClick); |
| 82 | |
| 83 | loadSelectionList(); |
| 84 | } |
| 85 | |
| 86 | UfopaediaSelectState::~UfopaediaSelectState() |
| 87 | {} |
nothing calls this directly
no test coverage detected