diff --git a/Client/core/CGUI.cpp b/Client/core/CGUI.cpp index 7ffa2667c07..bed2acf10f2 100644 --- a/Client/core/CGUI.cpp +++ b/Client/core/CGUI.cpp @@ -383,7 +383,7 @@ void CLocalGUI::SetConsoleVisible(bool bVisible) CGUI* pGUI = CCore::GetSingleton().GetGUI(); if (bVisible) pGUI->SetCursorAlpha(1.0f); - else + else if (!g_pCore->IsMenuVisible()) pGUI->SetCursorAlpha(pGUI->GetCurrentServerCursorAlpha()); } } diff --git a/Client/core/CMessageLoopHook.cpp b/Client/core/CMessageLoopHook.cpp index 8afd0d615ba..5424e23435c 100644 --- a/Client/core/CMessageLoopHook.cpp +++ b/Client/core/CMessageLoopHook.cpp @@ -293,6 +293,11 @@ LRESULT CALLBACK CMessageLoopHook::ProcessMessage(HWND hwnd, UINT uMsg, WPARAM w { ms_bIgnoreNextEscapeCharacter = true; pConsole->SetVisible(false); + + CGUI* pGUI = g_pCore->GetGUI(); + if (!g_pCore->IsMenuVisible()) + pGUI->SetCursorAlpha(pGUI->GetCurrentServerCursorAlpha()); + return true; } diff --git a/Client/gui/CGUI_Impl.cpp b/Client/gui/CGUI_Impl.cpp index 55257faf41e..67d625ed5ec 100644 --- a/Client/gui/CGUI_Impl.cpp +++ b/Client/gui/CGUI_Impl.cpp @@ -499,7 +499,12 @@ void CGUI_Impl::SetCursorAlpha(float fAlpha, bool bOnlyCurrentServer) CEGUI::MouseCursor::getSingleton().setAlpha(fAlpha); if (bOnlyCurrentServer) - m_fCurrentServerCursorAlpha = fAlpha; + SetCurrentServerCursorAlpha(fAlpha); +} + +void CGUI_Impl::SetCurrentServerCursorAlpha(float fAlpha) +{ + m_fCurrentServerCursorAlpha = fAlpha; } float CGUI_Impl::GetCurrentServerCursorAlpha() diff --git a/Client/gui/CGUI_Impl.h b/Client/gui/CGUI_Impl.h index 9326bb2f858..30153808665 100644 --- a/Client/gui/CGUI_Impl.h +++ b/Client/gui/CGUI_Impl.h @@ -143,6 +143,7 @@ class CGUI_Impl : public CGUI, public CGUITabList void SetCursorEnabled(bool bEnabled); bool IsCursorEnabled(); void SetCursorAlpha(float fAlpha, bool bOnlyCurrentServer = false); + void SetCurrentServerCursorAlpha(float fAlpha); float GetCurrentServerCursorAlpha(); eCursorType GetCursorType(); diff --git a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp index 39cd322a1dc..9d73a1bc523 100644 --- a/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp +++ b/Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp @@ -5030,7 +5030,11 @@ bool CStaticFunctionDefinitions::SetCursorAlpha(float fAlpha) { if (fAlpha >= 0.0f && fAlpha <= 1.0f) { - m_pGUI->SetCursorAlpha(fAlpha, true); + if (!m_pCore->IsMenuVisible() && !m_pCore->GetConsole()->IsVisible()) + m_pGUI->SetCursorAlpha(fAlpha, true); + else + m_pGUI->SetCurrentServerCursorAlpha(fAlpha); + return true; } return false; diff --git a/Client/sdk/gui/CGUI.h b/Client/sdk/gui/CGUI.h index 6c338c7082d..d6e27bd3da5 100644 --- a/Client/sdk/gui/CGUI.h +++ b/Client/sdk/gui/CGUI.h @@ -126,6 +126,7 @@ class CGUI virtual void SetCursorEnabled(bool bEnabled) = 0; virtual bool IsCursorEnabled() = 0; virtual void SetCursorAlpha(float fAlpha, bool bOnlyCurrentServer = false) = 0; + virtual void SetCurrentServerCursorAlpha(float fAlpha) = 0; virtual float GetCurrentServerCursorAlpha() = 0; virtual eCursorType GetCursorType() = 0;