From 02417363e4baff47c6e4ed7226280979b5dfe288 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Thu, 6 Aug 2015 14:03:07 +0200 Subject: [PATCH] Fixed version text disappearing during loading --- src/object/robotmain.cpp | 6 ++++++ src/object/robotmain.h | 1 + src/ui/mainui.cpp | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index 0d61d34b..85386a23 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -376,6 +376,12 @@ bool IsPhaseWithWorld(Phase phase) return false; } +bool IsMainMenuPhase(Phase phase) +{ + if (phase == PHASE_LOADING) return true; + return !IsPhaseWithWorld(phase); +} + //! Changes phase void CRobotMain::ChangePhase(Phase phase) { diff --git a/src/object/robotmain.h b/src/object/robotmain.h index e5ed967e..de432438 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -71,6 +71,7 @@ enum Phase }; bool IsInSimulationConfigPhase(Phase phase); bool IsPhaseWithWorld(Phase phase); +bool IsMainMenuPhase(Phase phase); class CController; diff --git a/src/ui/mainui.cpp b/src/ui/mainui.cpp index 81cad765..5ba65a18 100644 --- a/src/ui/mainui.cpp +++ b/src/ui/mainui.cpp @@ -200,7 +200,7 @@ void CMainUserInterface::ChangePhase(Phase phase) m_currentScreen->CreateInterface(); } - if ( !IsPhaseWithWorld(m_phase) ) + if ( IsMainMenuPhase(m_phase) ) { if (!m_sound->IsPlayingMusic() && m_sound->IsCachedMusic("Intro1.ogg")) { @@ -208,7 +208,7 @@ void CMainUserInterface::ChangePhase(Phase phase) } } - if ( !IsPhaseWithWorld(m_phase) ) + if ( IsMainMenuPhase(m_phase) ) { CWindow* pw = static_cast(m_interface->SearchControl(EVENT_WINDOW5)); if (pw != nullptr) @@ -243,7 +243,7 @@ bool CMainUserInterface::EventProcess(const Event &event) if ( event.type == EVENT_FRAME ) { - if ( !IsPhaseWithWorld(m_phase) ) + if ( IsMainMenuPhase(m_phase) ) { if (!m_sound->IsPlayingMusic() && m_sound->IsCachedMusic("Intro2.ogg")) {