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.

57 lines
1.3 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #include "cbase.h"
  7. #include "hudelement.h"
  8. #include <vgui_controls/Panel.h>
  9. #include <vgui/ISurface.h>
  10. #include "clientmode_csnormal.h"
  11. #include "c_cs_player.h"
  12. #include "materialsystem/imaterialsystemhardwareconfig.h"
  13. class CHudFlashbang : public CHudElement, public vgui::Panel
  14. {
  15. public:
  16. DECLARE_CLASS_SIMPLE( CHudFlashbang, vgui::Panel );
  17. virtual bool ShouldDraw();
  18. virtual void Paint();
  19. CHudFlashbang( const char *name );
  20. private:
  21. int m_iAdditiveWhiteID;
  22. };
  23. DECLARE_HUDELEMENT( CHudFlashbang );
  24. CHudFlashbang::CHudFlashbang( const char *pName ) :
  25. vgui::Panel( NULL, "HudFlashbang" ), CHudElement( pName )
  26. {
  27. SetParent( g_pClientMode->GetViewport() );
  28. m_iAdditiveWhiteID = 0;
  29. SetHiddenBits( HIDEHUD_PLAYERDEAD );
  30. }
  31. // the flashbang effect cannot be drawn in the HUD, because this lets the user skip its effect
  32. // by hitting Escape, or by setting "cl_drawhud 0".
  33. bool CHudFlashbang::ShouldDraw()
  34. {
  35. return true;
  36. }
  37. // the flashbang effect cannot be drawn in the HUD, because this lets the user skip its effect
  38. // by hitting Escape, or by setting "cl_drawhud 0".
  39. void CHudFlashbang::Paint()
  40. {
  41. return;
  42. }