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.

111 lines
3.0 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef SFHUDWINPANEL_H
  8. #define SFHUDWINPANEL_H
  9. #pragma once
  10. #include "hudelement.h"
  11. #include "ehandle.h"
  12. #include "hud.h"
  13. #include "hud_element_helper.h"
  14. #include "scaleformui/scaleformui.h"
  15. #include "sfhudflashinterface.h"
  16. #include "cs_gamerules.h"
  17. #include "c_cs_player.h"
  18. #include "weapon_csbase.h"
  19. #include "takedamageinfo.h"
  20. #include "weapon_csbase.h"
  21. #include "ammodef.h"
  22. #include <vgui_controls/Panel.h>
  23. enum
  24. {
  25. WIN_EXTRATYPE_NONE = 0,
  26. WIN_EXTRATYPE_AWARD,
  27. WIN_EXTRATYPE_RANK,
  28. WIN_EXTRATYPE_ELO,
  29. WIN_EXTRATYPE_GGNEXT,
  30. WIN_EXTRATYPE_SEASONRANK,
  31. };
  32. //-----------------------------------------------------------------------------
  33. // Purpose: Used to draw the history of weapon / item pickups and purchases by the player
  34. //-----------------------------------------------------------------------------
  35. class SFHudWinPanel: public SFHudFlashInterface, public IShaderDeviceDependentObject
  36. {
  37. public:
  38. explicit SFHudWinPanel( const char *value );
  39. virtual void LevelInit( void );
  40. virtual void LevelShutdown( void );
  41. virtual void SetActive( bool bActive );
  42. virtual void FlashReady( void );
  43. virtual bool PreUnloadFlash( void );
  44. virtual void ProcessInput( void );
  45. virtual void FireGameEvent( IGameEvent * event );
  46. virtual bool ShouldDraw( void );
  47. // Offsets the Y location of the win panel
  48. void ApplyYOffset( int nOffset );
  49. bool IsVisible( void );
  50. // IShaderDeviceDependentObject methods
  51. virtual void DeviceLost( void ) { }
  52. virtual void DeviceReset( void *pDevice, void *pPresentParameters, void *pHWnd );
  53. virtual void ScreenSizeChanged( int width, int height ) { }
  54. int m_iMVP;
  55. protected:
  56. void SetMVP( C_CSPlayer* pPlayer, CSMvpReason_t reason, int32 nMusicKitMVPs = 0 );
  57. void SetFunFactLabel( const wchar *szFunFact );
  58. void SetProgressBarText( int nAmount, const wchar *wszDescText );
  59. //void MovieClipSetVisibility( SFVALUE panel, bool bShow );
  60. //void TextPanelSetVisibility( ISFTextObject* panel, bool bShow );
  61. private:
  62. void ShowTeamWinPanel( int result, const char* winnerText );
  63. void ShowGunGameWinPanel( void /*int nWinner, int nSecond, int nThird*/ );
  64. void ShowWinExtraDataPanel( int nExtraPanelType );
  65. void SetWinPanelExtraData( void );
  66. void Hide( void );
  67. SFVALUE m_hWinPanelParent;
  68. ISFTextObject* m_hWinner;
  69. ISFTextObject* m_hReason;
  70. ISFTextObject* m_hMVP;
  71. ISFTextObject* m_hSurrender;
  72. ISFTextObject* m_hFunFact;
  73. SFVALUE m_hEloPanel;
  74. SFVALUE m_hRankPanel;
  75. SFVALUE m_hItemPanel;
  76. SFVALUE m_hMedalPanel;
  77. SFVALUE m_hProgressText;
  78. SFVALUE m_hNextWeaponPanel;
  79. bool m_bVisible;
  80. int m_nFunFactPlayer;
  81. string_t m_nFunfactToken;
  82. int m_nFunFactParam1;
  83. int m_nFunFactParam2;
  84. int m_nFunFactParam3;
  85. int m_nRoundStartELO;
  86. bool m_bShouldSetWinPanelExtraData;
  87. float m_fSetWinPanelExtraDataTime;
  88. };
  89. #endif // SFHUDWINPANEL_H