* Initializes all the elements in the Ufo Lost window. * @param game Pointer to the core game. * @param id Name of the UFO. */
| 35 | * @param id Name of the UFO. |
| 36 | */ |
| 37 | UfoLostState::UfoLostState(Game *game, std::wstring id) : State(game), _id(id) |
| 38 | { |
| 39 | _screen = false; |
| 40 | |
| 41 | // Create objects |
| 42 | _window = new Window(this, 192, 104, 32, 48, POPUP_BOTH); |
| 43 | _btnOk = new TextButton(60, 12, 98, 112); |
| 44 | _txtTitle = new Text(160, 32, 48, 72); |
| 45 | |
| 46 | // Set palette |
| 47 | setPalette("PAL_GEOSCAPE", 7); |
| 48 | |
| 49 | add(_window); |
| 50 | add(_btnOk); |
| 51 | add(_txtTitle); |
| 52 | |
| 53 | centerAllSurfaces(); |
| 54 | |
| 55 | // Set up objects |
| 56 | _window->setColor(Palette::blockOffset(8)+5); |
| 57 | _window->setBackground(_game->getResourcePack()->getSurface("BACK15.SCR")); |
| 58 | |
| 59 | _btnOk->setColor(Palette::blockOffset(8)+5); |
| 60 | _btnOk->setText(tr("STR_OK")); |
| 61 | _btnOk->onMouseClick((ActionHandler)&UfoLostState::btnOkClick); |
| 62 | _btnOk->onKeyboardPress((ActionHandler)&UfoLostState::btnOkClick, Options::keyOk); |
| 63 | _btnOk->onKeyboardPress((ActionHandler)&UfoLostState::btnOkClick, Options::keyCancel); |
| 64 | |
| 65 | _txtTitle->setColor(Palette::blockOffset(8)+5); |
| 66 | _txtTitle->setBig(); |
| 67 | _txtTitle->setAlign(ALIGN_CENTER); |
| 68 | std::wstring s = _id; |
| 69 | s += L'\n'; |
| 70 | s += tr("STR_TRACKING_LOST"); |
| 71 | _txtTitle->setText(s); |
| 72 | } |
| 73 | |
| 74 | /** |
| 75 | * |
nothing calls this directly
no test coverage detected