@@ -447,7 +447,7 @@ void CMainMenu::Update()
447
447
448
448
// Get the game interface and the system state
449
449
CGame* pGame = CCore::GetSingleton ().GetGame ();
450
- eSystemState SystemState = pGame->GetSystemState ();
450
+ SystemState systemState = pGame->GetSystemState ();
451
451
452
452
m_Credits.Update ();
453
453
m_Settings.Update ();
@@ -650,7 +650,7 @@ void CMainMenu::Update()
650
650
}
651
651
652
652
// Force the mainmenu on if we're at GTA's mainmenu or not ingame
653
- if ((SystemState == 7 || SystemState == 9 ) && !m_bIsIngame)
653
+ if ((systemState == SystemState::GS_FRONTEND || systemState == SystemState::GS_PLAYING_GAME ) && !m_bIsIngame)
654
654
{
655
655
if (!m_bStarted)
656
656
{
@@ -671,11 +671,11 @@ void CMainMenu::Update()
671
671
}
672
672
673
673
// If we're visible
674
- if (m_bIsVisible && SystemState != 8 )
674
+ if (m_bIsVisible && systemState != SystemState::GS_INIT_PLAYING_GAME )
675
675
{
676
676
// If we're at the game's mainmenu, or ingame when m_bIsIngame is true show the background
677
- if (SystemState == 7 || // GS_FRONTEND
678
- SystemState == 9 && !m_bIsIngame) // GS_PLAYING_GAME
677
+ if (systemState == SystemState::GS_FRONTEND ||
678
+ systemState == SystemState::GS_PLAYING_GAME && !m_bIsIngame)
679
679
{
680
680
if (m_ucFade == FADE_INVISIBLE)
681
681
Show (false );
@@ -842,6 +842,14 @@ bool CMainMenu::OnMenuClick(CGUIMouseEventArgs Args)
842
842
case MENU_ITEM_MAP_EDITOR:
843
843
AskUserIfHeWantsToDisconnect (m_pHoveredItem->menuType );
844
844
return true ;
845
+ case MENU_ITEM_DISCONNECT:
846
+ if (g_pCore->GetCVars ()->GetValue (" ask_before_disconnect" , true ))
847
+ {
848
+ AskUserIfHeWantsToDisconnect (m_pHoveredItem->menuType );
849
+ return true ;
850
+ }
851
+
852
+ break ;
845
853
default :
846
854
break ;
847
855
}
@@ -863,7 +871,7 @@ bool CMainMenu::OnMenuClick(CGUIMouseEventArgs Args)
863
871
switch (m_pHoveredItem->menuType )
864
872
{
865
873
case MENU_ITEM_DISCONNECT:
866
- OnDisconnectButtonClick (pElement );
874
+ OnDisconnectButtonClick ();
867
875
break ;
868
876
case MENU_ITEM_QUICK_CONNECT:
869
877
OnQuickConnectButtonClick (pElement, Args.button == LeftButton);
@@ -948,7 +956,7 @@ void CMainMenu::HideServerInfo()
948
956
m_ServerInfo.Hide ();
949
957
}
950
958
951
- bool CMainMenu::OnDisconnectButtonClick (CGUIElement* pElement )
959
+ bool CMainMenu::OnDisconnectButtonClick ()
952
960
{
953
961
// Return if we haven't faded in yet
954
962
if (m_ucFade != FADE_VISIBLE)
@@ -1251,6 +1259,9 @@ void CMainMenu::WantsToDisconnectCallBack(void* pData, uint uiButton)
1251
1259
case MENU_ITEM_MAP_EDITOR:
1252
1260
OnEditorButtonClick ();
1253
1261
break ;
1262
+ case MENU_ITEM_DISCONNECT:
1263
+ OnDisconnectButtonClick ();
1264
+ break ;
1254
1265
default :
1255
1266
break ;
1256
1267
}
0 commit comments