| 601 | } |
| 602 | |
| 603 | void GameEventHandler::GoToMainMenu(bool afterIntro) |
| 604 | { |
| 605 | InvokeAsync([this, afterIntro]() { |
| 606 | ZoneScopedNC("GameEventHandler::GoToMainMenu", 0x888888); |
| 607 | |
| 608 | LOGI("Going to main menu"); |
| 609 | |
| 610 | #if defined(WITH_MULTIPLAYER) |
| 611 | if (_networkManager != nullptr) { |
| 612 | _networkManager->Dispose(); |
| 613 | _networkManager = nullptr; |
| 614 | _streamedAsset = nullptr; |
| 615 | } |
| 616 | #endif |
| 617 | InGameConsole::Clear(); |
| 618 | if (auto* mainMenu = runtime_cast<Menu::MainMenu>(_currentHandler.get())) { |
| 619 | mainMenu->Reset(); |
| 620 | } else { |
| 621 | SetStateHandler(std::make_shared<Menu::MainMenu>(this, afterIntro)); |
| 622 | } |
| 623 | }); |
| 624 | } |
| 625 | |
| 626 | void GameEventHandler::ChangeLevel(LevelInitialization&& levelInit) |
| 627 | { |
no test coverage detected