//----------------------------------------------------------------------------- // 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(); } }
//----------------------------------------------------------------------------- // Purpose: returns true if we're in a multiplayer game //----------------------------------------------------------------------------- bool CGameUI::IsInMultiplayer() { return (IsInLevel() && engine->GetMaxClients() > 1); }
bool CGameUI2::IsInLoading() { return (engine->IsDrawingLoadingImage() || engine->GetLevelName() == nullptr) || (!IsInLevel() && !IsInBackgroundLevel()); }