From 7b5a6b820d5acef36d402bd5a52d783ec68d33c7 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 6 Apr 2008 14:13:36 +0000 Subject: mouse grabbing, Cvar and Func info --- src/core/func.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/core/func.h') diff --git a/src/core/func.h b/src/core/func.h index e34e32d..2c02599 100644 --- a/src/core/func.h +++ b/src/core/func.h @@ -30,7 +30,7 @@ public: enum Flags {Game=1}; /// create a new function - Func(char const * funcname, void *ptr, unsigned int funcflags = 0); + Func(char const * name, void *ptr, unsigned int flags = 0); ~Func(); @@ -42,8 +42,14 @@ public: /// returns the name of the function inline std::string const &name() const { return func_name; } + /// returns the info of the function + inline std::string const &info() { return func_info; } + /*----- mutators -------------------------------------------------- */ + /// set the info string + void set_info(const char *); + /// execute the function if the Game flag is not set void exec(std::string const &args); @@ -53,10 +59,10 @@ public: /* ---- Static functions for the Func registry -------------------- */ /// add a function to the registry - static void add(const char *name, FuncPtr functionptr, unsigned int flags=0); + static Func *add(const char *name, FuncPtr functionptr, unsigned int flags=0); /// add a game function to the registry and set the Game flag - static void add(const char *name, GameFuncPtr functionptr, unsigned int flags=0); + static Func *add(const char *name, GameFuncPtr functionptr, unsigned int flags=0); /// remove a function from the registry static void remove(const char *name); @@ -75,6 +81,7 @@ public: private: std::string func_name; + std::string func_info; unsigned int func_flags; void *func_ptr; }; -- cgit v1.2.3