summaryrefslogtreecommitdiff
path: root/scripting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scripting.cpp')
-rw-r--r--scripting.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripting.cpp b/scripting.cpp
index ed671a2..520ee9d 100644
--- a/scripting.cpp
+++ b/scripting.cpp
@@ -27,6 +27,10 @@ void Lua::set_log_func(boost::function<void (const char*)> log_func) {
log_func("Lua::set_log_func() called");
}
+void Lua::set_say_func(boost::function<void (const char*)> say_func) {
+ this->say_func = say_func;
+}
+
void Lua::print(const char *s) {
if(log_func)
log_func(s);
@@ -34,6 +38,10 @@ void Lua::print(const char *s) {
std::cout << s << std::endl;
}
+void Lua::say(const char *s) {
+ say_func(s);
+}
+
void Lua::dostring(std::string s) {
int before = lua_gettop(L);
int err = luaL_dostring(L, s.c_str());