Refresh page after import
This commit is contained in:
parent
269eaeb344
commit
e1fa432b64
@ -54,7 +54,7 @@ local function loadState(fname, node)
|
||||
return Storage:fromSerializable(ser)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
print("Controller must scan chests...")
|
||||
local nodeName = peripheral.getName(node)
|
||||
local storageChests = {peripheral.find("inventory")}
|
||||
@ -197,12 +197,14 @@ end
|
||||
|
||||
local function updatePageRender(state, pages)
|
||||
if state.nextPage ~= nil then
|
||||
local changingPage = state.nextPage ~= state.currentPage
|
||||
state.changingPage = state.nextPage ~= state.currentPage
|
||||
state.currentPage = state.nextPage
|
||||
state.nextPage = nil
|
||||
|
||||
state.monitor.clear()
|
||||
state._pageRender = pages[state.currentPage](state, changingPage)
|
||||
state._pageRender = pages[state.currentPage](state)
|
||||
else
|
||||
state.changingPage = false
|
||||
end
|
||||
end
|
||||
|
||||
@ -228,7 +230,7 @@ local function renderDefault(state, rootElement)
|
||||
end
|
||||
|
||||
local PAGES = {
|
||||
MAIN = function(state, newPage)
|
||||
MAIN = function(state)
|
||||
local found = ItemGroup.collectStacks(state.controller:find(function(stack)
|
||||
return not stack:isEmpty()
|
||||
end))
|
||||
@ -258,6 +260,7 @@ local PAGES = {
|
||||
end
|
||||
end
|
||||
end)
|
||||
state.nextPage = state.currentPage
|
||||
end
|
||||
)
|
||||
state.pageState[state.currentPage] = pageState
|
||||
|
Loading…
x
Reference in New Issue
Block a user