move wml [end_turn] impl to lua

This commit is contained in:
Chris Beck 2014-12-24 03:07:49 -05:00
parent 177b4d5da1
commit 29da15e1c0
4 changed files with 12 additions and 5 deletions

View file

@ -1359,6 +1359,10 @@ function wml_actions.color_adjust(cfg)
wesnoth.color_adjust(cfg)
end
function wml_actions.end_turn(cfg)
wesnoth.end_turn()
end
function wml_actions.redraw(cfg)
local clear_shroud = cfg.clear_shroud

View file

@ -670,11 +670,6 @@ WML_HANDLER_FUNCTION(endlevel, /*event_info*/, cfg)
}
}
WML_HANDLER_FUNCTION(end_turn, /*event_info*/, /*cfg*/)
{
resources::controller->force_end_turn();
}
/// Adding new events
WML_HANDLER_FUNCTION(event, /*event_info*/, cfg)
{

View file

@ -1455,6 +1455,12 @@ int game_lua_kernel::intf_clear_messages(lua_State*)
return 0;
}
int game_lua_kernel::intf_end_turn(lua_State*)
{
play_controller_.force_end_turn();
return 0;
}
/**
* Evaluates a boolean WML conditional.
* - Arg 1: WML table.
@ -3205,6 +3211,7 @@ game_lua_kernel::game_lua_kernel(const config &cfg, CVideo * video, game_state &
{ "clear_messages", boost::bind(&game_lua_kernel::intf_clear_messages, this, _1) },
{ "color_adjust", boost::bind(&game_lua_kernel::intf_color_adjust, this, _1) },
{ "delay", boost::bind(&game_lua_kernel::intf_delay, this, _1) },
{ "end_turn", boost::bind(&game_lua_kernel::intf_end_turn, this, _1) },
{ "extract_unit", boost::bind(&game_lua_kernel::intf_extract_unit, this, _1) },
{ "find_cost_map", boost::bind(&game_lua_kernel::intf_find_cost_map, this, _1) },
{ "find_path", boost::bind(&game_lua_kernel::intf_find_path, this, _1) },

View file

@ -99,6 +99,7 @@ class game_lua_kernel : public lua_kernel_base
int impl_game_config_set(lua_State *L);
int impl_current_get(lua_State *L);
int intf_clear_messages(lua_State*);
int intf_end_turn(lua_State*);
int intf_find_path(lua_State *L);
int intf_find_reach(lua_State *L);
int intf_find_cost_map(lua_State *L);