Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Client/core/CGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Expand Down
5 changes: 5 additions & 0 deletions Client/core/CMessageLoopHook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
7 changes: 6 additions & 1 deletion Client/gui/CGUI_Impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions Client/gui/CGUI_Impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down
6 changes: 5 additions & 1 deletion Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions Client/sdk/gui/CGUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down