diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/tf/vgui/tf_teammenu.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/tf/vgui/tf_teammenu.h')
| -rw-r--r-- | game/client/tf/vgui/tf_teammenu.h | 136 |
1 files changed, 136 insertions, 0 deletions
diff --git a/game/client/tf/vgui/tf_teammenu.h b/game/client/tf/vgui/tf_teammenu.h new file mode 100644 index 0000000..9b5fca0 --- /dev/null +++ b/game/client/tf/vgui/tf_teammenu.h @@ -0,0 +1,136 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +//============================================================================= + +#ifndef TF_TEAMMENU_H +#define TF_TEAMMENU_H +#ifdef _WIN32 +#pragma once +#endif + +#include "tf_controls.h" +#include "tf_imagepanel.h" +#include <teammenu.h> + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- +class CTFTeamButton : public CExButton +{ +private: + DECLARE_CLASS_SIMPLE( CTFTeamButton, CExButton ); + +public: + CTFTeamButton( vgui::Panel *parent, const char *panelName ); + + void ApplySettings( KeyValues *inResourceData ); + void ApplySchemeSettings( vgui::IScheme *pScheme ); + + void OnCursorExited(); + void OnCursorEntered(); + + void OnTick( void ); + + void SetDefaultAnimation( const char *pszName ); + +private: + bool IsTeamFull(); + void SendAnimation( const char *pszAnimation ); + void SetMouseEnteredState( bool state ); + +private: + char m_szModelPanel[64]; // the panel we'll send messages to + int m_iTeam; // the team we're associated with (if any) + + float m_flHoverTimeToWait; // length of time to wait before reporting a "hover" message (-1 = no hover) + float m_flHoverTime; // when should a "hover" message be sent? + bool m_bMouseEntered; // used to track when the mouse is over a button + bool m_bTeamDisabled; // used to keep track of whether our team is a valid team for selection +}; + +//----------------------------------------------------------------------------- +// Purpose: Displays the team menu +//----------------------------------------------------------------------------- +class CTFTeamMenu : public CTeamMenu, public CGameEventListener +{ +private: + DECLARE_CLASS_SIMPLE( CTFTeamMenu, CTeamMenu ); + +public: + CTFTeamMenu( IViewPort *pViewPort ); + ~CTFTeamMenu(); + + void Update(); + void ShowPanel( bool bShow ); + +#ifdef _X360 + CON_COMMAND_MEMBER_F( CTFTeamMenu, "join_team", Join_Team, "Send a jointeam command", 0 ); +#endif + + + bool IsBlueTeamDisabled(){ return m_bBlueDisabled; } + bool IsRedTeamDisabled(){ return m_bRedDisabled; } + + // IGameEventListener interface: + virtual void FireGameEvent( IGameEvent *event ); + +protected: + virtual void ApplySchemeSettings(vgui::IScheme *pScheme); + virtual void OnKeyCodePressed( vgui::KeyCode code ); + + // command callbacks + virtual void OnCommand( const char *command ); + virtual void OnClose(); + + virtual void LoadMapPage( const char *mapName ); + + virtual void OnTick( void ); + + virtual void OnThink() OVERRIDE; + +private: + + void SetHighlanderTeamsFullPanels( bool bTeamsFull, bool bForce = false ); + void ActivateSelectIconHint( int focus_group_number ); + +private: + + CTFTeamButton *m_pBlueTeamButton; + CTFTeamButton *m_pRedTeamButton; + CTFTeamButton *m_pAutoTeamButton; + CTFTeamButton *m_pSpecTeamButton; + CExLabel *m_pSpecLabel; + +#ifdef _X360 + CTFFooter *m_pFooter; +#else + CExButton *m_pCancelButton; + + CExLabel *m_pHighlanderLabel; + CExLabel *m_pHighlanderLabelShadow; + CExLabel *m_pTeamsFullLabel; + CExLabel *m_pTeamsFullLabelShadow; + CTFImagePanel *m_pTeamsFullArrow; + + CSCHintIcon *m_pCancelHintIcon; + CSCHintIcon *m_pJoinBluHintIcon; + CSCHintIcon *m_pJoinRedHintIcon; + CSCHintIcon *m_pJoinAutoHintIcon; + CSCHintIcon *m_pJoinSpectatorsHintIcon; + +#endif + + bool m_bRedDisabled; + bool m_bBlueDisabled; + + +private: + enum { NUM_TEAMS = 3 }; + + ButtonCode_t m_iTeamMenuKey; +}; + +#endif // TF_TEAMMENU_H |