Added a deprecation helper.
This commit is contained in:
parent
930cd8fe63
commit
406383792f
1 changed files with 11 additions and 0 deletions
|
@ -310,4 +310,15 @@ function helper.rand (possible_values)
|
|||
return result
|
||||
end
|
||||
|
||||
function helper.deprecate(msg, f)
|
||||
return function(...)
|
||||
if msg then
|
||||
wesnoth.message("WML warning", msg)
|
||||
-- trigger the message only once
|
||||
msg = nil
|
||||
end
|
||||
return f(...)
|
||||
end
|
||||
end
|
||||
|
||||
return helper
|
||||
|
|
Loading…
Add table
Reference in a new issue