Integrating with real machines

This commit is contained in:
Gabriel Moreira Minossi 2021-01-18 16:17:05 -03:00
parent c33589b2d3
commit fe955b91e6

View File

@ -201,7 +201,9 @@ function page.fake()
end
function page.setup(energyBufferAddress, multiblockAddresses)
elements.machineWidgets = Widget.fakeWidgets()
for name, address in pairs(multiblockAddresses) do
table.insert(elements.machineWidgets, Widget.createMachineWidget(address, name))
end
elements.powerWidget = Widget.createPowerWidget(energyBufferAddress)
page.create(pages.overview)
end
@ -211,7 +213,7 @@ function page.update()
machineWidget:update()
end
for index, activeMachineWidget in ipairs(elements.machineWidgets.active) do
activeMachineWidget.draw(activeMachineWidget, index)
activeMachineWidget:draw(index)
end
elements.powerWidget:update()