From f56bb35301836e56582a575a75864392a0177875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8rgen=20P=2E=20Tjern=C3=B8?= Date: Mon, 2 Dec 2013 19:31:46 -0800 Subject: Fix line endings. WHAMMY. --- mp/src/game/client/game_controls/classmenu.cpp | 632 ++++++++++++------------- 1 file changed, 316 insertions(+), 316 deletions(-) (limited to 'mp/src/game/client/game_controls/classmenu.cpp') diff --git a/mp/src/game/client/game_controls/classmenu.cpp b/mp/src/game/client/game_controls/classmenu.cpp index 64516f02..b71b75fa 100644 --- a/mp/src/game/client/game_controls/classmenu.cpp +++ b/mp/src/game/client/game_controls/classmenu.cpp @@ -1,316 +1,316 @@ -//========= Copyright Valve Corporation, All rights reserved. ============// -// -// Purpose: -// -// $NoKeywords: $ -//=============================================================================// - - -#include "cbase.h" -#include - -#include - -#include "classmenu.h" - -#include -#include -#include -#include -#include -#include - -#include -#include -#include - -#include "cdll_util.h" -#include "IGameUIFuncs.h" // for key bindings -#ifndef _XBOX -extern IGameUIFuncs *gameuifuncs; // for key binding details -#endif -#include - -#include // MAX_PATH define - -// memdbgon must be the last include file in a .cpp file!!! -#include "tier0/memdbgon.h" - -using namespace vgui; - -#ifdef TF_CLIENT_DLL -#define HUD_CLASSAUTOKILL_FLAGS ( FCVAR_CLIENTDLL | FCVAR_ARCHIVE | FCVAR_USERINFO ) -#else -#define HUD_CLASSAUTOKILL_FLAGS ( FCVAR_CLIENTDLL | FCVAR_ARCHIVE ) -#endif // !TF_CLIENT_DLL - -ConVar hud_classautokill( "hud_classautokill", "1", HUD_CLASSAUTOKILL_FLAGS, "Automatically kill player after choosing a new playerclass." ); - -//----------------------------------------------------------------------------- -// Purpose: Constructor -//----------------------------------------------------------------------------- -CClassMenu::CClassMenu(IViewPort *pViewPort) : Frame(NULL, PANEL_CLASS) -{ - m_pViewPort = pViewPort; - m_iScoreBoardKey = BUTTON_CODE_INVALID; // this is looked up in Activate() - m_iTeam = 0; - - // initialize dialog - SetTitle("", true); - - // load the new scheme early!! - SetScheme("ClientScheme"); - SetMoveable(false); - SetSizeable(false); - - // hide the system buttons - SetTitleBarVisible( false ); - SetProportional(true); - - // info window about this class - m_pPanel = new EditablePanel( this, "ClassInfo" ); - - LoadControlSettings( "Resource/UI/ClassMenu.res" ); -} - -//----------------------------------------------------------------------------- -// Purpose: Constructor -//----------------------------------------------------------------------------- -CClassMenu::CClassMenu(IViewPort *pViewPort, const char *panelName) : Frame(NULL, panelName) -{ - m_pViewPort = pViewPort; - m_iScoreBoardKey = BUTTON_CODE_INVALID; // this is looked up in Activate() - m_iTeam = 0; - - // initialize dialog - SetTitle("", true); - - // load the new scheme early!! - SetScheme("ClientScheme"); - SetMoveable(false); - SetSizeable(false); - - // hide the system buttons - SetTitleBarVisible( false ); - SetProportional(true); - - // info window about this class - m_pPanel = new EditablePanel( this, "ClassInfo" ); - - // Inheriting classes are responsible for calling LoadControlSettings()! -} - -//----------------------------------------------------------------------------- -// Purpose: Destructor -//----------------------------------------------------------------------------- -CClassMenu::~CClassMenu() -{ -} - -MouseOverPanelButton* CClassMenu::CreateNewMouseOverPanelButton(EditablePanel *panel) -{ - return new MouseOverPanelButton(this, "MouseOverPanelButton", panel); -} - - -Panel *CClassMenu::CreateControlByName(const char *controlName) -{ - if( !Q_stricmp( "MouseOverPanelButton", controlName ) ) - { - MouseOverPanelButton *newButton = CreateNewMouseOverPanelButton( m_pPanel ); - - m_mouseoverButtons.AddToTail( newButton ); - return newButton; - } - else - { - return BaseClass::CreateControlByName( controlName ); - } -} - -//----------------------------------------------------------------------------- -// Purpose: -//----------------------------------------------------------------------------- -void CClassMenu::Reset() -{ - for ( int i = 0 ; i < GetChildCount() ; ++i ) - { - // Hide the subpanel for the MouseOverPanelButtons - MouseOverPanelButton *pPanel = dynamic_cast( GetChild( i ) ); - - if ( pPanel ) - { - pPanel->HidePage(); - } - } - - // Turn the first button back on again (so we have a default description shown) - Assert( m_mouseoverButtons.Count() ); - for ( int i=0; iShowPage(); // Show the first page - } - else - { - m_mouseoverButtons[i]->HidePage(); // Hide the rest - } - } -} - -//----------------------------------------------------------------------------- -// Purpose: Called when the user picks a class -//----------------------------------------------------------------------------- -void CClassMenu::OnCommand( const char *command ) -{ - if ( Q_stricmp( command, "vguicancel" ) ) - { - engine->ClientCmd( const_cast( command ) ); - -#if !defined( CSTRIKE_DLL ) && !defined( TF_CLIENT_DLL ) - // They entered a command to change their class, kill them so they spawn with - // the new class right away - if ( hud_classautokill.GetBool() ) - { - engine->ClientCmd( "kill" ); - } -#endif // !CSTRIKE_DLL && !TF_CLIENT_DLL - } - - Close(); - - gViewPortInterface->ShowBackGround( false ); - - BaseClass::OnCommand( command ); -} - -//----------------------------------------------------------------------------- -// Purpose: shows the class menu -//----------------------------------------------------------------------------- -void CClassMenu::ShowPanel(bool bShow) -{ - if ( bShow ) - { - Activate(); - SetMouseInputEnabled( true ); - - // load a default class page - for ( int i=0; iShowPage(); // Show the first page - } - else - { - m_mouseoverButtons[i]->HidePage(); // Hide the rest - } - } - - if ( m_iScoreBoardKey == BUTTON_CODE_INVALID ) - { - m_iScoreBoardKey = gameuifuncs->GetButtonCodeForBind( "showscores" ); - } - } - else - { - SetVisible( false ); - SetMouseInputEnabled( false ); - } - - m_pViewPort->ShowBackGround( bShow ); -} - - -void CClassMenu::SetData(KeyValues *data) -{ - m_iTeam = data->GetInt( "team" ); -} - -//----------------------------------------------------------------------------- -// Purpose: Sets the text of a control by name -//----------------------------------------------------------------------------- -void CClassMenu::SetLabelText(const char *textEntryName, const char *text) -{ - Label *entry = dynamic_cast