mirror of
https://github.com/edubart/otclient.git
synced 2025-10-15 03:54:54 +02:00
Fixes in options, hotkeys and viplist
This commit is contained in:
@@ -167,3 +167,17 @@ function table.tostring(t)
|
||||
end
|
||||
return str
|
||||
end
|
||||
|
||||
function table.collect(t, func)
|
||||
local res = {}
|
||||
for k,v in pairs(t) do
|
||||
local a,b = func(k,v)
|
||||
if a and b then
|
||||
res[a] = b
|
||||
elseif a ~= nil then
|
||||
table.insert(res,a)
|
||||
end
|
||||
end
|
||||
return res
|
||||
end
|
||||
|
||||
|
@@ -144,3 +144,11 @@ end
|
||||
function UITabBar:getCurrentTab()
|
||||
return self.currentTab
|
||||
end
|
||||
|
||||
function UITabBar:getTabs()
|
||||
return self.tabs
|
||||
end
|
||||
|
||||
function UITabBar:getTabsPanel()
|
||||
return table.collect(self.tabs, function(_,tab) return tab.tabPanel end)
|
||||
end
|
||||
|
Reference in New Issue
Block a user