move WML [color_adjust] impl to lua
This commit is contained in:
parent
96c35f6560
commit
177b4d5da1
4 changed files with 18 additions and 9 deletions
|
@ -1355,6 +1355,10 @@ function wml_actions.scroll(cfg)
|
|||
wesnoth.scroll(cfg)
|
||||
end
|
||||
|
||||
function wml_actions.color_adjust(cfg)
|
||||
wesnoth.color_adjust(cfg)
|
||||
end
|
||||
|
||||
function wml_actions.redraw(cfg)
|
||||
local clear_shroud = cfg.clear_shroud
|
||||
|
||||
|
|
|
@ -555,15 +555,6 @@ WML_HANDLER_FUNCTION(clear_global_variable,/**/,pcfg)
|
|||
verify_and_clear_global_variable(pcfg);
|
||||
}
|
||||
|
||||
WML_HANDLER_FUNCTION(color_adjust, /*event_info*/, cfg)
|
||||
{
|
||||
game_display &screen = *resources::screen;
|
||||
|
||||
screen.adjust_color_overlay(cfg["red"], cfg["green"], cfg["blue"]);
|
||||
screen.invalidate_all();
|
||||
screen.draw(true,true);
|
||||
}
|
||||
|
||||
WML_HANDLER_FUNCTION(deprecated_message, /*event_info*/, cfg)
|
||||
{
|
||||
handle_deprecated_message( cfg.get_parsed_config() );
|
||||
|
|
|
@ -2723,6 +2723,18 @@ int game_lua_kernel::intf_remove_tile_overlay(lua_State *L)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int game_lua_kernel::intf_color_adjust(lua_State *L)
|
||||
{
|
||||
if (game_display_) {
|
||||
vconfig cfg(luaW_checkvconfig(L, 1));
|
||||
|
||||
game_display_->adjust_color_overlay(cfg["red"], cfg["green"], cfg["blue"]);
|
||||
game_display_->invalidate_all();
|
||||
game_display_->draw(true,true);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delays engine for a while.
|
||||
* - Arg 1: integer.
|
||||
|
@ -3191,6 +3203,7 @@ game_lua_kernel::game_lua_kernel(const config &cfg, CVideo * video, game_state &
|
|||
{ "allow_undo", boost::bind(&game_lua_kernel::intf_allow_undo, this, _1) },
|
||||
{ "clear_menu_item", boost::bind(&game_lua_kernel::intf_clear_menu_item, this, _1) },
|
||||
{ "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) },
|
||||
{ "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) },
|
||||
|
|
|
@ -123,6 +123,7 @@ class game_lua_kernel : public lua_kernel_base
|
|||
int intf_get_sides(lua_State* L);
|
||||
int intf_add_tile_overlay(lua_State *L);
|
||||
int intf_remove_tile_overlay(lua_State *L);
|
||||
int intf_color_adjust(lua_State *L);
|
||||
int intf_delay(lua_State *L);
|
||||
int intf_redraw(lua_State *L);
|
||||
int intf_replace_schedule(lua_State *l);
|
||||
|
|
Loading…
Add table
Reference in a new issue