From 1a4df4051b7ce7416725b5f2343445005b4a5234 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 24 Mar 2018 13:30:12 -0400 Subject: [PATCH] Deprecate helper.wml_error and move it to wml.error --- data/lua/core.lua | 7 +++++++ data/lua/helper.lua | 6 +----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/data/lua/core.lua b/data/lua/core.lua index ec8a1f535e1cd..ee98a934e0b39 100644 --- a/data/lua/core.lua +++ b/data/lua/core.lua @@ -232,6 +232,13 @@ function wesnoth.deprecate_api(elem_name, replacement, level, version, elem, det end if wesnoth.kernel_type() == "Game Lua Kernel" then + --[========[WML error helper]========] + + --! Interrupts the current execution and displays a chat message that looks like a WML error. + function wml.error(m) + error("~wml:" .. m, 0) + end + --[========[Basic variable access]========] -- Get all variables via wml.all_variables (read-only) diff --git a/data/lua/helper.lua b/data/lua/helper.lua index 564c59f9512b2..945a22accf4c1 100644 --- a/data/lua/helper.lua +++ b/data/lua/helper.lua @@ -19,11 +19,6 @@ function helper.get_sides(cfg) return f, { i = 0 } end ---! Interrupts the current execution and displays a chat message that looks like a WML error. -function helper.wml_error(m) - error("~wml:" .. m, 0) -end - --! Returns an iterator over teams that can be used in a for-in loop. function helper.all_teams() local function f(s) @@ -247,6 +242,7 @@ if wesnoth.kernel_type() == "Game Lua Kernel" then helper.get_variable_array = wesnoth.deprecate_api('helper.get_variable_array', ' wml.array_access.get', 1, nil, wml.array_access.get) helper.set_variable_array = wesnoth.deprecate_api('helper.set_variable_array', 'wml.array_access.set', 1, nil, wml.array_access.set) helper.get_variable_proxy_array = wesnoth.deprecate_api('helper.get_variable_proxy_array', 'wml.array_access.get_proxy', 1, nil, wml.array_access.get_proxy) + helper.wml_error = wesnoth.deprecate_api('helper.wml_error', 'wml.error', 1, nil, wml.error) end helper.literal = wesnoth.deprecate_api('helper.literal', 'wml.literal', 1, nil, wml.literal) helper.parsed = wesnoth.deprecate_api('helper.parsed', 'wml.parsed', 1, nil, wml.parsed)