This commit is contained in:
kepler155c
2018-10-29 22:00:59 -04:00
parent f24aeb135d
commit 871f44a170
10 changed files with 129 additions and 25 deletions

View File

@@ -14,7 +14,7 @@ local machineLearnWizard = UI.Page {
wizard = UI.Wizard {
y = 2, ey = -2,
pages = {
machine = UI.Window {
machines = UI.Window {
index = 1,
grid = UI.ScrollingGrid {
y = 2, ey = -2,
@@ -46,15 +46,23 @@ Example: Slot 1 is the top slot in a furnace.]],
local pages = machineLearnWizard.wizard.pages
local machine
function pages.machine.grid:getDisplayValues(row)
function pages.machines.grid:isRowValid(_, value)
return value.mtype == 'machine' and value.adapter and value.adapter.online
end
function pages.machines.grid:getDisplayValues(row)
row = Util.shallowCopy(row)
row.displayName = row.displayName or row.name
return row
end
function pages.machine:validate()
function pages.machines:enable()
self.grid:update()
UI.Window.enable(self)
end
function pages.machines:validate()
-- TODO: validation should only be invoked when moving forward (i think)
-- TODO: index number validation in wizard
local selected = self.grid:getSelected()