Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TF_PLAYERPANEL_H
  7. #define TF_PLAYERPANEL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "tf_spectatorgui.h"
  12. //-----------------------------------------------------------------------------
  13. // Purpose: Custom health panel used to show spectator target's health in Tournament HUD
  14. //-----------------------------------------------------------------------------
  15. class CTFPlayerPanelGUIHealth : public CTFSpectatorGUIHealth
  16. {
  17. public:
  18. CTFPlayerPanelGUIHealth( Panel *parent, const char *name ) : CTFSpectatorGUIHealth( parent, name )
  19. {
  20. }
  21. virtual const char *GetResFilename( void )
  22. {
  23. return "resource/UI/SpectatorTournamentGUIHealth.res";
  24. }
  25. };
  26. //-----------------------------------------------------------------------------
  27. // Purpose: A panel representing a player, shown in tournament mode Spec GUI
  28. //-----------------------------------------------------------------------------
  29. class CTFPlayerPanel : public vgui::EditablePanel
  30. {
  31. DECLARE_CLASS_SIMPLE( CTFPlayerPanel, vgui::EditablePanel );
  32. public:
  33. CTFPlayerPanel( vgui::Panel *parent, const char *name );
  34. virtual void Reset( void );
  35. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  36. virtual bool Update( void );
  37. void SetPlayerIndex( int iIndex );
  38. int GetPlayerIndex( void ) { return m_iPlayerIndex; }
  39. void Setup( int iPlayerIndex, CSteamID steamID, const char *pszPlayerName, int nLobbyTeam = TEAM_INVALID );
  40. void SetSpecIndex( int iIndex );
  41. int GetSpecIndex( void ) { return m_iSpecIndex; }
  42. virtual void UpdateBorder( void );
  43. int GetTeam( void );
  44. inline CSteamID GetSteamID() const { return m_steamID; }
  45. protected:
  46. int m_iPlayerIndex;
  47. CUtlString m_sPlayerName;
  48. CSteamID m_steamID;
  49. int m_iSpecIndex;
  50. CTFClassImage *m_pClassImage;
  51. CTFPlayerPanelGUIHealth *m_pHealthIcon;
  52. int m_iPrevHealth;
  53. bool m_bPrevAlive;
  54. int m_iPrevClass;
  55. int m_iPrevRespawnWait;
  56. int m_iPrevCharge;
  57. vgui::ScalableImagePanel *m_pReadyBG;
  58. vgui::ImagePanel *m_pReadyImage;
  59. // Ready state
  60. bool m_bPrevReady;
  61. int m_iPrevState;
  62. bool m_bPlayerReadyModeActive;
  63. int m_nGCTeam;
  64. };
  65. #endif // TF_PLAYERPANEL_H