exposed config::debug() in the lua interface

The functionality is actually covered by the dbms function
I wrote in the WLP, but may be easier to find and use. It would have
been useful for me at least, until I had written that function.
This commit is contained in:
Anonymissimus 2011-10-12 21:44:42 +00:00
parent 737123706d
commit ac8cdfd23e

View file

@ -1937,6 +1937,19 @@ static int intf_message(lua_State *L)
return 0;
}
/**
* Dumps a wml table or userdata wml object into a pretty string.
* - Arg 1: wml table or vconfig userdata
* - Ret 1: string
*/
static int intf_debug(lua_State* L)
{
const config& arg = luaW_checkconfig(L, 1);
const std::string& result = arg.debug();
lua_pushstring(L, result.c_str());
return 1;
}
/**
* Removes all messages from the chat window.
*/
@ -3393,6 +3406,7 @@ LuaKernel::LuaKernel(const config &cfg)
{ "compare_versions", &intf_compare_versions },
{ "copy_unit", &intf_copy_unit },
{ "create_unit", &intf_create_unit },
{ "debug", &intf_debug },
{ "delay", &intf_delay },
{ "dofile", &intf_dofile },
{ "eval_conditional", &intf_eval_conditional },