[colobot] 43/377: Fix #670

Didier Raboud odyx at moszumanska.debian.org
Wed Mar 30 13:33:56 UTC 2016


This is an automated email from the git hooks/post-receive script.

odyx pushed a commit to branch debian/master
in repository colobot.

commit ce480c1720a542fd9f2a0d77d11105791fd550d8
Author: piotrwalkusz1 <piotrwalkusz1 at wp.pl>
Date:   Sun Nov 8 19:03:35 2015 +0100

    Fix #670
---
 src/level/robotmain.cpp | 63 ++++++++++++++++++++++++++++---------------------
 src/ui/displayinfo.cpp  |  4 ++--
 src/ui/maindialog.cpp   |  4 ++--
 src/ui/studio.cpp       |  4 ++--
 4 files changed, 42 insertions(+), 33 deletions(-)

diff --git a/src/level/robotmain.cpp b/src/level/robotmain.cpp
index 6290075..a68f544 100644
--- a/src/level/robotmain.cpp
+++ b/src/level/robotmain.cpp
@@ -426,6 +426,12 @@ void CRobotMain::ChangePhase(Phase phase)
     }
 
     m_phase = phase;
+    
+    if (m_phase != PHASE_SIMUL)
+    {
+		Ui::CWindow* pw = static_cast<Ui::CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
+		if ( pw != nullptr )  pw->ClearState(Ui::STATE_VISIBLE | Ui::STATE_ENABLE);
+	}
 
     if (resetWorld)
     {
@@ -5915,33 +5921,36 @@ void CRobotMain::StartDetectEffect(COldObject* object, CObject* target)
 
 void CRobotMain::CreateCodeBattleInterface()
 {
-    Math::Point pos, ddim;
-
-    ddim.x = 100.0f/640.0f;
-    ddim.y = 100.0f/480.0f;
-    pos.x = 540.0f/640.0f;
-    pos.y = 100.0f/480.0f;
-    Ui::CWindow* pw = m_interface->CreateWindows(pos, ddim, 3, EVENT_WINDOW6);
-
-    ddim.x = 100.0f/640.0f;
-    ddim.y = 16.0f/480.0f;
-    pos.x = 540.0f/640.0f;
-    pos.y = 178.0f/480.0f;
-    pw->CreateLabel(pos, ddim, 0, EVENT_LABEL0, "Code battle");
-
-    float titleBarSize = (11.0f/64.0f); // this is from the texture
-    ddim.x = 80.0f/640.0f;
-    ddim.y = ((1-titleBarSize)*100.0f-20.0f)/480.0f;
-    pos.x = 550.0f/640.0f;
-    pos.y = 110.0f/480.0f;
-    if (!m_codeBattleStarted)
-    {
-        pw->CreateButton(pos, ddim, 21, EVENT_CODE_BATTLE_START);
-    }
-    else
-    {
-        pw->CreateButton(pos, ddim, 13, EVENT_CODE_BATTLE_SPECTATOR);
-    }
+	if(m_phase == PHASE_SIMUL)
+	{		
+		Math::Point pos, ddim;
+
+		ddim.x = 100.0f/640.0f;
+		ddim.y = 100.0f/480.0f;
+		pos.x = 540.0f/640.0f;
+		pos.y = 100.0f/480.0f;
+		Ui::CWindow* pw = m_interface->CreateWindows(pos, ddim, 3, EVENT_WINDOW6);
+
+		ddim.x = 100.0f/640.0f;
+		ddim.y = 16.0f/480.0f;
+		pos.x = 540.0f/640.0f;
+		pos.y = 178.0f/480.0f;
+		pw->CreateLabel(pos, ddim, 0, EVENT_LABEL0, "Code battle");
+
+		float titleBarSize = (11.0f/64.0f); // this is from the texture
+		ddim.x = 80.0f/640.0f;
+		ddim.y = ((1-titleBarSize)*100.0f-20.0f)/480.0f;
+		pos.x = 550.0f/640.0f;
+		pos.y = 110.0f/480.0f;
+		if (!m_codeBattleStarted)
+		{
+			pw->CreateButton(pos, ddim, 21, EVENT_CODE_BATTLE_START);
+		}
+		else
+		{
+			pw->CreateButton(pos, ddim, 13, EVENT_CODE_BATTLE_SPECTATOR);
+		}
+	}
 }
 
 void CRobotMain::DestroyCodeBattleInterface()
diff --git a/src/ui/displayinfo.cpp b/src/ui/displayinfo.cpp
index 6e28d74..04fec5c 100644
--- a/src/ui/displayinfo.cpp
+++ b/src/ui/displayinfo.cpp
@@ -368,7 +368,7 @@ void CDisplayInfo::StartDisplayInfo(std::string filename, int index, bool bSoluc
     m_camera->SetType(Gfx::CAM_TYPE_INFO);
 
     pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
-    if (pw != nullptr) pw->ClearState(STATE_VISIBLE);
+    if (pw != nullptr) pw->ClearState(STATE_VISIBLE | STATE_ENABLE);
 
     pos = m_infoActualPos = m_infoFinalPos;
     dim = m_infoActualDim = m_infoFinalDim;
@@ -830,7 +830,7 @@ void CDisplayInfo::StopDisplayInfo()
         m_main->SetEditLock(false, false);
 
         pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
-        if (pw != nullptr) pw->SetState(STATE_VISIBLE);
+        if (pw != nullptr) pw->SetState(STATE_VISIBLE | STATE_ENABLE);
     }
     m_pause->DeactivatePause(m_satcomPause);
     m_satcomPause = nullptr;
diff --git a/src/ui/maindialog.cpp b/src/ui/maindialog.cpp
index 662e0a2..f41fcdf 100644
--- a/src/ui/maindialog.cpp
+++ b/src/ui/maindialog.cpp
@@ -371,7 +371,7 @@ void CMainDialog::StartDialog(Math::Point dim, bool fireParticles)
     if ( pw != nullptr )  pw->ClearState(STATE_ENABLE);
 
     pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
-    if ( pw != nullptr )  pw->ClearState(STATE_VISIBLE);
+    if ( pw != nullptr )  pw->ClearState(STATE_VISIBLE | STATE_ENABLE);
 
     pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW7));
     if ( pw != nullptr )  pw->ClearState(STATE_ENABLE);
@@ -526,7 +526,7 @@ void CMainDialog::StopDialog()
     if ( pw != nullptr )  pw->SetState(STATE_ENABLE);
 
     pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
-    if ( pw != nullptr )  pw->SetState(STATE_VISIBLE);
+    if ( pw != nullptr )  pw->SetState(STATE_VISIBLE | STATE_ENABLE);
 
     pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW7));
     if ( pw != nullptr )  pw->SetState(STATE_ENABLE);
diff --git a/src/ui/studio.cpp b/src/ui/studio.cpp
index 033e57e..614a288 100644
--- a/src/ui/studio.cpp
+++ b/src/ui/studio.cpp
@@ -585,7 +585,7 @@ void CStudio::StartEditScript(CScript *script, std::string name, Program* progra
     m_script->SetStepMode(!m_bRealTime);
 
     pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
-    if (pw != nullptr) pw->ClearState(STATE_VISIBLE);
+    if (pw != nullptr) pw->ClearState(STATE_VISIBLE | STATE_ENABLE);
 
     pos = m_editFinalPos = m_editActualPos = m_settings->GetWindowPos();
     dim = m_editFinalDim = m_editActualDim = m_settings->GetWindowDim();
@@ -911,7 +911,7 @@ bool CStudio::StopEditScript(bool bCancel)
     m_interface->DeleteControl(EVENT_WINDOW3);
 
     pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW6));
-    if (pw != nullptr) pw->SetState(STATE_VISIBLE);
+    if (pw != nullptr) pw->SetState(STATE_VISIBLE | STATE_ENABLE);
 
     m_pause->DeactivatePause(m_editorPause);
     m_editorPause = nullptr;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git



More information about the Pkg-games-commits mailing list