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.

49 lines
1.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef HUD_SPEC_CROSSHAIR_H
  8. #define HUD_SPEC_CROSSHAIR_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "hudelement.h"
  13. #include <vgui_controls/Panel.h>
  14. namespace vgui
  15. {
  16. class IScheme;
  17. };
  18. //-----------------------------------------------------------------------------
  19. // Purpose:
  20. //-----------------------------------------------------------------------------
  21. class CHudSpecCrosshair : public CHudElement, public vgui::Panel
  22. {
  23. DECLARE_CLASS_SIMPLE( CHudSpecCrosshair, vgui::Panel );
  24. public:
  25. CHudSpecCrosshair( const char *pElementName );
  26. void DrawCrosshair( void );
  27. bool HasCrosshair( void ) { return ( m_pCrosshair != NULL ); }
  28. protected:
  29. virtual void ApplySchemeSettings( vgui::IScheme *scheme );
  30. virtual void Paint();
  31. private:
  32. // Crosshair sprite and colors
  33. CHudTexture *m_pCrosshair;
  34. Color m_clrCrosshair;
  35. };
  36. // Enable/disable crosshair rendering.
  37. extern ConVar crosshair;
  38. #endif // HUD_SPEC_CROSSHAIR_H