Team Fortress 2 Source Code as on 22/4/2020
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.

77 lines
2.3 KiB

  1. //========= Copyright 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 OnKeyCodeTyped(vgui::KeyCode code);
  39. virtual void OnKeyCodePressed(vgui::KeyCode code);
  40. virtual void PaintBackground( void );
  41. private:
  42. void SetupControlSettings( bool bForceShowProgressText );
  43. void SetupControlSettingsForErrorDisplay( const char *settingsFile );
  44. void HideOtherDialogs( bool bHide );
  45. vgui::ProgressBar *m_pProgress;
  46. vgui::ProgressBar *m_pProgress2;
  47. vgui::Label *m_pInfoLabel;
  48. vgui::Label *m_pTimeRemainingLabel;
  49. vgui::Button *m_pCancelButton;
  50. vgui::Panel *m_pLoadingBackground;
  51. bool m_bShowingSecondaryProgress;
  52. float m_flSecondaryProgress;
  53. float m_flLastSecondaryProgressUpdateTime;
  54. float m_flSecondaryProgressStartTime;
  55. bool m_bShowingVACInfo;
  56. bool m_bCenter;
  57. bool m_bConsoleStyle;
  58. float m_flProgressFraction;
  59. CPanelAnimationVar( int, m_iAdditionalIndentX, "AdditionalIndentX", "0" );
  60. CPanelAnimationVar( int, m_iAdditionalIndentY, "AdditionalIndentY", "0" );
  61. };
  62. // singleton accessor
  63. CLoadingDialog *LoadingDialog();
  64. #endif // LOADINGDIALOG_H