Rename get_time_stamp to ms_since_init

This better reflects what it actually does - it is not and has never been a timestamp.
This commit is contained in:
Celtic Minstrel 2021-04-24 15:48:27 -04:00
parent a09f88c1c9
commit 7e1f3bc27f
2 changed files with 3 additions and 2 deletions

View file

@ -73,6 +73,7 @@ end
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)
if wesnoth.kernel_type() == "Game Lua Kernel" then
-- wesnoth.wml_actions.music doesn't exist yet at this point, so create a helper function instead.
wesnoth.set_music = wesnoth.deprecate_api('wesnoth.set_music', 'wesnoth.music_list', 1, nil, function(cfg)

View file

@ -349,7 +349,7 @@ static int intf_get_image_size(lua_State *L) {
* Returns the time stamp, exactly as [set_variable] time=stamp does.
* - Ret 1: integer
*/
static int intf_get_time_stamp(lua_State *L) {
static int intf_ms_since_init(lua_State *L) {
lua_pushinteger(L, SDL_GetTicks());
return 1;
}
@ -456,7 +456,7 @@ lua_kernel_base::lua_kernel_base()
{ "name_generator", &intf_name_generator },
{ "log", &intf_log },
{ "get_image_size", &intf_get_image_size },
{ "get_time_stamp", &intf_get_time_stamp },
{ "ms_since_init", &intf_ms_since_init },
{ "get_language", &intf_get_language },
{ nullptr, nullptr }
};