core/ConVarManager.h
changeset 582 00c843a1bb18
parent 580 416aecc7de51
child 653 ef60870067ff
     1.1 --- a/core/ConVarManager.h	Tue Mar 06 07:38:19 2007 +0000
     1.2 +++ b/core/ConVarManager.h	Tue Mar 06 23:59:25 2007 +0000
     1.3 @@ -51,7 +51,7 @@
     1.4  public: // IHandleTypeDispatch
     1.5  	void OnHandleDestroy(HandleType_t type, void *object);
     1.6  public: // IPluginsListener
     1.7 -	void OnPluginDestroyed(IPlugin *plugin);
     1.8 +	void OnPluginUnloaded(IPlugin *plugin);
     1.9  public: //IRootConsoleCommand
    1.10  	void OnRootConsoleCommand(const char *command, unsigned int argcount);
    1.11  public:
    1.12 @@ -74,8 +74,8 @@
    1.13  	/**
    1.14  	 * Create a convar and return a handle to it.
    1.15  	 */
    1.16 -	Handle_t CreateConVar(IPluginContext *pContext, const char *name, const char *defaultVal, const char *helpText,
    1.17 -	                      int flags, bool hasMin, float min, bool hasMax, float max);
    1.18 +	Handle_t CreateConVar(IPluginContext *pContext, const char *name, const char *defaultVal,
    1.19 +	                      const char *description, int flags, bool hasMin, float min, bool hasMax, float max);
    1.20  
    1.21  	/**
    1.22  	 * Searches for a convar and returns a handle to it
    1.23 @@ -85,14 +85,19 @@
    1.24  	/**
    1.25  	 * Add a function to call when the specified convar changes.
    1.26  	 */
    1.27 -	void HookConVarChange(IPluginContext *pContext, ConVar *pConVar, funcid_t funcid);
    1.28 +	void HookConVarChange(ConVar *pConVar, IPluginFunction *pFunction);
    1.29  
    1.30  	/**
    1.31  	 * Remove a function from the forward that will be called when the specified convar changes.
    1.32  	 */
    1.33 -	void UnhookConVarChange(IPluginContext *pContext, ConVar *pConVar, funcid_t funcid);
    1.34 +	void UnhookConVarChange(ConVar *pConVar, IPluginFunction *pFunction);
    1.35  private:
    1.36  	/**
    1.37 +	 * Adds a convar to a plugin's list.
    1.38 +	 */
    1.39 +	static void AddConVarToPluginList(IPluginContext *pContext, const ConVar *pConVar);
    1.40 +
    1.41 +	/**
    1.42  	 * Static callback that Valve's ConVar class executes when the convar's value changes.
    1.43  	 */
    1.44  	static void OnConVarChanged(ConVar *pConVar, const char *oldValue);