mirror of
https://github.com/edubart/otclient.git
synced 2025-04-29 17:19:20 +02:00

* Added new left and right game button panels. * Relocated main game toggle buttons to the right side of the screen to make it easier to toggle miniwindows. * Added table.empty(t) function to table lib. * Renamed module game_healthbar to game_healthinfo. * Combat controls now save per character (e.g. Fight mode, chase mode, safe fight mode) * Last channels open now save per character. * Fixed typo in containers.lua. * Added logout prompting window message when you logout via the logout button. * Added exit promting window message when you attempt to exit the client. * Repositioned some minimap buttons. * Fixed so when creatures health percent is < 1 it will not draw the creature information. Known Issues: * If you move a container widget into the map rect if you move an item onto itself it will allow this to execute still dropping the item on the ground. * The server is calling to open channels after onGameStart is executed causing it to focus the last tab opened. Fix: Don't save channels to the settings that are opened by the server.
66 lines
1.1 KiB
Lua
66 lines
1.1 KiB
Lua
-- @docclass table
|
|
|
|
function table.dump(t, depth)
|
|
if not depth then depth = 0 end
|
|
for k,v in pairs(t) do
|
|
str = (' '):rep(depth * 2) .. k .. ': '
|
|
if type(v) ~= "table" then
|
|
print(str .. tostring(v))
|
|
else
|
|
print(str)
|
|
table.dump(v, depth+1)
|
|
end
|
|
end
|
|
end
|
|
|
|
function table.copy(t)
|
|
local res = {}
|
|
for k,v in pairs(t) do
|
|
res[k] = v
|
|
end
|
|
return res
|
|
end
|
|
|
|
function table.selectivecopy(t, keys)
|
|
local res = { }
|
|
for i,v in ipairs(keys) do
|
|
res[v] = t[v]
|
|
end
|
|
return res
|
|
end
|
|
|
|
function table.merge(t, src)
|
|
for k,v in pairs(src) do
|
|
t[k] = v
|
|
end
|
|
end
|
|
|
|
function table.find(t, value)
|
|
for k,v in pairs(t) do
|
|
if v == value then return k end
|
|
end
|
|
end
|
|
|
|
function table.removevalue(t, value)
|
|
for k,v in pairs(t) do
|
|
if v == value then
|
|
table.remove(t, k)
|
|
break
|
|
end
|
|
end
|
|
end
|
|
|
|
function table.compare(t, other)
|
|
if #t ~= #other then return false end
|
|
for k,v in pairs(t) do
|
|
if v ~= other[k] then return false end
|
|
end
|
|
return true
|
|
end
|
|
|
|
function table.empty(t)
|
|
if(t) then
|
|
return next(t) == nil
|
|
end
|
|
return true
|
|
end |