summaryrefslogtreecommitdiff
path: root/src/cat/LuaScriptInterface.h
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-06-06 02:56:00 (GMT)
committer jacob1 <jfu614@gmail.com>2013-06-06 02:56:00 (GMT)
commitc7ce3fa4b23bf14222af6403de36a501a05637a1 (patch)
tree223038cb2613c1ada37c21f4f256f45381356232 /src/cat/LuaScriptInterface.h
parent875ca75b07ad3e8e6e6241f98484140bd6d5fb1f (diff)
downloadpowder-c7ce3fa4b23bf14222af6403de36a501a05637a1.zip
powder-c7ce3fa4b23bf14222af6403de36a501a05637a1.tar.gz
make constants in the lua api's a lot easier to write
Diffstat (limited to 'src/cat/LuaScriptInterface.h')
-rw-r--r--src/cat/LuaScriptInterface.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cat/LuaScriptInterface.h b/src/cat/LuaScriptInterface.h
index 6556d35..ad0b70f 100644
--- a/src/cat/LuaScriptInterface.h
+++ b/src/cat/LuaScriptInterface.h
@@ -37,6 +37,11 @@ class Tool;
#define LUACON_EL_MODIFIED_GRAPHICS 0x2
#define LUACON_EL_MODIFIED_MENUS 0x4
+// idea from mniip, makes things much simpler
+#define SETCONST(L, NAME)\
+ lua_pushinteger(L, NAME);\
+ lua_setfield(L, -2, #NAME);
+
class TPTScriptInterface;
class LuaScriptInterface: public CommandInterface
{