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.

141 lines
5.3 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef IGAMEUI_H
  8. #define IGAMEUI_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "interface.h"
  13. #include "vgui/IPanel.h"
  14. #if !defined( _X360 )
  15. #include "xbox/xboxstubs.h"
  16. #endif
  17. class CCommand;
  18. // reasons why the user can't connect to a game server
  19. enum ESteamLoginFailure
  20. {
  21. STEAMLOGINFAILURE_NONE,
  22. STEAMLOGINFAILURE_BADTICKET,
  23. STEAMLOGINFAILURE_NOSTEAMLOGIN,
  24. STEAMLOGINFAILURE_VACBANNED,
  25. STEAMLOGINFAILURE_LOGGED_IN_ELSEWHERE
  26. };
  27. enum ESystemNotify
  28. {
  29. SYSTEMNOTIFY_STORAGEDEVICES_CHANGED,
  30. SYSTEMNOTIFY_USER_SIGNEDIN,
  31. SYSTEMNOTIFY_USER_SIGNEDOUT,
  32. SYSTEMNOTIFY_XLIVE_LOGON_ESTABLISHED, // we are logged into live service
  33. SYSTEMNOTIFY_XLIVE_LOGON_CLOSED, // no longer logged into live - either from natural (signed out) or unnatural (e.g. severed net connection) causes
  34. SYSTEMNOTIFY_XUIOPENING,
  35. SYSTEMNOTIFY_XUICLOSED,
  36. SYSTEMNOTIFY_INVITE_SHUTDOWN, // Cross-game invite is causing us to shutdown
  37. SYSTEMNOTIFY_MUTECHANGED, // Player changed mute settings
  38. SYSTEMNOTIFY_INPUTDEVICESCHANGED, // Input device has changed (used for controller disconnection)
  39. SYSTEMNOTIFY_PROFILE_UNAVAILABLE, // Profile failed to read or write
  40. };
  41. // these are used to show the modal message box on different slots
  42. enum ECommandMsgBoxSlot
  43. {
  44. CMB_SLOT_FULL_SCREEN = -1,
  45. CMB_SLOT_PLAYER_0,
  46. CMB_SLOT_PLAYER_1,
  47. };
  48. //-----------------------------------------------------------------------------
  49. // Purpose: contains all the functions that the GameUI dll exports
  50. //-----------------------------------------------------------------------------
  51. abstract_class IGameUI
  52. {
  53. public:
  54. // initialization/shutdown
  55. virtual void Initialize( CreateInterfaceFn appFactory ) = 0;
  56. virtual void PostInit() = 0;
  57. // connect to other interfaces at the same level (gameui.dll/server.dll/client.dll)
  58. virtual void Connect( CreateInterfaceFn gameFactory ) = 0;
  59. virtual void Start() = 0;
  60. virtual void Shutdown() = 0;
  61. virtual void RunFrame() = 0;
  62. // notifications
  63. virtual void OnGameUIActivated() = 0;
  64. virtual void OnGameUIHidden() = 0;
  65. // OLD: Use OnConnectToServer2
  66. virtual void OLD_OnConnectToServer(const char *game, int IP, int port) = 0;
  67. virtual void OnDisconnectFromServer_OLD( uint8 eSteamLoginFailure, const char *username ) = 0;
  68. virtual void OnLevelLoadingStarted( const char *levelName, bool bShowProgressDialog ) = 0;
  69. virtual void OnLevelLoadingFinished(bool bError, const char *failureReason, const char *extendedReason) = 0;
  70. virtual void StartLoadingScreenForCommand( const char* command ) = 0;
  71. virtual void StartLoadingScreenForKeyValues( KeyValues* keyValues ) = 0;
  72. // level loading progress, returns true if the screen needs updating
  73. virtual bool UpdateProgressBar(float progress, const char *statusText, bool showDialog = true ) = 0;
  74. // Shows progress desc, returns previous setting... (used with custom progress bars )
  75. virtual bool SetShowProgressText( bool show ) = 0;
  76. virtual bool UpdateSecondaryProgressBar(float progress, const wchar_t *desc ) = 0;
  77. // !!!!!!!!!members added after "GameUI011" initial release!!!!!!!!!!!!!!!!!!!
  78. // Allows the level loading progress to show map-specific info
  79. virtual void SetProgressLevelName( const char *levelName ) = 0;
  80. // Xbox 360
  81. virtual void ShowMessageDialog( const uint nType, vgui::Panel *pOwner ) = 0;
  82. virtual void ShowMessageDialog( const char* messageID, const char* titleID ) = 0;
  83. virtual void CreateCommandMsgBox( const char* pszTitle, const char* pszMessage, bool showOk = true, bool showCancel = false, const char* okCommand = NULL, const char* cancelCommand = NULL, const char* closedCommand = NULL, const char* pszLegend = NULL ) = 0;
  84. virtual void CreateCommandMsgBoxInSlot( ECommandMsgBoxSlot slot, const char* pszTitle, const char* pszMessage, bool showOk = true, bool showCancel = false, const char* okCommand = NULL, const char* cancelCommand = NULL, const char* closedCommand = NULL, const char* pszLegend = NULL ) = 0;
  85. // inserts specified panel as background for level load dialog
  86. virtual void SetLoadingBackgroundDialog( vgui::VPANEL panel ) = 0;
  87. virtual void OnConnectToServer2(const char *game, int IP, int connectionPort, int queryPort) = 0;
  88. virtual void SetProgressOnStart() = 0;
  89. virtual void OnDisconnectFromServer( uint8 eSteamLoginFailure ) = 0;
  90. /*
  91. virtual void OnConfirmQuit( void ) = 0;
  92. virtual bool IsMainMenuVisible( void ) = 0;
  93. // Client DLL is providing us with a panel that it wants to replace the main menu with
  94. virtual void SetMainMenuOverride( vgui::VPANEL panel ) = 0;
  95. // Client DLL is telling us that a main menu command was issued, probably from its custom main menu panel
  96. virtual void SendMainMenuCommand( const char *pszCommand ) = 0;
  97. */
  98. virtual void NeedConnectionProblemWaitScreen() = 0;
  99. virtual void ShowPasswordUI( char const *pchCurrentPW ) = 0;
  100. #if defined( _X360 ) && defined( _DEMO )
  101. virtual void OnDemoTimeout( void ) = 0;
  102. #endif
  103. virtual bool LoadingProgressWantsIsolatedRender( bool bContextValid ) = 0;
  104. virtual bool IsPlayingFullScreenVideo() = 0;
  105. virtual bool IsTransitionEffectEnabled() = 0;
  106. virtual bool IsInLevel() = 0;
  107. virtual void RestoreTopLevelMenu() = 0;
  108. };
  109. #define GAMEUI_INTERFACE_VERSION "GameUI011"
  110. #endif // IGAMEUI_H