Reimplemented hiding mouse during loading

master
krzys-h 2015-08-06 18:28:28 +02:00
parent dc9e2d2e8b
commit 7649731b49
4 changed files with 31 additions and 7 deletions

View File

@ -39,6 +39,7 @@ CSettings::CSettings()
m_movies = true;
m_niceReset = true;
m_himselfDamage = true;
m_systemMouse = false;
m_fontSize = 19.0f;
m_windowPos = Math::Point(0.15f, 0.17f);
@ -103,7 +104,7 @@ void CSettings::SaveSettings()
GetConfigFile().SetIntProperty("Setup", "MusicVolume", sound->GetMusicVolume());
GetConfigFile().SetIntProperty("Setup", "EditIndentMode", engine->GetEditIndentMode());
GetConfigFile().SetIntProperty("Setup", "EditIndentValue", engine->GetEditIndentValue());
GetConfigFile().SetIntProperty("Setup", "SystemMouse", app->GetMouseMode() == MOUSE_SYSTEM);
GetConfigFile().SetIntProperty("Setup", "SystemMouse", m_systemMouse);
GetConfigFile().SetIntProperty("Setup", "MipmapLevel", engine->GetTextureMipmapLevel());
GetConfigFile().SetIntProperty("Setup", "Anisotropy", engine->GetTextureAnisotropyLevel());
@ -267,7 +268,10 @@ void CSettings::LoadSettings()
engine->SetEditIndentValue(iValue);
if (GetConfigFile().GetIntProperty("Setup", "SystemMouse", iValue))
app->SetMouseMode(iValue ? MOUSE_SYSTEM : MOUSE_ENGINE);
{
m_systemMouse = iValue;
app->SetMouseMode(m_systemMouse ? MOUSE_SYSTEM : MOUSE_ENGINE);
}
if (GetConfigFile().GetIntProperty("Setup", "MipmapLevel", iValue))
@ -387,6 +391,15 @@ bool CSettings::GetHimselfDamage()
return m_himselfDamage;
}
void CSettings::SetSystemMouse(bool systemMouse)
{
m_systemMouse = systemMouse;
}
bool CSettings::GetSystemMouse()
{
return m_systemMouse;
}
void CSettings::SetFontSize(float size)
{

View File

@ -57,6 +57,9 @@ public:
void SetHimselfDamage(bool himselfDamage);
bool GetHimselfDamage();
void SetSystemMouse(bool systemMouse);
bool GetSystemMouse();
//! Managing the size of the default fonts
//@{
@ -93,6 +96,7 @@ protected:
bool m_movies;
bool m_niceReset;
bool m_himselfDamage;
bool m_systemMouse;
float m_fontSize;
Math::Point m_windowPos;

View File

@ -468,6 +468,15 @@ void CRobotMain::ChangePhase(Phase phase)
}
ClearInterface();
if (m_phase == PHASE_LOADING)
{
m_app->SetMouseMode(MOUSE_NONE);
}
else
{
m_app->SetMouseMode(m_settings->GetSystemMouse() ? MOUSE_SYSTEM : MOUSE_ENGINE);
}
Math::Point dim, pos;
// Creates and hide the command console.

View File

@ -181,10 +181,8 @@ bool CScreenSetupGame::EventProcess(const Event &event)
break;
case EVENT_INTERFACE_MOUSE:
if (m_app->GetMouseMode() == MOUSE_SYSTEM)
m_app->SetMouseMode(MOUSE_ENGINE);
else
m_app->SetMouseMode(MOUSE_SYSTEM);
m_settings->SetSystemMouse(!m_settings->GetSystemMouse());
m_app->SetMouseMode(m_settings->GetSystemMouse() ? MOUSE_SYSTEM : MOUSE_ENGINE);
ChangeSetupButtons();
UpdateSetupButtons();
@ -323,7 +321,7 @@ void CScreenSetupGame::UpdateSetupButtons()
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_MOUSE));
if ( pc != 0 )
{
pc->SetState(STATE_CHECK, m_app->GetMouseMode() == MOUSE_SYSTEM);
pc->SetState(STATE_CHECK, m_settings->GetSystemMouse());
}
pc = static_cast<CCheck*>(pw->SearchControl(EVENT_INTERFACE_EDITMODE));