* Initializes all the elements in the Cannot Reequip screen. * @param game Pointer to the core game. * @param missingItems List of items still needed for reequip. */
| 40 | * @param missingItems List of items still needed for reequip. |
| 41 | */ |
| 42 | CannotReequipState::CannotReequipState(Game *game, std::vector<ReequipStat> missingItems) : State(game) |
| 43 | { |
| 44 | // Create objects |
| 45 | _window = new Window(this, 320, 200, 0, 0); |
| 46 | _btnOk = new TextButton(120, 18, 100, 174); |
| 47 | _txtTitle = new Text(220, 32, 50, 8); |
| 48 | _txtItem = new Text(142, 9, 10, 50); |
| 49 | _txtQuantity = new Text(88, 9, 152, 50); |
| 50 | _txtCraft = new Text(74, 9, 218, 50); |
| 51 | _lstItems = new TextList(288, 112, 8, 58); |
| 52 | |
| 53 | // Set palette |
| 54 | setPalette("PAL_GEOSCAPE", 0); |
| 55 | |
| 56 | add(_window); |
| 57 | add(_btnOk); |
| 58 | add(_txtTitle); |
| 59 | add(_txtItem); |
| 60 | add(_txtQuantity); |
| 61 | add(_txtCraft); |
| 62 | add(_lstItems); |
| 63 | |
| 64 | centerAllSurfaces(); |
| 65 | |
| 66 | // Set up objects |
| 67 | _window->setColor(Palette::blockOffset(15)-1); |
| 68 | _window->setBackground(_game->getResourcePack()->getSurface("BACK01.SCR")); |
| 69 | |
| 70 | _btnOk->setColor(Palette::blockOffset(8)+5); |
| 71 | _btnOk->setText(tr("STR_OK")); |
| 72 | _btnOk->onMouseClick((ActionHandler)&CannotReequipState::btnOkClick); |
| 73 | _btnOk->onKeyboardPress((ActionHandler)&CannotReequipState::btnOkClick, Options::keyOk); |
| 74 | _btnOk->onKeyboardPress((ActionHandler)&CannotReequipState::btnOkClick, Options::keyCancel); |
| 75 | |
| 76 | _txtTitle->setColor(Palette::blockOffset(8)+5); |
| 77 | _txtTitle->setText(tr("STR_NOT_ENOUGH_EQUIPMENT_TO_FULLY_RE_EQUIP_SQUAD")); |
| 78 | _txtTitle->setAlign(ALIGN_CENTER); |
| 79 | _txtTitle->setBig(); |
| 80 | _txtTitle->setWordWrap(true); |
| 81 | |
| 82 | _txtItem->setColor(Palette::blockOffset(15)-1); |
| 83 | _txtItem->setText(tr("STR_ITEM")); |
| 84 | |
| 85 | _txtQuantity->setColor(Palette::blockOffset(15)-1); |
| 86 | _txtQuantity->setText(tr("STR_QUANTITY_UC")); |
| 87 | |
| 88 | _txtCraft->setColor(Palette::blockOffset(15)-1); |
| 89 | _txtCraft->setText(tr("STR_CRAFT")); |
| 90 | |
| 91 | _lstItems->setColor(Palette::blockOffset(8)+10); |
| 92 | _lstItems->setColumns(3, 162, 46, 80); |
| 93 | _lstItems->setSelectable(true); |
| 94 | _lstItems->setBackground(_window); |
| 95 | _lstItems->setMargin(2); |
| 96 | |
| 97 | for (std::vector<ReequipStat>::iterator i = missingItems.begin(); i != missingItems.end(); ++i) |
| 98 | { |
| 99 | std::wostringstream ss; |
nothing calls this directly
no test coverage detected