summaryrefslogtreecommitdiff
path: root/common/IVguiModule.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/IVguiModule.h')
-rw-r--r--common/IVguiModule.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/common/IVguiModule.h b/common/IVguiModule.h
new file mode 100644
index 0000000..9e87d22
--- /dev/null
+++ b/common/IVguiModule.h
@@ -0,0 +1,64 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef IVGUIMODULE_H
+#define IVGUIMODULE_H
+#ifdef _WIN32
+#pragma once
+#endif
+
+#include "interface.h"
+#include <vgui/VGUI.h>
+
+//-----------------------------------------------------------------------------
+// Purpose: Standard interface to loading vgui modules
+//-----------------------------------------------------------------------------
+abstract_class IVGuiModule : public IBaseInterface
+{
+public:
+ // called first to setup the module with the vgui
+ // returns true on success, false on failure
+ virtual bool Initialize(CreateInterfaceFn *vguiFactories, int factoryCount) = 0;
+
+ // called after all the modules have been initialized
+ // modules should use this time to link to all the other module interfaces
+ virtual bool PostInitialize(CreateInterfaceFn *modules, int factoryCount) = 0;
+
+ // called when the module is selected from the menu or otherwise activated
+ virtual bool Activate() = 0;
+
+ // returns true if the module is successfully initialized and available
+ virtual bool IsValid() = 0;
+
+ // requests that the UI is temporarily disabled and all data files saved
+ virtual void Deactivate() = 0;
+
+ // restart from a Deactivate()
+ virtual void Reactivate() = 0;
+
+ // called when the module is about to be shutdown
+ virtual void Shutdown() = 0;
+
+ // returns a handle to the main module panel
+ virtual vgui::VPANEL GetPanel() = 0;
+
+ // sets the parent of the main module panel
+ virtual void SetParent(vgui::VPANEL parent) = 0;
+
+ // messages sent through through the panel returned by GetPanel():
+ //
+ // "ConnectedToGame" "ip" "port" "gamedir"
+ // "DisconnectedFromGame"
+ // "ActiveGameName" "name"
+ // "LoadingStarted" "type" "name"
+ // "LoadingFinished" "type" "name"
+};
+
+#define VGUIMODULE_INTERFACE_VERSION "VGuiModule002"
+
+
+#endif // IVGUIMODULE_H