mirror of
https://github.com/S4mpsa/InfOS.git
synced 2025-09-07 22:26:34 -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
|
end
|
||||||
|
|
||||||
local toggleMultiblockWork = require("domain.multiblock.toggle-multiblock-work")
|
local toggleMultiblockWork = require("domain.multiblock.toggle-multiblock-work")
|
||||||
local function onClick()
|
local function onClick(self)
|
||||||
toggleMultiblockWork(address)
|
toggleMultiblockWork(address, self.name)
|
||||||
end
|
end
|
||||||
|
|
||||||
local machineWidget = {
|
local machineWidget = {
|
||||||
|
@ -5,8 +5,8 @@ Alarm = require("api.sound.alarm")
|
|||||||
|
|
||||||
local function exec(address, name)
|
local function exec(address, name)
|
||||||
local multiblock = Machine.getMachine(address, name, Machine.types.multiblock)
|
local multiblock = Machine.getMachine(address, name, Machine.types.multiblock)
|
||||||
local workAllowed = multiblock.isWorkAllowed()
|
local workAllowed = multiblock:isWorkAllowed()
|
||||||
multiblock.setWorkAllowed(not workAllowed)
|
multiblock:setWorkAllowed(not workAllowed)
|
||||||
end
|
end
|
||||||
|
|
||||||
return exec
|
return exec
|
||||||
|
Loading…
x
Reference in New Issue
Block a user