From e1223ff881b9fc5d4c75187c86df7b996f44a3c2 Mon Sep 17 00:00:00 2001 From: krzys-h Date: Tue, 14 Jul 2015 21:32:08 +0200 Subject: [PATCH] Fixed shortcuts behavior It was kinda broken after implementing code battles Also, fixed overlap of shortcuts bar with cheat console --- src/object/robotmain.cpp | 8 ++++---- src/ui/mainshort.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index 47d9a915..3589252e 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -510,8 +510,8 @@ void CRobotMain::ChangePhase(Phase phase) // Creates and hide the command console. dim.x = 200.0f/640.0f; dim.y = 18.0f/480.0f; - pos.x = 50.0f/640.0f; - pos.y = 452.0f/480.0f; + pos.x = 20.0f/640.0f; + pos.y = 100.0f/480.0f; Ui::CEdit* pe = static_cast(m_interface->CreateEdit(pos, dim, 0, EVENT_CMD)); if (pe == nullptr) return; pe->ClearState(Ui::STATE_VISIBLE); @@ -704,7 +704,7 @@ bool CRobotMain::ProcessEvent(Event &event) { if (m_phase != PHASE_NAME && !m_movie->IsExist() && - !m_movieLock && !m_editLock && !m_engine->GetPause()) + !m_movieLock && !m_editLock) { Ui::CEdit* pe = static_cast(m_interface->SearchControl(EVENT_CMD)); if (pe == nullptr) return false; @@ -1197,8 +1197,8 @@ void CRobotMain::ExecuteCmd(char *cmd) if (m_freePhoto) { m_camera->SetType(Gfx::CAM_TYPE_FREE); - ChangePause(PAUSE_PHOTO); DeselectAll(); // removes the control buttons + ChangePause(PAUSE_PHOTO); m_map->ShowMap(false); m_displayText->HideText(true); } diff --git a/src/ui/mainshort.cpp b/src/ui/mainshort.cpp index 9f59b0e7..b7fed7c8 100644 --- a/src/ui/mainshort.cpp +++ b/src/ui/mainshort.cpp @@ -128,9 +128,13 @@ bool CMainShort::CreateShortcuts() m_engine->GetPause()) ) // hangs during edition? { m_interface->CreateShortcut(pos, dim, 6, EVENT_OBJECT_EDITLOCK); - if(!m_engine->GetPause()) + if(!m_engine->GetPause() || CPauseManager::GetInstancePointer()->GetPauseType() == PAUSE_DIALOG) return true; } + if (m_main->GetFreePhoto() && m_main->GetSelect() == nullptr) + { + return true; + } rank = 0; @@ -359,4 +363,3 @@ void CMainShort::SetHighlight(CObject* pObj) } } -