diff options
author | Jon Bergli Heier <snakebite@jvnv.net> | 2011-06-12 21:51:47 +0200 |
---|---|---|
committer | Jon Bergli Heier <snakebite@jvnv.net> | 2011-06-12 21:51:47 +0200 |
commit | 48b4b813a51c374fce43a553608c67c6ca08ea37 (patch) | |
tree | 853cfe0c7551b44d3544f776e926e70e9382b121 /scripting.cpp | |
parent | b44b2cb4c16995d218e8d4c767c01c7b87c89816 (diff) |
Added a say() function to lua.
Diffstat (limited to 'scripting.cpp')
-rw-r--r-- | scripting.cpp | 8 |
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()); |