|
| 1 | +//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============// |
| 2 | +// |
| 3 | +// Purpose: |
| 4 | +// |
| 5 | +// $NoKeywords: $ |
| 6 | +//=============================================================================// |
| 7 | + |
| 8 | +#ifndef IGAMEUI_H |
| 9 | +#define IGAMEUI_H |
| 10 | +#ifdef _WIN32 |
| 11 | +#pragma once |
| 12 | +#endif |
| 13 | + |
| 14 | +#include "interface.h" |
| 15 | +#include "vgui/ipanel.h" |
| 16 | + |
| 17 | +#if !defined( _X360 ) |
| 18 | +#include "xbox/xboxstubs.h" |
| 19 | +#endif |
| 20 | + |
| 21 | +class CCommand; |
| 22 | + |
| 23 | +// reasons why the user can't connect to a game server |
| 24 | +enum ESteamLoginFailure |
| 25 | +{ |
| 26 | + STEAMLOGINFAILURE_NONE, |
| 27 | + STEAMLOGINFAILURE_BADTICKET, |
| 28 | + STEAMLOGINFAILURE_NOSTEAMLOGIN, |
| 29 | + STEAMLOGINFAILURE_VACBANNED, |
| 30 | + STEAMLOGINFAILURE_LOGGED_IN_ELSEWHERE |
| 31 | +}; |
| 32 | + |
| 33 | +enum ESystemNotify |
| 34 | +{ |
| 35 | + SYSTEMNOTIFY_STORAGEDEVICES_CHANGED, |
| 36 | + SYSTEMNOTIFY_USER_SIGNEDIN, |
| 37 | + SYSTEMNOTIFY_USER_SIGNEDOUT, |
| 38 | + SYSTEMNOTIFY_XLIVE_LOGON_ESTABLISHED, // we are logged into live service |
| 39 | + SYSTEMNOTIFY_XLIVE_LOGON_CLOSED, // no longer logged into live - either from natural (signed out) or unnatural (e.g. severed net connection) causes |
| 40 | + SYSTEMNOTIFY_XUIOPENING, |
| 41 | + SYSTEMNOTIFY_XUICLOSED, |
| 42 | + SYSTEMNOTIFY_INVITE_SHUTDOWN, // Cross-game invite is causing us to shutdown |
| 43 | + SYSTEMNOTIFY_MUTECHANGED, // Player changed mute settings |
| 44 | + SYSTEMNOTIFY_INPUTDEVICESCHANGED, // Input device has changed (used for controller disconnection) |
| 45 | + SYSTEMNOTIFY_PROFILE_UNAVAILABLE, // Profile failed to read or write |
| 46 | +}; |
| 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 | + |
| 58 | + // connect to other interfaces at the same level (gameui.dll/server.dll/client.dll) |
| 59 | + virtual void Connect( CreateInterfaceFn gameFactory ) = 0; |
| 60 | + |
| 61 | + virtual void Start() = 0; |
| 62 | + virtual void Shutdown() = 0; |
| 63 | + virtual void RunFrame() = 0; |
| 64 | + |
| 65 | + // notifications |
| 66 | + virtual void OnGameUIActivated() = 0; |
| 67 | + virtual void OnGameUIHidden() = 0; |
| 68 | + |
| 69 | + // OLD: Use OnConnectToServer2 |
| 70 | + virtual void OLD_OnConnectToServer(const char *game, int IP, int port) = 0; |
| 71 | + |
| 72 | + virtual void OnDisconnectFromServer_OLD( uint8 eSteamLoginFailure, const char *username ) = 0; |
| 73 | + virtual void OnLevelLoadingStarted( const char *levelName, bool bShowProgressDialog ) = 0; |
| 74 | + virtual void OnLevelLoadingFinished(bool bError, const char *failureReason, const char *extendedReason) = 0; |
| 75 | + |
| 76 | + // level loading progress, returns true if the screen needs updating |
| 77 | + virtual bool UpdateProgressBar(float progress, const char *statusText) = 0; |
| 78 | + // Shows progress desc, returns previous setting... (used with custom progress bars ) |
| 79 | + virtual bool SetShowProgressText( bool show ) = 0; |
| 80 | + |
| 81 | + // !!!!!!!!!members added after "GameUI011" initial release!!!!!!!!!!!!!!!!!!! |
| 82 | + // Allows the level loading progress to show map-specific info |
| 83 | + virtual void SetProgressLevelName( const char *levelName ) = 0; |
| 84 | + |
| 85 | + // inserts specified panel as background for level load dialog |
| 86 | + virtual void SetLoadingBackgroundDialog( vgui::VPANEL panel ) = 0; |
| 87 | + |
| 88 | + virtual void OnConnectToServer2(const char *game, int IP, int connectionPort, int queryPort) = 0; |
| 89 | + |
| 90 | + virtual void SetProgressOnStart() = 0; |
| 91 | + virtual void OnDisconnectFromServer( uint8 eSteamLoginFailure ) = 0; |
| 92 | + |
| 93 | + virtual void NeedConnectionProblemWaitScreen() = 0; |
| 94 | + virtual void ShowPasswordUI( char const *pchCurrentPW ) = 0; |
| 95 | + |
| 96 | +#if defined( _X360 ) && defined( _DEMO ) |
| 97 | + virtual void OnDemoTimeout( void ) = 0; |
| 98 | +#endif |
| 99 | +}; |
| 100 | + |
| 101 | +#define GAMEUI_INTERFACE_VERSION "GameUI011" |
| 102 | + |
| 103 | +#endif // IGAMEUI_H |
0 commit comments