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.

152 lines
4.7 KiB

  1. //===== Copyright � 1996-2005, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose: Defines the interface that the GameUI dll exports
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef VGUI_BASEUI_INTERFACE_H
  8. #define VGUI_BASEUI_INTERFACE_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "ienginevgui.h"
  13. #include "inputsystem/ButtonCode.h"
  14. #if !defined( _X360 )
  15. #include "xbox/xboxstubs.h"
  16. #endif
  17. //-----------------------------------------------------------------------------
  18. // Foward declarations
  19. //-----------------------------------------------------------------------------
  20. class IMatSystemSurface;
  21. class Color;
  22. class IGameUI;
  23. class KeyValues;
  24. struct InputEvent_t;
  25. FORWARD_DECLARE_HANDLE( InputContextHandle_t );
  26. IGameUI* GetGameUI( void );
  27. //-----------------------------------------------------------------------------
  28. // Global singleton interfaces related to VGUI
  29. //-----------------------------------------------------------------------------
  30. // enumeration of level loading progress bar spots
  31. enum LevelLoadingProgress_e
  32. {
  33. PROGRESS_INVALID = -2,
  34. PROGRESS_DEFAULT = -1,
  35. PROGRESS_NONE,
  36. PROGRESS_CHANGELEVEL,
  37. PROGRESS_SPAWNSERVER,
  38. PROGRESS_LOADWORLDMODEL,
  39. PROGRESS_CRCMAP,
  40. PROGRESS_CRCCLIENTDLL,
  41. PROGRESS_CREATENETWORKSTRINGTABLES,
  42. PROGRESS_PRECACHEWORLD,
  43. PROGRESS_CLEARWORLD,
  44. PROGRESS_LEVELINIT,
  45. PROGRESS_PRECACHE,
  46. PROGRESS_ACTIVATESERVER,
  47. PROGRESS_BEGINCONNECT,
  48. PROGRESS_SIGNONCHALLENGE,
  49. PROGRESS_SIGNONCONNECT,
  50. PROGRESS_SIGNONCONNECTED,
  51. PROGRESS_PROCESSSERVERINFO,
  52. PROGRESS_PROCESSSTRINGTABLE,
  53. PROGRESS_SIGNONNEW,
  54. PROGRESS_SENDCLIENTINFO,
  55. PROGRESS_SENDSIGNONDATA,
  56. PROGRESS_SIGNONSPAWN,
  57. PROGRESS_CREATEENTITIES,
  58. PROGRESS_FULLYCONNECTED,
  59. PROGRESS_PRECACHELIGHTING,
  60. PROGRESS_READYTOPLAY,
  61. PROGRESS_HIGHESTITEM, // must be last item in list
  62. };
  63. //-----------------------------------------------------------------------------
  64. // Purpose: Centerpoint for handling all user interface in the engine
  65. //-----------------------------------------------------------------------------
  66. abstract_class IEngineVGuiInternal : public IEngineVGui
  67. {
  68. public:
  69. virtual void Init() = 0;
  70. virtual void Connect() = 0;
  71. virtual void Shutdown() = 0;
  72. virtual bool SetVGUIDirectories() = 0;
  73. virtual bool IsInitialized() const = 0;
  74. virtual CreateInterfaceFn GetGameUIFactory() = 0;
  75. virtual bool Key_Event( const InputEvent_t &event ) = 0;
  76. virtual void BackwardCompatibility_Paint() = 0;
  77. virtual void UpdateButtonState( const InputEvent_t &event ) = 0;
  78. virtual void PostInit() = 0;
  79. virtual void Paint( PaintMode_t mode ) = 0;
  80. // handlers for game UI (main menu)
  81. virtual void ActivateGameUI() = 0;
  82. virtual bool HideGameUI() = 0;
  83. virtual bool IsGameUIVisible() = 0;
  84. // console
  85. virtual void ShowConsole() = 0;
  86. virtual void HideConsole() = 0;
  87. virtual bool IsConsoleVisible() = 0;
  88. virtual void ClearConsole() = 0;
  89. virtual void HideDebugSystem() = 0;
  90. // level loading
  91. virtual void OnLevelLoadingStarted( const char *levelName, bool bLocalServer ) = 0;
  92. virtual void OnLevelLoadingFinished() = 0;
  93. virtual void NotifyOfServerConnect(const char *game, int IP, int connectionPort, int queryPort) = 0;
  94. virtual void NotifyOfServerDisconnect() = 0;
  95. virtual void EnabledProgressBarForNextLoad() = 0;
  96. virtual void UpdateProgressBar(LevelLoadingProgress_e progress, bool showDialog = true ) = 0;
  97. virtual void UpdateCustomProgressBar( float progress, const wchar_t *desc ) = 0;
  98. virtual void StartCustomProgress() = 0;
  99. virtual void FinishCustomProgress() = 0;
  100. virtual void UpdateSecondaryProgressBarWithFile( float progress, const char *pDesc, int nBytesTotal ) = 0;
  101. virtual void UpdateSecondaryProgressBar( float progress, const wchar_t *desc ) = 0;
  102. virtual void ShowErrorMessage() = 0;
  103. virtual void HideLoadingPlaque() = 0;
  104. virtual void StartLoadingScreenForCommand( const char* command ) = 0;
  105. virtual void StartLoadingScreenForKeyValues( KeyValues* keyValues ) = 0;
  106. // Should pause?
  107. virtual bool ShouldPause() = 0;
  108. virtual void SetGameDLLPanelsVisible( bool show ) = 0;
  109. // Allows the level loading progress to show map-specific info
  110. virtual void SetProgressLevelName( const char *levelName ) = 0;
  111. virtual void Simulate() = 0;
  112. virtual void SetNotAllowedToHideGameUI( bool bNotAllowedToHide ) = 0;
  113. virtual void SetNotAllowedToShowGameUI( bool bNotAllowedToShow ) = 0;
  114. virtual void NeedConnectionProblemWaitScreen() = 0;
  115. virtual void ShowPasswordUI( char const *pchCurrentPW ) = 0;
  116. virtual void OnToolModeChanged( bool bGameMode ) = 0;
  117. virtual InputContextHandle_t GetGameUIInputContext() = 0;
  118. virtual bool IsPlayingFullScreenVideo() = 0;
  119. };
  120. // Purpose: singleton accessor
  121. #ifndef DEDICATED
  122. extern IEngineVGuiInternal *EngineVGui();
  123. #endif
  124. #endif // VGUI_BASEUI_INTERFACE_H