From 48b4b813a51c374fce43a553608c67c6ca08ea37 Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Sun, 12 Jun 2011 21:51:47 +0200 Subject: Added a say() function to lua. --- scripting.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripting.cpp') 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 log_func) { log_func("Lua::set_log_func() called"); } +void Lua::set_say_func(boost::function 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()); -- cgit v1.2.3