adapt mainline lua and embedded lua to the deprecations I made...
...in 2012-02-07T23:27:51Z!anonymissimus@arcor.de (no occurrences in other files...)
This commit is contained in:
parent
a637b4b20d
commit
b13e6e13a7
2 changed files with 6 additions and 7 deletions
|
@ -85,7 +85,7 @@
|
|||
local function all_sides()
|
||||
local function f(s, i)
|
||||
i = i + 1
|
||||
local t = wesnoth.get_side(i)
|
||||
local t = wesnoth.sides[i]
|
||||
return t and i, t
|
||||
end
|
||||
return f, nil, 0
|
||||
|
|
|
@ -566,22 +566,21 @@ end
|
|||
first_time_only=no
|
||||
[lua]
|
||||
code=<<
|
||||
local function my_lua_action(t)
|
||||
local wml_actions = wesnoth.wml_actions
|
||||
function wml_actions.my_lua_action(t)
|
||||
wesnoth.fire("label", { text =
|
||||
string.format("Lua says:\n%d units and %d gold on side %d",
|
||||
#wesnoth.get_units { side = t.on_side },
|
||||
wesnoth.get_side(t.on_side).gold,
|
||||
wesnoth.sides[t.on_side].gold,
|
||||
t.on_side),
|
||||
x = t.x, y = t.y })
|
||||
end
|
||||
wesnoth.register_wml_action("my_lua_action", my_lua_action)
|
||||
local function check_substitution(t)
|
||||
function wml_actions.check_substitution(t)
|
||||
wesnoth.set_variable("substitution_variable", 1)
|
||||
if t.value ~= "Number 2" then
|
||||
wesnoth.message("Substitution is not delayed! " .. tostring(t.value))
|
||||
end
|
||||
end
|
||||
wesnoth.register_wml_action("check_substitution", check_substitution)
|
||||
local function get_child(cfg, name)
|
||||
for i = 1, #cfg do
|
||||
local v = cfg[i]
|
||||
|
@ -627,7 +626,7 @@ end
|
|||
[lua]
|
||||
code=<<
|
||||
local args = ...
|
||||
local team = wesnoth.get_side(args.side);
|
||||
local team = wesnoth.sides[args.side];
|
||||
team.gold = team.gold + args.gold;
|
||||
>>
|
||||
[args]
|
||||
|
|
Loading…
Add table
Reference in a new issue