Fixed version display being invisible during loading

master
krzys-h 2015-08-09 22:52:49 +02:00
parent 3358091b8c
commit 115e18cc85
9 changed files with 34 additions and 25 deletions

View File

@ -20,8 +20,6 @@
#include "ui/mainui.h"
#include "common/config.h"
#include "app/app.h"
#include "common/event.h"
@ -35,6 +33,8 @@
#include "sound/sound.h"
#include "ui/maindialog.h"
#include "ui/screen/screen.h"
#include "ui/screen/screen_apperance.h"
#include "ui/screen/screen_io_read.h"
@ -53,7 +53,6 @@
#include "ui/controls/interface.h"
#include "ui/controls/label.h"
#include "ui/maindialog.h"
#include "ui/controls/window.h"
namespace Ui
@ -224,26 +223,6 @@ void CMainUserInterface::ChangePhase(Phase phase)
}
}
if ( IsMainMenuPhase(m_phase) &&
m_phase != PHASE_WELCOME1 &&
m_phase != PHASE_WELCOME2 &&
m_phase != PHASE_WELCOME3 )
{
CWindow* pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if (pw != nullptr)
{
Math::Point pos, ddim;
pos.x = 540.0f/640.0f;
pos.y = 9.0f/480.0f;
ddim.x = 90.0f/640.0f;
ddim.y = 10.0f/480.0f;
CLabel* pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL1, COLOBOT_VERSION_DISPLAY);
pl->SetFontType(Gfx::FONT_COURIER);
pl->SetFontSize(9.0f);
}
}
m_engine->LoadAllTextures();
}

View File

@ -19,12 +19,18 @@
#include "ui/screen/screen.h"
#include "common/config.h"
#include "app/app.h"
#include "graphics/engine/engine.h"
#include "object/robotmain.h"
#include "ui/controls/interface.h"
#include "ui/controls/label.h"
#include "ui/controls/window.h"
namespace Ui
{
@ -53,4 +59,21 @@ void CScreen::SetBackground(const std::string& filename, bool scaled)
m_engine->SetBackForce(true);
}
void CScreen::CreateVersionDisplay()
{
CWindow* pw = static_cast<CWindow*>(m_interface->SearchControl(EVENT_WINDOW5));
if (pw != nullptr)
{
Math::Point pos, ddim;
pos.x = 540.0f/640.0f;
pos.y = 9.0f/480.0f;
ddim.x = 90.0f/640.0f;
ddim.y = 10.0f/480.0f;
CLabel* pl = pw->CreateLabel(pos, ddim, 0, EVENT_LABEL1, COLOBOT_VERSION_DISPLAY);
pl->SetFontType(Gfx::FONT_COURIER);
pl->SetFontSize(9.0f);
}
}
} // namespace Ui

View File

@ -49,6 +49,7 @@ public:
virtual bool EventProcess(const Event &event) = 0;
protected:
void CreateVersionDisplay();
void SetBackground(const std::string& filename, bool scaled = false);
protected:

View File

@ -114,6 +114,7 @@ void CScreenIORead::CreateInterface()
if ( !m_inSimulation )
{
SetBackground("textures/interface/interface.png");
CreateVersionDisplay();
}
}

View File

@ -235,6 +235,7 @@ void CScreenLevelList::CreateInterface()
pb->SetState(STATE_SHADOW);
SetBackground("textures/interface/interface.png");
CreateVersionDisplay();
if (m_category == LevelCategory::CustomLevels)
{

View File

@ -93,6 +93,7 @@ void CScreenLoading::CreateInterface()
pw->CreateGauge(pos, ddim, 0, EVENT_LOADING);
SetBackground("textures/interface/interface.png");
CreateVersionDisplay();
m_engine->SetDrawWorld(false);
m_app->Render();

View File

@ -160,6 +160,7 @@ void CScreenMainMenu::CreateInterface()
pl->SetFontSize(Gfx::FONT_SIZE_SMALL);
SetBackground("textures/interface/interface.png");
CreateVersionDisplay();
}
bool CScreenMainMenu::EventProcess(const Event &event)

View File

@ -140,11 +140,12 @@ void CScreenPlayerSelect::CreateInterface()
pb = pw->CreateButton(pos, ddim, -1, EVENT_INTERFACE_NCANCEL);
pb->SetState(STATE_SHADOW);
SetBackground("textures/interface/interface.png");
CreateVersionDisplay();
ReadNameList();
UpdateNameList();
UpdateNameControl();
SetBackground("textures/interface/interface.png");
}
bool CScreenPlayerSelect::EventProcess(const Event &event)

View File

@ -139,6 +139,7 @@ void CScreenSetup::CreateInterface()
if ( !m_simulationSetup )
{
SetBackground("textures/interface/interface.png");
CreateVersionDisplay();
}
}