Counter Strike : Global Offensive Source Code
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.

123 lines
3.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Displays HUD elements for medals/achievements, and hint text
  4. //
  5. //=====================================================================================//
  6. #ifndef SFHUDINFOPANEL_H_
  7. #define SFHUDINFOPANEL_H_
  8. #include "hud.h"
  9. #include "hud_element_helper.h"
  10. #include "scaleformui/scaleformui.h"
  11. #include "sfhudflashinterface.h"
  12. #include "cs_gamerules.h"
  13. #include "c_cs_player.h"
  14. #include "tier1/utlqueue.h"
  15. class SFHudInfoPanel : public SFHudFlashInterface
  16. {
  17. enum HUDINFO_TYPE
  18. {
  19. SFHUDINFO_All,
  20. SFHUDINFO_Help,
  21. SFHUDINFO_Defuse,
  22. SFHUDINFO_Medal,
  23. SFHUDINFO_PriorityMessage
  24. };
  25. public:
  26. explicit SFHudInfoPanel( const char *value );
  27. virtual ~SFHudInfoPanel();
  28. // These overload the CHudElement class
  29. virtual void ProcessInput( void );
  30. virtual void LevelInit( void );
  31. virtual void LevelShutdown( void );
  32. virtual bool ShouldDraw( void );
  33. virtual void SetActive( bool bActive );
  34. virtual void Reset( void );
  35. // these overload the ScaleformFlashInterfaceMixin class
  36. virtual void FlashReady( void );
  37. virtual bool PreUnloadFlash( void );
  38. // receivers for hint messages
  39. bool MsgFunc_HintText( const CCSUsrMsg_HintText &msg );
  40. bool MsgFunc_KeyHintText( const CCSUsrMsg_KeyHintText &msg );
  41. virtual void FireGameEvent( IGameEvent * event );
  42. // Priority text replaces what used to be called CenterPrint text in VGui
  43. void SetPriorityText( char *pMsg );
  44. void SetPriorityText( wchar_t *pMsg );
  45. void SetPriorityHintText( wchar_t *pMsg );
  46. // Offsets the Y location of the notification panels
  47. void ApplyYOffset( int nOffset );
  48. bool IsVisible( void ) { return m_bIsVisible; }
  49. CUserMessageBinder m_UMCMsgHintText;
  50. CUserMessageBinder m_UMCMsgKeyHintText;
  51. CUserMessageBinder m_UMCMsgQuestProgress;
  52. protected:
  53. void ModifyPriorityTextWindow( bool bMsgSet );
  54. void ShowPanel( HUDINFO_TYPE panelType, bool value );
  55. // Only call this function if you're already inside of a slot-lock block!
  56. void ShowPanelNoLock( HUDINFO_TYPE panelType, bool value );
  57. void HideAll( void );
  58. void LockSlot( bool wantItLocked, bool& currentlyLocked );
  59. bool SetHintText( wchar_t *text );
  60. void LocalizeAndDisplay( const char *pszHudTxtMsg, const char *szRawString );
  61. protected:
  62. SFVALUE m_HelpPanelHandle;
  63. SFVALUE m_HelpBodyTextHandle;
  64. CountdownTimer m_HintDisplayTimer;
  65. SFVALUE m_DefusePanelHandle;
  66. SFVALUE m_DefuseTitleTextHandle;
  67. SFVALUE m_DefuseBodyTextHandle;
  68. SFVALUE m_DefuseTimerTextHandle;
  69. SFVALUE m_DefuseIconKit;
  70. SFVALUE m_DefuseIconNoKit;
  71. float m_PreviousDefusePercent;
  72. SFVALUE m_MedalPanelHandle;
  73. SFVALUE m_MedalTitleTextHandle;
  74. SFVALUE m_MedalBodyTextHandle;
  75. struct AchivementQueueInfo
  76. {
  77. eCSAchievementType type;
  78. int playerSlot;
  79. };
  80. CUtlQueue<AchivementQueueInfo> m_achievementQueue;
  81. eCSAchievementType m_activeAchievement;
  82. CountdownTimer m_AchievementDisplayTimer;
  83. CountdownTimer m_PriorityMsgDisplayTimer;
  84. SFVALUE m_PriorityMessagePanelHandle;
  85. SFVALUE m_PriorityMessageTitleTextHandle;
  86. SFVALUE m_PriorityMessageBodyTextHandle;
  87. bool m_bDeferRaiseHelpPanel;
  88. bool m_bDeferRaisePriorityMessagePanel;
  89. bool m_bHintPanelHidden; // True when we have hidden a help panel in order to show a priority message
  90. bool m_bIsVisible;
  91. };
  92. #endif /* SFHUDINFOPANEL_H_ */