| 16 | namespace OpenApoc |
| 17 | { |
| 18 | BattleDebriefing::BattleDebriefing(sp<GameState> state) |
| 19 | : Stage(), menuform(ui().getForm("battle/debriefing")), state(state) |
| 20 | { |
| 21 | menuform->findControlTyped<GraphicButton>("BUTTON_OK") |
| 22 | ->addCallback(FormEventType::ButtonClick, [this](Event *) { |
| 23 | Battle::exitBattle(*this->state); |
| 24 | fw().stageQueueCommand({StageCmd::Command::REPLACEALL, mksp<CityView>(this->state)}); |
| 25 | }); |
| 26 | |
| 27 | menuform->findControlTyped<Label>("TEXT_SCORE_COMBAT_RATING") |
| 28 | ->setText(format("%d", state->current_battle->score.combatRating)); |
| 29 | menuform->findControlTyped<Label>("TEXT_SCORE_CASUALTY_PENALTY") |
| 30 | ->setText(format("%d", state->current_battle->score.casualtyPenalty)); |
| 31 | menuform->findControlTyped<Label>("TEXT_SCORE_LEADERSHIP_BONUS") |
| 32 | ->setText(format("%d", state->current_battle->score.getLeadershipBonus())); |
| 33 | menuform->findControlTyped<Label>("TEXT_SCORE_LIVE_ALIENS_CAPTURED") |
| 34 | ->setText(format("%d", state->current_battle->score.liveAlienCaptured)); |
| 35 | menuform->findControlTyped<Label>("TEXT_SCORE_EQUIPMENT_CAPTURED") |
| 36 | ->setText(format("%d", state->current_battle->score.equipmentCaptured)); |
| 37 | menuform->findControlTyped<Label>("TEXT_SCORE_EQUIPMENT_LOST") |
| 38 | ->setText(format("%d", state->current_battle->score.equipmentLost)); |
| 39 | menuform->findControlTyped<Label>("TEXT_SCORE_TOTAL") |
| 40 | ->setText(format("%d", state->current_battle->score.getTotal())); |
| 41 | menuform->findControlTyped<Label>("TEXT_MISSION_PERFORMANCE") |
| 42 | ->setText(format("%s", state->current_battle->score.getText())); |
| 43 | |
| 44 | int idx = 1; |
| 45 | for (auto &u : state->current_battle->unitsPromoted) |
| 46 | { |
| 47 | menuform->findControlTyped<Label>(format("PROMOTION_%d", idx++)) |
| 48 | ->setText( |
| 49 | format("%s %s %s", u->agent->name, tr("promoted to"), u->agent->getRankName())); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | void BattleDebriefing::begin() {} |
| 54 |
nothing calls this directly
no test coverage detected