There were some old functions that are now covered by the wesnoth.scenario module, so deprecate them

This commit is contained in:
Celtic Minstrel 2021-05-15 15:47:27 -04:00
parent 63bb15b94e
commit 3c8de46771
3 changed files with 13 additions and 29 deletions

View file

@ -94,3 +94,16 @@ unpack = wesnoth.deprecate_api('unpack', 'table.unpack', 3, '1.17', table.unpack
math.pow = wesnoth.deprecate_api('math.pow', '^', 3, '1.17', function(a,b) return a ^ b end)
wesnoth.get_time_stamp = wesnoth.deprecate_api('wesnoth.get_time_stamp', 'wesnoth.ms_since_init', 1, nil, wesnoth.ms_since_init)
wesnoth.compare_versions = wesnoth.deprecate_api('wesnoth.compare_versions', 'wesnoth.version', 1, nil, compare_versions, 'Use wesnoth.version to construct a version object and compare using the normal Lua comparison operators')
wesnoth.set_next_scenario = wesnoth.deprecate_api('wesnoth.set_next_scenario', 'wesnoth.scenario.next', 1, nil, function(n)
wesnoth.scenario.next = n
end)
wesnoth.set_end_campaign_credits = wesnoth.deprecate_api('wesnoth.set_end_campaign_credits', 'wesnoth.scenario.show_credits', 1, nil, function(b)
wesnoth.scenario.show_credits = b
end)
wesnoth.set_end_campaign_text = wesnoth.deprecate_api('wesnoth.set_end_campaign_text', 'wesnoth.scenario.end_text, wesnoth.scenario.end_text_duration', 1, nil, function(t, d)
wesnoth.scenario.end_text = t
if type(d) == 'number' then
wesnoth.scenario.end_text_duration = d
end
end)

View file

@ -725,31 +725,6 @@ int game_lua_kernel::intf_clear_menu_item(lua_State *L)
return 0;
}
int game_lua_kernel::intf_set_end_campaign_credits(lua_State *L)
{
game_classification &classification = play_controller_.get_classification();
classification.end_credits = luaW_toboolean(L, 1);
return 0;
}
int game_lua_kernel::intf_set_end_campaign_text(lua_State *L)
{
game_classification &classification = play_controller_.get_classification();
classification.end_text = luaW_checktstring(L, 1);
if (lua_isnumber(L, 2)) {
classification.end_text_duration = static_cast<int> (lua_tonumber(L, 2));
}
return 0;
}
int game_lua_kernel::intf_set_next_scenario(lua_State *L)
{
deprecated_message("wesnoth.set_next_scenario", DEP_LEVEL::INDEFINITE, "");
gamedata().set_next_scenario(luaL_checkstring(L, 1));
return 0;
}
int game_lua_kernel::intf_shroud_op(lua_State *L, bool place_shroud)
{
@ -4083,9 +4058,6 @@ game_lua_kernel::game_lua_kernel(game_state & gs, play_controller & pc, reports
{ "replace_schedule", &dispatch<&game_lua_kernel::intf_replace_schedule > },
{ "select_hex", &dispatch<&game_lua_kernel::intf_select_hex > },
{ "set_time_of_day", &dispatch<&game_lua_kernel::intf_set_time_of_day > },
{ "set_end_campaign_credits", &dispatch<&game_lua_kernel::intf_set_end_campaign_credits > },
{ "set_end_campaign_text", &dispatch<&game_lua_kernel::intf_set_end_campaign_text > },
{ "set_next_scenario", &dispatch<&game_lua_kernel::intf_set_next_scenario > },
{ "simulate_combat", &dispatch<&game_lua_kernel::intf_simulate_combat > },
{ "synchronize_choice", &intf_synchronize_choice },
{ "synchronize_choices", &intf_synchronize_choices },

View file

@ -131,7 +131,6 @@ class game_lua_kernel : public lua_kernel_base
int intf_clear_menu_item(lua_State *L);
int intf_create_side(lua_State *L);
int intf_set_menu_item(lua_State *L);
int intf_set_next_scenario(lua_State *L);
int intf_shroud_op(lua_State *L, bool place_shroud);
int intf_simulate_combat(lua_State *L);
int intf_scroll_to_tile(lua_State *L);