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.

91 lines
2.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef CS_HUD_ACHIVEMENT_ANNOUNCE_H
  7. #define CS_HUD_ACHIVEMENT_ANNOUNCE_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include <KeyValues.h>
  12. #include <vgui/IScheme.h>
  13. #include <vgui/ISurface.h>
  14. #include <vgui/ISystem.h>
  15. #include <vgui_controls/AnimationController.h>
  16. #include <vgui_controls/EditablePanel.h>
  17. #include <vgui_controls/ScalableImagePanel.h>
  18. #include "vgui/ILocalize.h"
  19. #include "vgui_avatarimage.h"
  20. #include "hud.h"
  21. #include "hudelement.h"
  22. #include "cs_hud_playerhealth.h"
  23. #include "cs_shareddefs.h"
  24. using namespace vgui;
  25. class IAchievement;
  26. class CCSAchivementInfoPanel : public vgui::EditablePanel
  27. {
  28. DECLARE_CLASS_SIMPLE( CCSAchivementInfoPanel, vgui::EditablePanel );
  29. public:
  30. CCSAchivementInfoPanel( vgui::Panel *parent, const char* name);
  31. ~CCSAchivementInfoPanel();
  32. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  33. void SetAchievement(IAchievement* pAchievement);
  34. private:
  35. vgui::Label *m_pAchievementNameLabel;
  36. vgui::Label *m_pAchievementDescLabel;
  37. vgui::ScalableImagePanel *m_pAchievementIcon;
  38. };
  39. class CCSAchievementAnnouncePanel: public EditablePanel, public CHudElement
  40. {
  41. private:
  42. DECLARE_CLASS_SIMPLE( CCSAchievementAnnouncePanel, EditablePanel );
  43. public:
  44. CCSAchievementAnnouncePanel( const char *pElementName );
  45. ~CCSAchievementAnnouncePanel();
  46. virtual void Reset();
  47. virtual void Init();
  48. virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
  49. virtual void FireGameEvent( IGameEvent * event );
  50. void Show();
  51. void Hide();
  52. virtual bool ShouldDraw( void );
  53. virtual void Paint( void );
  54. void OnThink( void );
  55. bool GetAlphaFromTime(float elapsedTime, float delay, float fadeInTime, float holdTime, float fadeOutTime, float&alpha);
  56. int HudElementKeyInput( int down, ButtonCode_t keynum, const char *pszCurrentBinding );
  57. protected:
  58. bool GetGlowAlpha (float time, float& alpha);
  59. bool GetAchievementPanelAlpha (float time, float& alpha);
  60. private:
  61. CUtlQueue<eCSAchievementType> m_achievementQueue;
  62. eCSAchievementType m_currentDisplayedAchievement;
  63. float m_displayStartTime;
  64. vgui::EditablePanel *m_pGlowPanel;
  65. CCSAchivementInfoPanel *m_pAchievementInfoPanel;
  66. bool m_bShouldBeVisible;
  67. };
  68. #endif //CS_HUD_ACHIVEMENT_ANNOUNCE_H