mirror of
https://github.com/edubart/otclient.git
synced 2025-10-17 04:53:27 +02:00
Topmenu fix
* Will no longer duplicate topmenu buttons (no need to destroy in the module now) * Menu items will no longer change position when reloaded.
This commit is contained in:
@@ -14,11 +14,14 @@ local function addButton(id, description, icon, callback, panel, toggle, front)
|
||||
class = 'TopButton'
|
||||
end
|
||||
|
||||
local button = g_ui.createWidget(class)
|
||||
if front then
|
||||
panel:insertChild(1, button)
|
||||
else
|
||||
panel:addChild(button)
|
||||
local button = panel:getChildById(id)
|
||||
if not button then
|
||||
button = g_ui.createWidget(class)
|
||||
if front then
|
||||
panel:insertChild(1, button)
|
||||
else
|
||||
panel:addChild(button)
|
||||
end
|
||||
end
|
||||
button:setId(id)
|
||||
button:setTooltip(description)
|
||||
|
Reference in New Issue
Block a user