| 14 | } |
| 15 | |
| 16 | void PauseSection::OnShow(IMenuContainer* root) |
| 17 | { |
| 18 | MenuSection::OnShow(root); |
| 19 | |
| 20 | #if defined(WITH_MULTIPLAYER) |
| 21 | bool isLocalSession = true, isSpectating = false; |
| 22 | if (auto inGameMenu = runtime_cast<InGameMenu>(_root)) { |
| 23 | isLocalSession = inGameMenu->IsLocalSession(); |
| 24 | isSpectating = inGameMenu->IsSpectating(); |
| 25 | } |
| 26 | #endif |
| 27 | |
| 28 | _items.clear(); |
| 29 | |
| 30 | // TRANSLATORS: Menu item in main menu |
| 31 | _items.emplace_back(Item::Resume, _("Resume")); |
| 32 | |
| 33 | #if defined(WITH_MULTIPLAYER) |
| 34 | if (!isLocalSession) { |
| 35 | // TRANSLATORS: Menu item in main menu |
| 36 | _items.emplace_back(Item::Spectate, isSpectating ? _("Join Game") : _("Spectate")); |
| 37 | } |
| 38 | #endif |
| 39 | |
| 40 | // TRANSLATORS: Menu item in main menu |
| 41 | _items.emplace_back(Item::Options, _("Options")); |
| 42 | |
| 43 | #if defined(WITH_MULTIPLAYER) |
| 44 | // TRANSLATORS: Menu item in main menu |
| 45 | _items.emplace_back(Item::Exit, isLocalSession ? _("Save & Exit") : _("Disconnect & Exit")); |
| 46 | #else |
| 47 | // TRANSLATORS: Menu item in main menu |
| 48 | _items.emplace_back(Item::Exit, _("Save & Exit")); |
| 49 | #endif |
| 50 | |
| 51 | _animation = 0.0f; |
| 52 | } |
| 53 | |
| 54 | void PauseSection::OnUpdate(float timeMult) |
| 55 | { |
nothing calls this directly
no test coverage detected