* Initializes all the elements in the Monthly Report screen. * @param game Pointer to the core game. * @param psi Show psi training afterwards? * @param globe Pointer to the globe. */
| 49 | * @param globe Pointer to the globe. |
| 50 | */ |
| 51 | MonthlyReportState::MonthlyReportState(Game *game, bool psi, Globe *globe) : State(game), _psi(psi), _gameOver(false), _ratingTotal(0), _fundingDiff(0), _lastMonthsRating(0), _happyList(0), _sadList(0), _pactList(0) |
| 52 | { |
| 53 | _globe = globe; |
| 54 | // Create objects |
| 55 | _window = new Window(this, 320, 200, 0, 0); |
| 56 | _btnOk = new TextButton(50, 12, 135, 180); |
| 57 | _btnBigOk = new TextButton(120, 18, 100, 174); |
| 58 | _txtTitle = new Text(300, 17, 16, 8); |
| 59 | _txtMonth = new Text(110, 9, 16, 24); |
| 60 | _txtRating = new Text(180, 9, 125, 24); |
| 61 | _txtChange = new Text(300, 9, 16, 32); |
| 62 | _txtDesc = new Text(280, 140, 16, 40); |
| 63 | _txtFailure = new Text(290, 160, 15, 10); |
| 64 | |
| 65 | // Set palette |
| 66 | setPalette("PAL_GEOSCAPE", 3); |
| 67 | |
| 68 | add(_window); |
| 69 | add(_btnOk); |
| 70 | add(_btnBigOk); |
| 71 | add(_txtTitle); |
| 72 | add(_txtMonth); |
| 73 | add(_txtRating); |
| 74 | add(_txtChange); |
| 75 | add(_txtDesc); |
| 76 | add(_txtFailure); |
| 77 | |
| 78 | centerAllSurfaces(); |
| 79 | |
| 80 | // Set up objects |
| 81 | _window->setColor(Palette::blockOffset(15)-1); |
| 82 | _window->setBackground(_game->getResourcePack()->getSurface("BACK13.SCR")); |
| 83 | |
| 84 | _btnOk->setColor(Palette::blockOffset(8)+10); |
| 85 | _btnOk->setText(tr("STR_OK")); |
| 86 | _btnOk->onMouseClick((ActionHandler)&MonthlyReportState::btnOkClick); |
| 87 | _btnOk->onKeyboardPress((ActionHandler)&MonthlyReportState::btnOkClick, Options::keyOk); |
| 88 | _btnOk->onKeyboardPress((ActionHandler)&MonthlyReportState::btnOkClick, Options::keyCancel); |
| 89 | |
| 90 | _btnBigOk->setColor(Palette::blockOffset(8)+10); |
| 91 | _btnBigOk->setText(tr("STR_OK")); |
| 92 | _btnBigOk->onMouseClick((ActionHandler)&MonthlyReportState::btnOkClick); |
| 93 | _btnBigOk->onKeyboardPress((ActionHandler)&MonthlyReportState::btnOkClick, Options::keyOk); |
| 94 | _btnBigOk->onKeyboardPress((ActionHandler)&MonthlyReportState::btnOkClick, Options::keyCancel); |
| 95 | _btnBigOk->setVisible(false); |
| 96 | |
| 97 | _txtTitle->setColor(Palette::blockOffset(15)-1); |
| 98 | _txtTitle->setBig(); |
| 99 | _txtTitle->setText(tr("STR_XCOM_PROJECT_MONTHLY_REPORT")); |
| 100 | |
| 101 | _txtFailure->setColor(Palette::blockOffset(8)+10); |
| 102 | _txtFailure->setBig(); |
| 103 | _txtFailure->setAlign(ALIGN_CENTER); |
| 104 | _txtFailure->setVerticalAlign(ALIGN_MIDDLE); |
| 105 | _txtFailure->setWordWrap(true); |
| 106 | _txtFailure->setText(tr("STR_YOU_HAVE_FAILED")); |
| 107 | _txtFailure->setVisible(false); |
| 108 |
nothing calls this directly
no test coverage detected