From d9a2a7bfd0a80fbb385bb339e8e84393101f0ec6 Mon Sep 17 00:00:00 2001 From: nordsoft Date: Tue, 22 Aug 2023 16:00:14 +0400 Subject: [PATCH] Fix minor points --- client/CServerHandler.cpp | 2 +- client/mainmenu/CMainMenu.cpp | 9 +++------ client/mainmenu/CMainMenu.h | 4 ++-- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/client/CServerHandler.cpp b/client/CServerHandler.cpp index 7b53013a5..829007394 100644 --- a/client/CServerHandler.cpp +++ b/client/CServerHandler.cpp @@ -551,7 +551,7 @@ void CServerHandler::sendStartGame(bool allowOnlyAI) const catch (const std::exception & e) { showServerError( std::string("Unable to start map! Reason: ") + e.what()); - throw e; + return; } LobbyStartGame lsg; diff --git a/client/mainmenu/CMainMenu.cpp b/client/mainmenu/CMainMenu.cpp index 969d3f869..17fe0e6ef 100644 --- a/client/mainmenu/CMainMenu.cpp +++ b/client/mainmenu/CMainMenu.cpp @@ -587,6 +587,8 @@ CLoadingScreen::CLoadingScreen() { OBJ_CONSTRUCTION_CAPTURING_ALL_NO_DISPOSE; + addUsedEvents(TIME); + CCS->musich->stopMusic(5000); const auto & conf = CMainMenuConfig::get().getConfig()["loading"]; @@ -609,11 +611,8 @@ CLoadingScreen::~CLoadingScreen() { } -void CLoadingScreen::showAll(Canvas & to) +void CLoadingScreen::tick(uint32_t msPassed) { - //FIXME: filling screen with transparency? BLACK intended? - //Rect rect(0, 0, to->w, to->h); - //CSDL_Ext::fillRect(to, rect, Colors::TRANSPARENCY); if(!progressBlocks.empty()) { int status = float(get()) / 255.f * progressBlocks.size(); @@ -624,8 +623,6 @@ void CLoadingScreen::showAll(Canvas & to) progressBlocks.at(i)->visible = true; } } - - CWindowObject::showAll(to); } std::string CLoadingScreen::getBackground() diff --git a/client/mainmenu/CMainMenu.h b/client/mainmenu/CMainMenu.h index 544873a6a..7e632fe6f 100644 --- a/client/mainmenu/CMainMenu.h +++ b/client/mainmenu/CMainMenu.h @@ -9,7 +9,6 @@ */ #pragma once -#include "../widgets/Images.h" #include "../windows/CWindowObject.h" #include "../../lib/JsonNode.h" #include "../../lib/LoadProgress.h" @@ -24,6 +23,7 @@ class CTextInput; class CGStatusBar; class CTextBox; class CTabbedInt; +class CAnimImage; class CAnimation; class CButton; class CFilledTexture; @@ -191,7 +191,7 @@ public: CLoadingScreen(); ~CLoadingScreen(); - void showAll(Canvas & to) override; + void tick(uint32_t msPassed) override; }; extern std::shared_ptr CMM;