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.

86 lines
2.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef SFHUDVOTEPANEL_H
  8. #define SFHUDVOTEPANEL_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif //_WIN32
  12. #include "sfhudflashinterface.h"
  13. #define VOTE_PANEL_NAME_TRUNCATE_AT 16 // number of name character displayed before truncation
  14. class SFHudVotePanel: public SFHudFlashInterface
  15. {
  16. public:
  17. explicit SFHudVotePanel( const char *value );
  18. virtual void ProcessInput( void );
  19. virtual void LevelInit( void );
  20. virtual void LevelShutdown( void );
  21. virtual void FlashReady( void );
  22. virtual bool PreUnloadFlash( void );
  23. virtual void FireGameEvent( IGameEvent * event );
  24. virtual void SetActive( bool bActive );
  25. //void TimerCallback( SCALEFORM_CALLBACK_ARGS_DECL );
  26. void VoteYes( SCALEFORM_CALLBACK_ARGS_DECL );
  27. void VoteNo( SCALEFORM_CALLBACK_ARGS_DECL );
  28. void UpdateYesNoButtonText( bool bShowOtherTeam = false );
  29. void Hide( void );
  30. virtual bool ShouldDraw( void );
  31. bool MsgFunc_CallVoteFailed( const CCSUsrMsg_CallVoteFailed &msg );
  32. bool MsgFunc_VoteStart( const CCSUsrMsg_VoteStart &msg );
  33. bool MsgFunc_VotePass( const CCSUsrMsg_VotePass &msg );
  34. bool MsgFunc_VoteFailed( const CCSUsrMsg_VoteFailed &msg );
  35. bool MsgFunc_VoteSetup( const CCSUsrMsg_VoteSetup &msg );
  36. void ShowVoteUI( wchar_t* headerText, wchar_t* voteText, bool bShowingOtherTeam = false );
  37. void OnThink( void );
  38. CUserMessageBinder m_UMCMsgCallVoteFailed;
  39. CUserMessageBinder m_UMCMsgVoteStart;
  40. CUserMessageBinder m_UMCMsgVotePass;
  41. CUserMessageBinder m_UMCMsgVoteFailed;
  42. CUserMessageBinder m_UMCMsgVoteSetup;
  43. private:
  44. void SetVoteActive( bool bActive );
  45. SFVALUE m_hVoteButtonBG;
  46. ISFTextObject* m_hVoteLocalCast;
  47. ISFTextObject* m_option1Text;
  48. ISFTextObject* m_option2Text;
  49. ISFTextObject* m_option1CountText;
  50. ISFTextObject* m_option2CountText;
  51. CUtlStringList m_VoteSetupIssues;
  52. CUtlStringList m_VoteSetupMapCycle;
  53. CUtlStringList m_VoteSetupChoices;
  54. bool m_bVoteActive;
  55. float m_flVoteResultCycleTime; // what time will we cycle to the result
  56. float m_flHideTime; // what time will we hide
  57. bool m_bVotePassed; // what mode are we going to cycle to
  58. int m_nVoteOptionCount[MAX_VOTE_OPTIONS]; // Vote options counter
  59. int m_nPotentialVotes; // If set, draw a line at this point to show the required bar length
  60. bool m_bIsYesNoVote;
  61. int m_nVoteChoicesCount;
  62. bool m_bPlayerVoted;
  63. int m_bPlayerLocalVote;
  64. float m_flPostVotedHideTime;
  65. bool m_bVisible;
  66. bool m_bHasFocus;
  67. int m_nVoteYes;
  68. int m_nVoteNo;
  69. };
  70. #endif // SFHUDVOTEPANEL_H