What is Wrong?

lucas123

New Member
Joined
Jun 6, 2010
Messages
85
Best answers
0
Reaction score
4
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'
 

Quintinon

New Member
Joined
Aug 10, 2007
Messages
29
Best answers
0
Reaction score
0
the function addOption is not defined, I'm guessing you meant menu:addOption?
 
Top