Code:
local lado = 'vertical'
local sbw -- window widget
local sbb -- button ./\ widget
local spellBarWindow -- UIWindow
function init()
sbb = modules.client_topmenu.addRightGameToggleButton('sbb', 'Spell Bar' , 'SpellBar.png', toggle)
sbw = g_ui.displayUI('SpellBar')
g_mouse.bindPress(sbw, function() createMenu() end, MouseRightButton)
sbw:hide()
end
function toggle()
if sbb:isOn() then
sbw:hide()
sbb:setOn(false)
else
sbw:show()
getSpells(spells)
sbb:setOn(true)
end
end
function createMenu()
local menu = g_ui.createWidget('PopupMenu')
if lado == 'horizontal' then
menu:addOption('Set Vertical', function()
lado = 'vertical'
getSpells(tabela)
end,nil)
else
addOption('Set Horizontal',function()
lado = 'horizontal'
getSpells(tabela)
end,nil)
end
menu:addSeparator()
menu:display()
end
attempt to call global 'addOption' (a nil value)
stack traceback:
[C]: in function 'addOption'