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.

62 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TF_HUD_MEDICCALLERS_H
  7. #define TF_HUD_MEDICCALLERS_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 "tf_imagepanel.h"
  17. #include "c_tf_player.h"
  18. //-----------------------------------------------------------------------------
  19. // Purpose:
  20. //-----------------------------------------------------------------------------
  21. class CTFMedicCallerPanel : public vgui::EditablePanel, public CGameEventListener
  22. {
  23. DECLARE_CLASS_SIMPLE( CTFMedicCallerPanel, vgui::EditablePanel );
  24. public:
  25. CTFMedicCallerPanel( vgui::Panel *parent, const char *name );
  26. ~CTFMedicCallerPanel( void );
  27. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  28. virtual void PerformLayout( void );
  29. virtual void OnTick( void );
  30. virtual void PaintBackground( void );
  31. virtual void Paint( void );
  32. virtual const char *GetControlSettingFile() const { return "resource/UI/MedicCallerPanel.res"; }
  33. void GetCallerPosition( const Vector &vecDelta, float flRadius, float *xpos, float *ypos, float *flRotation );
  34. void SetEntity( C_BaseEntity *pEntity, float flDuration, Vector &vecOffset );
  35. void SetMedicCallerType( MedicCallerType nType );
  36. static void AddMedicCaller( C_BaseEntity *pEntity, float flDuration, Vector &vecOffset, MedicCallerType nType = CALLER_TYPE_NORMAL );
  37. virtual void FireGameEvent( IGameEvent *event );
  38. protected:
  39. C_BaseEntity *GetEntity() const { return m_hEntity; }
  40. private:
  41. IMaterial *m_pArrowMaterial;
  42. float m_flRemoveAt;
  43. Vector m_vecOffset;
  44. CHandle<C_BaseEntity> m_hEntity;
  45. int m_iDrawArrow;
  46. bool m_bOnscreen;
  47. bool m_bBurning;
  48. bool m_bBleeding;
  49. float m_flPanelScale;
  50. int m_nCallerType;
  51. };
  52. #endif // TF_HUD_MEDICCALLERS_H