summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2014-10-05 15:46:50 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2014-10-05 15:46:50 +0200
commit1b250f668bf31bdfc9d4e7975daa23f3474c298a (patch)
treece2747a7af60d7f5523fb80044d90cf28f5e3a1b /src/control
parent36d4c9298f4be2d1c1fb803dc16948e3c11a3a49 (diff)
downloadrpgedit-1b250f668bf31bdfc9d4e7975daa23f3474c298a.tar
rpgedit-1b250f668bf31bdfc9d4e7975daa23f3474c298a.zip
Implement mappings for Lua types
Diffstat (limited to 'src/control')
-rw-r--r--src/control/ScriptContext.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/control/ScriptContext.hpp b/src/control/ScriptContext.hpp
index 23f0fab..86c8c0f 100644
--- a/src/control/ScriptContext.hpp
+++ b/src/control/ScriptContext.hpp
@@ -26,6 +26,8 @@
#pragma once
+#include "../model/ScriptValue.hpp"
+
extern "C" {
#include <lua.h>
#include <lualib.h>
@@ -100,6 +102,11 @@ public:
lua_close(L);
}
+ void setGlobal(const std::string &key, Model::ScriptValue *value) {
+ value->push(L);
+ lua_setglobal(L, key.c_str());
+ }
+
void load(const std::string &name) {
std::string filename = "../resources/script/" + name + ".lua";