IgorTimofeev/MineOS

ComboBox buttons' onTouch callbacks don't pass itself when pressed

cadergator10 opened this issue · 2 comments

I have the following code adding items to a combo box:

local cur = guiCalls[i][1]:addItem("none")
cur.callbackInt = i + #baseVariables
cur.onTouch = buttonCallback
--more lines of code below this for other stuff

and my button callback:

local function buttonCallback(workspace, button)
    local buttonInt, callbackInt, isPos
    if button ~= nil then --button is equal to nil, so not run
      buttonInt = button.buttonInt
      callbackInt = button.callbackInt
      isPos = button.isPos
    end
--more lines of code below this

Thx, fixed