//----------------------------------------------------------------------------- // Purpose: Activate the game UI //----------------------------------------------------------------------------- void CGameUI::OnGameUIActivated() { bool bWasActive = m_bActivatedUI; m_bActivatedUI = true; // Lock the UI to a particular player if ( !bWasActive ) { SetGameUIActiveSplitScreenPlayerSlot( engine->GetActiveSplitScreenPlayerSlot() ); } // pause the server in case it is pausable engine->ClientCmd_Unrestricted( "setpause nomsg" ); SetSavedThisMenuSession( false ); UI_BASEMOD_PANEL_CLASS &ui = GetUiBaseModPanelClass(); bool bNeedActivation = true; if ( ui.IsVisible() ) { // Already visible, maybe don't need activation if ( !IsInLevel() && IsInBackgroundLevel() ) bNeedActivation = false; } if ( bNeedActivation ) { GetUiBaseModPanelClass().OnGameUIActivated(); } }
bool CGameUI2::IsInLoading() { return (engine->IsDrawingLoadingImage() || engine->GetLevelName() == nullptr) || (!IsInLevel() && !IsInBackgroundLevel()); }