mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-02 14:12:36 +00:00

thonsew: The lua interface is not your playground. This is not the way I want the lua files or its C++ interface to be modified. You are invited to talk with me on IRC. some of the main reasons: -Your revisions contain lots of unneccessary changes, some of which break existing lua or wml without a reason. Do you ever look at the diffs? -Your revisions pack a lot of unrelated stuff together into one. 2011-09-21T21:44:58Z!thonsew@yahoo.com makes sense in some parts and is what you should have done in the first place.
36 lines
717 B
Lua
36 lines
717 B
Lua
--! #textdomain wesnoth
|
|
|
|
-- This file provides an implementation of all the Lua functions removed
|
|
-- from the engine between 1.8 and 1.10.
|
|
|
|
function wesnoth.get_side(i)
|
|
return wesnoth.sides[i]
|
|
end
|
|
|
|
function wesnoth.get_side_count()
|
|
return #wesnoth.sides
|
|
end
|
|
|
|
function wesnoth.get_unit_type_ids()
|
|
local t = {}
|
|
for k,v in pairs(wesnoth.unit_types) do
|
|
table.insert(t, k)
|
|
end
|
|
table.sort(t)
|
|
return t
|
|
end
|
|
|
|
function wesnoth.get_unit_type(t)
|
|
return wesnoth.unit_types[t]
|
|
end
|
|
|
|
function wesnoth.register_wml_action(name, handler)
|
|
local old = wesnoth.wml_actions[name]
|
|
wesnoth.wml_actions[name] = handler
|
|
return old
|
|
end
|
|
|
|
function wesnoth.fire(name, cfg)
|
|
wesnoth.wml_actions[name](wesnoth.tovconfig(cfg or {}))
|
|
end
|