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.

122 lines
3.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef DOD_HUD_FREEZEPANEL_H
  7. #define DOD_HUD_FREEZEPANEL_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include <vgui_controls/EditablePanel.h>
  12. #include <game/client/iviewport.h>
  13. #include <vgui/IScheme.h>
  14. #include "hud.h"
  15. #include "hudelement.h"
  16. #include "vgui_controls/ImagePanel.h"
  17. #include "vgui_avatarimage.h"
  18. #include "dod_hud_playerstatus_health.h"
  19. using namespace vgui;
  20. bool IsTakingAFreezecamScreenshot( void );
  21. /*
  22. //-----------------------------------------------------------------------------
  23. // Purpose: Custom health panel used in the freeze panel to show killer's health
  24. //-----------------------------------------------------------------------------
  25. class CDODFreezePanelHealth : public CTFHudPlayerHealth
  26. {
  27. public:
  28. CTFFreezePanelHealth( Panel *parent, const char *name ) : CTFHudPlayerHealth( parent, name )
  29. {
  30. }
  31. virtual const char *GetResFilename( void ) { return "resource/UI/FreezePanelKillerHealth.res"; }
  32. virtual void OnThink()
  33. {
  34. // Do nothing. We're just preventing the base health panel from updating.
  35. }
  36. };
  37. */
  38. //-----------------------------------------------------------------------------
  39. // Purpose:
  40. //-----------------------------------------------------------------------------
  41. class CDODFreezePanelCallout : public EditablePanel
  42. {
  43. DECLARE_CLASS_SIMPLE( CDODFreezePanelCallout, EditablePanel );
  44. public:
  45. CDODFreezePanelCallout( Panel *parent, const char *name );
  46. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  47. };
  48. //-----------------------------------------------------------------------------
  49. // Purpose:
  50. //-----------------------------------------------------------------------------
  51. class CDODFreezePanel : public EditablePanel, public CHudElement
  52. {
  53. private:
  54. DECLARE_CLASS_SIMPLE( CDODFreezePanel, EditablePanel );
  55. public:
  56. CDODFreezePanel( const char *pElementName );
  57. virtual void Reset();
  58. virtual void Init();
  59. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  60. virtual void FireGameEvent( IGameEvent * event );
  61. void ShowSnapshotPanel( bool bShow );
  62. void UpdateCallout( void );
  63. void ShowCalloutsIn( float flTime );
  64. void ShowSnapshotPanelIn( float flTime );
  65. void Show();
  66. void Hide();
  67. virtual bool ShouldDraw( void );
  68. void OnThink( void );
  69. int HudElementKeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding );
  70. bool IsHoldingAfterScreenShot( void ) { return m_bHoldingAfterScreenshot; }
  71. protected:
  72. CDODFreezePanelCallout *TestAndAddCallout( Vector &origin, Vector &vMins, Vector &vMaxs, CUtlVector<Vector> *vecCalloutsTL,
  73. CUtlVector<Vector> *vecCalloutsBR, Vector &vecFreezeTL, Vector &vecFreezeBR, Vector &vecStatTL, Vector &vecStatBR, int *iX, int *iY );
  74. private:
  75. void ShowNemesisPanel( bool bShow );
  76. int m_iYBase;
  77. int m_iKillerIndex;
  78. //CTFHudPlayerHealth *m_pKillerHealth;
  79. int m_iShowNemesisPanel;
  80. CUtlVector<CDODFreezePanelCallout*> m_pCalloutPanels;
  81. float m_flShowCalloutsAt;
  82. float m_flShowSnapshotReminderAt;
  83. EditablePanel *m_pNemesisSubPanel;
  84. vgui::Label *m_pFreezeLabel;
  85. vgui::Panel *m_pFreezePanelBG;
  86. CAvatarImagePanel *m_pAvatar;
  87. vgui::EditablePanel *m_pScreenshotPanel;
  88. vgui::EditablePanel *m_pBasePanel;
  89. int m_iBasePanelOriginalX;
  90. int m_iBasePanelOriginalY;
  91. bool m_bHoldingAfterScreenshot;
  92. CDoDHudHealth *m_pHealthStatus;
  93. enum
  94. {
  95. SHOW_NO_NEMESIS = 0,
  96. SHOW_NEW_NEMESIS,
  97. SHOW_REVENGE
  98. };
  99. };
  100. #endif // DOD_HUD_FREEZEPANEL_H