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.

116 lines
3.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TF_HUD_PASSTIME_RETICLE_H
  8. #define TF_HUD_PASSTIME_RETICLE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "utlvector.h"
  13. #include "Color.h"
  14. #include "fx_quad.h"
  15. //-----------------------------------------------------------------------------
  16. CFXQuad *CreateReticleSprite( const char *pModelName, float scale, float spinSpeed );
  17. class C_FuncPasstimeGoal;
  18. //-----------------------------------------------------------------------------
  19. class C_PasstimeReticle
  20. {
  21. public:
  22. virtual ~C_PasstimeReticle();
  23. void OnClientThink();
  24. protected:
  25. C_PasstimeReticle() {}
  26. virtual bool Update() = 0;
  27. void AddSprite( CFXQuad *pEnt );
  28. void SetAllOrigins( const Vector& pos );
  29. void SetAllNormals( const Vector& normal );
  30. void SetAllAlphas( byte a );
  31. void SetAllScales( float s );
  32. void SetOrigin( int i, const Vector& pos );
  33. void SetNormal( int i, const Vector& normal );
  34. void SetAlpha( int i, byte a );
  35. void SetRgba( int i, byte r, byte g, byte b, byte a );
  36. void SetScale( int i, float s );
  37. CUtlVector<CFXQuad*> m_pSprites;
  38. private:
  39. // noncopyable
  40. C_PasstimeReticle( const C_PasstimeReticle& ) = delete;
  41. C_PasstimeReticle( C_PasstimeReticle&& ) = delete;
  42. C_PasstimeReticle& operator=( const C_PasstimeReticle& ) = delete;
  43. C_PasstimeReticle& operator=( C_PasstimeReticle&& ) = delete;
  44. };
  45. //-----------------------------------------------------------------------------
  46. class C_PasstimeBallReticle : public C_PasstimeReticle
  47. {
  48. public:
  49. C_PasstimeBallReticle();
  50. private:
  51. virtual bool Update() OVERRIDE;
  52. };
  53. //-----------------------------------------------------------------------------
  54. class C_PasstimeGoalReticle : public C_PasstimeReticle
  55. {
  56. public:
  57. C_PasstimeGoalReticle( C_FuncPasstimeGoal *pGoal );
  58. private:
  59. virtual bool Update() OVERRIDE;
  60. CHandle<C_FuncPasstimeGoal> m_hGoal;
  61. };
  62. //-----------------------------------------------------------------------------
  63. class C_PasstimePassReticle : public C_PasstimeReticle
  64. {
  65. public:
  66. C_PasstimePassReticle();
  67. private:
  68. virtual bool Update() OVERRIDE;
  69. void FindPassHintTarget( C_TFPlayer *pLocalPlayer );
  70. float m_flTargetScore;
  71. CHandle<C_BaseEntity> m_hTarget;
  72. };
  73. //-----------------------------------------------------------------------------
  74. class C_PasstimeBounceReticle : public C_PasstimeReticle
  75. {
  76. public:
  77. C_PasstimeBounceReticle();
  78. void Show( const Vector& pos, const Vector& normal );
  79. void Hide();
  80. private:
  81. virtual bool Update() OVERRIDE;
  82. };
  83. //-----------------------------------------------------------------------------
  84. class C_PasstimePlayerReticle : public C_PasstimeReticle
  85. {
  86. public:
  87. C_PasstimePlayerReticle( C_TFPlayer *pPlayer );
  88. private:
  89. virtual bool Update() OVERRIDE;
  90. CHandle<C_TFPlayer> m_hPlayer;
  91. };
  92. //-----------------------------------------------------------------------------
  93. class C_PasstimeAskForBallReticle : public C_PasstimeReticle
  94. {
  95. public:
  96. C_PasstimeAskForBallReticle( C_TFPlayer *pPlayer );
  97. private:
  98. virtual bool Update() OVERRIDE;
  99. CHandle<C_TFPlayer> m_hPlayer;
  100. };
  101. #endif // TF_HUD_PASSTIME_RETICLE_H