mirror of
https://github.com/S4mpsa/InfOS.git
synced 2025-08-03 09:56:01 -04:00
Fixing toggleMultiblockUsecase
Referencing self so the multiblock class can pass the call to the machine
This commit is contained in:
parent
415ffe0fff
commit
eab8f35791
@ -216,8 +216,8 @@ function widget.createMachineWidget(address, name)
|
||||
end
|
||||
|
||||
local toggleMultiblockWork = require("domain.multiblock.toggle-multiblock-work")
|
||||
local function onClick()
|
||||
toggleMultiblockWork(address)
|
||||
local function onClick(self)
|
||||
toggleMultiblockWork(address, self.name)
|
||||
end
|
||||
|
||||
local machineWidget = {
|
||||
|
@ -5,8 +5,8 @@ Alarm = require("api.sound.alarm")
|
||||
|
||||
local function exec(address, name)
|
||||
local multiblock = Machine.getMachine(address, name, Machine.types.multiblock)
|
||||
local workAllowed = multiblock.isWorkAllowed()
|
||||
multiblock.setWorkAllowed(not workAllowed)
|
||||
local workAllowed = multiblock:isWorkAllowed()
|
||||
multiblock:setWorkAllowed(not workAllowed)
|
||||
end
|
||||
|
||||
return exec
|
||||
|
Loading…
x
Reference in New Issue
Block a user