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.

76 lines
2.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef LOADINGDIALOG_H
  8. #define LOADINGDIALOG_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <vgui_controls/Frame.h>
  13. #include <vgui_controls/HTML.h>
  14. //-----------------------------------------------------------------------------
  15. // Purpose: Dialog for displaying level loading status
  16. //-----------------------------------------------------------------------------
  17. class CLoadingDialog : public vgui::Frame
  18. {
  19. DECLARE_CLASS_SIMPLE( CLoadingDialog, vgui::Frame );
  20. public:
  21. CLoadingDialog( vgui::Panel *parent );
  22. ~CLoadingDialog();
  23. void Open();
  24. bool SetProgressPoint(float fraction);
  25. void SetStatusText(const char *statusText);
  26. void SetSecondaryProgress(float progress);
  27. void SetSecondaryProgressText(const char *statusText);
  28. bool SetShowProgressText( bool show );
  29. void DisplayGenericError(const char *failureReason, const char *extendedReason = NULL);
  30. void DisplayVACBannedError();
  31. void DisplayNoSteamConnectionError();
  32. void DisplayLoggedInElsewhereError();
  33. protected:
  34. virtual void OnCommand(const char *command);
  35. virtual void PerformLayout();
  36. virtual void OnThink();
  37. virtual void OnClose();
  38. virtual void OnKeyCodePressed(vgui::KeyCode code);
  39. virtual void PaintBackground( void );
  40. private:
  41. void SetupControlSettings( bool bForceShowProgressText );
  42. void SetupControlSettingsForErrorDisplay( const char *settingsFile );
  43. void HideOtherDialogs( bool bHide );
  44. vgui::ProgressBar *m_pProgress;
  45. vgui::ProgressBar *m_pProgress2;
  46. vgui::Label *m_pInfoLabel;
  47. vgui::Label *m_pTimeRemainingLabel;
  48. vgui::Button *m_pCancelButton;
  49. vgui::Panel *m_pLoadingBackground;
  50. bool m_bShowingSecondaryProgress;
  51. float m_flSecondaryProgress;
  52. float m_flLastSecondaryProgressUpdateTime;
  53. float m_flSecondaryProgressStartTime;
  54. bool m_bShowingVACInfo;
  55. bool m_bCenter;
  56. bool m_bConsoleStyle;
  57. float m_flProgressFraction;
  58. CPanelAnimationVar( int, m_iAdditionalIndentX, "AdditionalIndentX", "0" );
  59. CPanelAnimationVar( int, m_iAdditionalIndentY, "AdditionalIndentY", "0" );
  60. };
  61. // singleton accessor
  62. CLoadingDialog *LoadingDialog();
  63. #endif // LOADINGDIALOG_H