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.

89 lines
2.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef DOD_HUD_DEATHSTATS_H
  8. #define DOD_HUD_DEATHSTATS_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui_controls/EditablePanel.h>
  13. #include <game/client/iviewport.h>
  14. #include <vgui/IScheme.h>
  15. #include <vgui_controls/Label.h>
  16. #include "hud.h"
  17. #include "hudelement.h"
  18. #include "dod_shareddefs.h"
  19. using namespace vgui;
  20. #define MAX_DEATHSTATS_NAME_LENGTH 128 // to hold multiple player cappers
  21. // Player entries in a death notice
  22. struct DeathStatsPlayer
  23. {
  24. char szName[MAX_DEATHSTATS_NAME_LENGTH];
  25. int iEntIndex;
  26. };
  27. // Contents of each entry in our list of death notices
  28. struct DeathStatsRecord
  29. {
  30. DeathStatsPlayer Killer;
  31. DeathStatsPlayer Victim;
  32. CHudTexture *iconDeath;
  33. bool bSuicide;
  34. };
  35. class CDODDeathStatsPanel : public EditablePanel, public CHudElement
  36. {
  37. private:
  38. DECLARE_CLASS_SIMPLE( CDODDeathStatsPanel, EditablePanel );
  39. public:
  40. CDODDeathStatsPanel( const char *pElementName );
  41. virtual void Reset();
  42. virtual void Init();
  43. virtual void VidInit();
  44. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  45. virtual void OnScreenSizeChanged( int iOldWide, int iOldTall );
  46. virtual void FireGameEvent( IGameEvent * event);
  47. virtual void Paint( void );
  48. int DrawDeathNoticeItem( int xRight, int y );
  49. void Show() { SetAlpha( 255 ); }
  50. void Hide() { SetAlpha( 0 ); }
  51. protected:
  52. vgui::Label *m_pSummaryLabel;
  53. vgui::Label *m_pAttackerHistoryLabel;
  54. DeathStatsRecord m_DeathRecord;
  55. int m_iMaterialTexture;
  56. // Special death notice icons
  57. CHudTexture *m_iconD_skull;
  58. // Icons for stats
  59. CHudTexture *m_pIconKill;
  60. CHudTexture *m_pIconWounded;
  61. CHudTexture *m_pIconCap;
  62. CHudTexture *m_pIconDefended;
  63. CPanelAnimationVar( vgui::HFont, m_hTextFont, "TextFont", "HudNumbersTimer" );
  64. CPanelAnimationVarAliasType( float, m_flLineHeight, "LineHeight", "15", "proportional_float" );
  65. CPanelAnimationVar( Color, m_ActiveBackgroundColor, "ActiveBackgroundColor", "255 255 255 140" );
  66. CPanelAnimationVarAliasType( int, m_iDeathNoticeX, "DeathNoticeX", "5", "proportional_int" );
  67. CPanelAnimationVarAliasType( int, m_iDeathNoticeY, "DeathNoticeY", "5", "proportional_int" );
  68. };
  69. #endif //DOD_HUD_DEATHSTATS_H