IgorTimofeev / MineOS

Home of MineOS and it's software for OpenComputers mod
Other
739 stars 191 forks source link

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

Closed cadergator10 closed 1 year ago

cadergator10 commented 1 year ago

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
IgorTimofeev commented 1 year ago

Thx, fixed