File tree Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Expand file tree Collapse file tree 3 files changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -430,9 +430,7 @@ void CLocalGUI::SetMainMenuVisible(bool bVisible)
430430 pGUI->SelectInputHandlers (INPUT_MOD);
431431 }
432432
433- if (bVisible)
434- pGUI->SetCursorAlpha (1 .0f );
435- else
433+ if (!bVisible)
436434 pGUI->SetCursorAlpha (pGUI->GetCurrentServerCursorAlpha ());
437435 }
438436}
Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ CMainMenu::CMainMenu(CGUI* pManager)
7676 m_bStarted = false ;
7777 m_fFader = 0 ;
7878 m_ucFade = FADE_INVISIBLE;
79+ m_bCursorAlphaReset = false ;
7980
8081 // Adjust window size to resolution
8182 CVector2D ScreenSize = m_pManager->GetResolution ();
@@ -587,6 +588,17 @@ void CMainMenu::Update()
587588 if (m_fFader > 0 .0f )
588589 {
589590 m_bIsVisible = true ; // Make cursor appear faster
591+
592+ if (!m_bCursorAlphaReset)
593+ {
594+ CGUI* pGUI = g_pCore->GetGUI ();
595+
596+ if (pGUI)
597+ {
598+ pGUI->SetCursorAlpha (1 .0f );
599+ m_bCursorAlphaReset = true ;
600+ }
601+ }
590602 }
591603
592604 // If the fade is complete
@@ -595,6 +607,7 @@ void CMainMenu::Update()
595607 m_ucFade = FADE_VISIBLE;
596608 m_bIsVisible = true ;
597609 m_bIsFullyVisible = true ;
610+
598611 }
599612 }
600613 // Fade out
@@ -608,7 +621,11 @@ void CMainMenu::Update()
608621 m_pBackground->SetAlpha (Clamp (0 .f , m_fFader, CORE_MTA_BG_MAX_ALPHA));
609622
610623 if (m_fFader < 1 .0f )
624+ {
611625 m_bIsVisible = false ; // Make cursor disappear faster
626+ m_bCursorAlphaReset = false ;
627+ }
628+
612629
613630 // If the fade is complete
614631 if (m_fFader <= 0 )
Original file line number Diff line number Diff line change @@ -150,6 +150,7 @@ class CMainMenu
150150 // Fade variables
151151 unsigned char m_ucFade;
152152 float m_fFader;
153+ bool m_bCursorAlphaReset;
153154
154155 // Animation variables
155156 unsigned long ulPreviousTick;
You can’t perform that action at this time.
0 commit comments