* Initializes all the elements in the Next Turn screen. * @param game Pointer to the core game. * @param battleGame Pointer to the saved game. * @param state Pointer to the Battlescape state. */
| 46 | * @param state Pointer to the Battlescape state. |
| 47 | */ |
| 48 | NextTurnState::NextTurnState(Game *game, SavedBattleGame *battleGame, BattlescapeState *state) : State(game), _battleGame(battleGame), _state(state), _timer(0) |
| 49 | { |
| 50 | // Create objects |
| 51 | int y = state->getMap()->getMessageY(); |
| 52 | |
| 53 | _window = new Window(this, 320, 200, 0, 0); |
| 54 | _txtTitle = new Text(320, 17, 0, 68); |
| 55 | _txtTurn = new Text(320, 17, 0, 92); |
| 56 | _txtSide = new Text(320, 17, 0, 108); |
| 57 | _txtMessage = new Text(320, 17, 0, 132); |
| 58 | |
| 59 | // Set palette |
| 60 | setPalette("PAL_BATTLESCAPE"); |
| 61 | |
| 62 | add(_window); |
| 63 | add(_txtTitle); |
| 64 | add(_txtTurn); |
| 65 | add(_txtSide); |
| 66 | add(_txtMessage); |
| 67 | |
| 68 | centerAllSurfaces(); |
| 69 | |
| 70 | // make this screen line up with the hidden movement screen |
| 71 | _window->setY(y); |
| 72 | _txtTitle->setY(y + 68); |
| 73 | _txtTurn->setY(y + 92); |
| 74 | _txtSide->setY(y + 108); |
| 75 | _txtMessage->setY(y + 132); |
| 76 | |
| 77 | // Set up objects |
| 78 | _window->setColor(Palette::blockOffset(0)-1); |
| 79 | _window->setHighContrast(true); |
| 80 | _window->setBackground(_game->getResourcePack()->getSurface("TAC00.SCR")); |
| 81 | |
| 82 | _txtTitle->setColor(Palette::blockOffset(0)-1); |
| 83 | _txtTitle->setBig(); |
| 84 | _txtTitle->setAlign(ALIGN_CENTER); |
| 85 | _txtTitle->setHighContrast(true); |
| 86 | _txtTitle->setText(tr("STR_OPENXCOM")); |
| 87 | |
| 88 | _txtTurn->setColor(Palette::blockOffset(0)-1); |
| 89 | _txtTurn->setBig(); |
| 90 | _txtTurn->setAlign(ALIGN_CENTER); |
| 91 | _txtTurn->setHighContrast(true); |
| 92 | _txtTurn->setText(tr("STR_TURN").arg(_battleGame->getTurn())); |
| 93 | |
| 94 | _txtSide->setColor(Palette::blockOffset(0)-1); |
| 95 | _txtSide->setBig(); |
| 96 | _txtSide->setAlign(ALIGN_CENTER); |
| 97 | _txtSide->setHighContrast(true); |
| 98 | _txtSide->setText(tr("STR_SIDE").arg(tr((_battleGame->getSide() == FACTION_PLAYER ? "STR_XCOM" : "STR_ALIENS")))); |
| 99 | |
| 100 | _txtMessage->setColor(Palette::blockOffset(0)-1); |
| 101 | _txtMessage->setBig(); |
| 102 | _txtMessage->setAlign(ALIGN_CENTER); |
| 103 | _txtMessage->setHighContrast(true); |
| 104 | _txtMessage->setText(tr("STR_PRESS_BUTTON_TO_CONTINUE")); |
| 105 |
nothing calls this directly
no test coverage detected