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.

129 lines
3.4 KiB

  1. //========= Copyright � 1996-2008, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=====================================================================================//
  6. #ifndef _BASEMODFACTORYBASEPANEL_H__
  7. #define _BASEMODFACTORYBASEPANEL_H__
  8. #include "vgui_controls/Panel.h"
  9. #include "vgui_controls/Frame.h"
  10. #include "vgui_controls/Button.h"
  11. #include "tier1/utllinkedlist.h"
  12. #include "avi/ibik.h"
  13. #include "ixboxsystem.h"
  14. #include "matchmaking/imatchframework.h"
  15. namespace BaseModUI
  16. {
  17. //=============================================================================
  18. //
  19. //=============================================================================
  20. class CBaseModPanel : public vgui::EditablePanel, public IMatchEventsSink
  21. {
  22. DECLARE_CLASS_SIMPLE( CBaseModPanel, vgui::EditablePanel );
  23. public:
  24. CBaseModPanel();
  25. ~CBaseModPanel();
  26. // IMatchEventSink implementation
  27. public:
  28. virtual void OnEvent( KeyValues *pEvent );
  29. public:
  30. static CBaseModPanel& GetSingleton();
  31. static CBaseModPanel* GetSingletonPtr();
  32. void ReloadScheme();
  33. bool IsLevelLoading();
  34. void OnGameUIActivated();
  35. void OnGameUIHidden();
  36. void OpenFrontScreen();
  37. void RunFrame();
  38. void OnLevelLoadingStarted( char const *levelName, bool bShowProgressDialog );
  39. void OnLevelLoadingFinished( KeyValues *kvEvent );
  40. bool UpdateProgressBar(float progress, const char *statusText);
  41. void OnCreditsFinished(void);
  42. bool IsReadyToWriteConfig( void );
  43. void StartExitingProcess( bool bWarmRestart );
  44. void SetLastActiveUserId( int userId );
  45. int GetLastActiveUserId();
  46. bool IsMenuBackgroundMovieValid( void );
  47. bool IsBackgroundMusicPlaying();
  48. bool StartBackgroundMusic( float fVol );
  49. void UpdateBackgroundMusicVolume( float fVol );
  50. void ReleaseBackgroundMusic();
  51. void SafeNavigateTo( Panel *pExpectedFrom, Panel *pDesiredTo, bool bAllowStealFocus );
  52. #if defined( _GAMECONSOLE ) && defined( _DEMO )
  53. void OnDemoTimeout();
  54. #endif
  55. protected:
  56. CBaseModPanel(const CBaseModPanel&);
  57. CBaseModPanel& operator=(const CBaseModPanel&);
  58. void ApplySchemeSettings(vgui::IScheme *pScheme);
  59. void PaintBackground();
  60. void OnCommand(const char *command);
  61. void OnSetFocus();
  62. virtual bool RequestInfo( KeyValues *data );
  63. MESSAGE_FUNC( OnMovedPopupToFront, "OnMovedPopupToFront" );
  64. private:
  65. void DrawColoredText( vgui::HFont hFont, int x, int y, unsigned int color, const char *pAnsiText );
  66. void DrawCopyStats();
  67. void OnEngineLevelLoadingSession( KeyValues *pEvent );
  68. bool ActivateBackgroundEffects();
  69. // Background movie playback
  70. bool InitBackgroundMovie( void );
  71. void CalculateMovieParameters( void );
  72. bool RenderBackgroundMovie( float *pflFadeDelta ); // Render and update our BIK movie in the background
  73. void ShutdownBackgroundMovie( void );
  74. BIKMaterial_t m_BIKHandle;
  75. IMaterial *m_pMovieMaterial;
  76. float m_flU0, m_flV0, m_flU1, m_flV1;
  77. float m_flMovieFadeInTime; // Time to be fully faded in
  78. bool m_bMovieFailed;
  79. static CBaseModPanel* m_CFactoryBasePanel;
  80. bool m_LevelLoading;
  81. vgui::HScheme m_UIScheme;
  82. int m_lastActiveUserId;
  83. vgui::HFont m_hDefaultFont;
  84. int m_iBackgroundImageID;
  85. int m_iFadeToBackgroundImageID;
  86. int m_iMovieTransitionImage;
  87. int m_DelayActivation;
  88. int m_ExitingFrameCount;
  89. bool m_bWarmRestartMode;
  90. bool m_bClosingAllWindows;
  91. float m_flBlurScale;
  92. float m_flLastBlurTime;
  93. CUtlString m_backgroundMusic;
  94. int m_nBackgroundMusicGUID;
  95. bool m_bFadeMusicUp;
  96. };
  97. };
  98. #endif