Lua API: Make wesnoth.game_config.debug writable in plugins
This commit is contained in:
parent
3387eb2c26
commit
40625ab26f
1 changed files with 10 additions and 0 deletions
|
@ -27,8 +27,10 @@
|
|||
#include "scripting/application_lua_kernel.hpp"
|
||||
|
||||
#include "config.hpp"
|
||||
#include "game_config.hpp"
|
||||
#include "game_errors.hpp"
|
||||
#include "log.hpp"
|
||||
#include "scripting/lua_attributes.hpp"
|
||||
#include "scripting/lua_common.hpp"
|
||||
#include "scripting/lua_cpp_function.hpp"
|
||||
#include "scripting/lua_fileops.hpp"
|
||||
|
@ -268,6 +270,14 @@ static int impl_context_accessor(lua_State * L, std::shared_ptr<lua_context_back
|
|||
}
|
||||
}
|
||||
|
||||
extern luaW_Registry& gameConfigReg();
|
||||
static auto& dummy = gameConfigReg(); // just to ensure it's constructed.
|
||||
|
||||
GAME_CONFIG_SETTER("debug", bool, application_lua_kernel) {
|
||||
(void)k;
|
||||
game_config::set_debug(value);
|
||||
}
|
||||
|
||||
static int intf_execute(lua_State* L)
|
||||
{
|
||||
static const int CTX = 1, FUNC = 2, EVT = 3, EXEC = 4;
|
||||
|
|
Loading…
Add table
Reference in a new issue