tibia-client/modules/core/util.lua

32 lines
739 B
Lua
Raw Normal View History

2011-08-20 22:30:41 +02:00
function print(...)
local msg = ""
for i,v in ipairs(arg) do
msg = msg .. tostring(v) .. "\t"
end
Logger.log(LogInfo, msg)
2011-08-21 03:01:46 +02:00
end
function createEnvironment()
local env = { }
setmetatable(env, { __index = _G} )
return env
end
function connect(object, signalsAndSlots)
for signal,slot in pairs(signalsAndSlots) do
if not object[signal] then
object[signal] = slot
elseif type(object[signal]) == 'function' then
object[signal] = { object[signal], slot }
elseif type(object[signal]) == 'table' then
table.insert(object[signal], #object[signal]+1, slot)
end
end
end
2011-11-01 19:32:48 +01:00
function dumpWidgets()
for i=1,UI.root:getChildCount() do
print(UI.root:getChildByIndex(i):getId())
end
end