| 17 | namespace OpenApoc |
| 18 | { |
| 19 | ScoreScreen::ScoreScreen(sp<GameState> state, bool showWeeklyUpkeep) |
| 20 | : Stage(), menuform(ui().getForm("city/score")), state(state), isWeeklyUpkeep(showWeeklyUpkeep) |
| 21 | { |
| 22 | menuform->findControlTyped<Label>("TEXT_FUNDS")->setText(state->getPlayerBalance()); |
| 23 | menuform->findControlTyped<Label>("TEXT_DATE")->setText(state->gameTime.getLongDateString()); |
| 24 | menuform->findControlTyped<Label>("TEXT_WEEK")->setText(state->gameTime.getWeekString()); |
| 25 | |
| 26 | formScore = menuform->findControlTyped<Form>("SCORE_VIEW"); |
| 27 | formFinance = menuform->findControlTyped<Form>("FINANCE_VIEW"); |
| 28 | title = menuform->findControlTyped<Label>("TITLE"); |
| 29 | |
| 30 | auto buttonScore = menuform->findControlTyped<RadioButton>("BUTTON_SCORE"); |
| 31 | buttonScore->addCallback(FormEventType::CheckBoxSelected, [this](Event *) { setScoreMode(); }); |
| 32 | |
| 33 | auto buttonFinance = menuform->findControlTyped<RadioButton>("BUTTON_FINANCE"); |
| 34 | buttonFinance->addCallback(FormEventType::CheckBoxSelected, |
| 35 | [this](Event *) { setFinanceMode(); }); |
| 36 | |
| 37 | auto buttonOK = menuform->findControlTyped<GraphicButton>("BUTTON_OK"); |
| 38 | buttonOK->addCallback(FormEventType::ButtonClick, |
| 39 | [](Event *) { fw().stageQueueCommand({StageCmd::Command::POP}); }); |
| 40 | |
| 41 | if (isWeeklyUpkeep) |
| 42 | { |
| 43 | buttonFinance->setChecked(true); |
| 44 | } |
| 45 | else |
| 46 | { |
| 47 | buttonScore->setChecked(true); |
| 48 | } |
| 49 | } |
| 50 | |
| 51 | ScoreScreen::~ScoreScreen() = default; |
| 52 |
nothing calls this directly
no test coverage detected