Skip to content

Commit

Permalink
Now color_adjust takes three arguments instead of a config
Browse files Browse the repository at this point in the history
Consider it part of the public API now.
  • Loading branch information
CelticMinstrel committed Feb 21, 2021
1 parent acd13a3 commit 7fb688b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion data/lua/core/interface.lua
Expand Up @@ -52,8 +52,8 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then
wesnoth.get_displayed_unit = wesnoth.deprecate_api('wesnoth.get_displayed_unit', 'wesnoth.interface.get_displayed_unit', 1, nil, wesnoth.interface.get_displayed_unit)
wesnoth.zoom = wesnoth.deprecate_api('wesnoth.zoom', 'wesnoth.interface.zoom', 1, nil, wesnoth.interface.zoom)
wesnoth.gamestate_inspector = wesnoth.deprecate_api('wesnoth.gamestate_inspector', 'gui.show_inspector', 1, nil, gui.show_inspector)
wesnoth.color_adjust = deprecate_api('wesnoth.color_adjust', 'wesnoth.interface.color_adjust', 1, nil, wesnoth.interface.color_adjust)
-- No deprecation for these since since they're not actually public API yet
wesnoth.color_adjust = wesnoth.interface.color_adjust
wesnoth.set_menu_item = wesnoth.interface.set_menu_item
wesnoth.clear_menu_item = wesnoth.interface.clear_menu_item
end
2 changes: 1 addition & 1 deletion data/lua/wml-tags.lua
Expand Up @@ -762,7 +762,7 @@ function wml_actions.scroll(cfg)
end

function wml_actions.color_adjust(cfg)
wesnoth.interface.color_adjust(cfg)
wesnoth.interface.color_adjust(cfg.red, cfg.green, cfg.blue)
end

function wml_actions.end_turn(cfg)
Expand Down
4 changes: 1 addition & 3 deletions src/scripting/game_lua_kernel.cpp
Expand Up @@ -3410,9 +3410,7 @@ int game_lua_kernel::intf_remove_event(lua_State *L)
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_->adjust_color_overlay(luaL_checkinteger(L, 1), luaL_checkinteger(L, 2), luaL_checkinteger(L, 3));
game_display_->invalidate_all();
game_display_->draw(true,true);
}
Expand Down

0 comments on commit 7fb688b

Please sign in to comment.