builder error on resupply page
This commit is contained in:
@@ -119,12 +119,8 @@ function supplyPage:enable(builder)
|
|||||||
|
|
||||||
Event.addNamedTimer('supplyRefresh', 6, true, function()
|
Event.addNamedTimer('supplyRefresh', 6, true, function()
|
||||||
if self.enabled then
|
if self.enabled then
|
||||||
debug('timer')
|
|
||||||
self.builder:autocraft(self.builder:getSupplies())
|
self.builder:autocraft(self.builder:getSupplies())
|
||||||
pcall(function()
|
self:refresh()
|
||||||
debug('refreshing')
|
|
||||||
self:refresh()
|
|
||||||
end)
|
|
||||||
self.statusBar:timedStatus('Refreshed ', 2)
|
self.statusBar:timedStatus('Refreshed ', 2)
|
||||||
self:sync()
|
self:sync()
|
||||||
end
|
end
|
||||||
@@ -133,7 +129,6 @@ debug('timer')
|
|||||||
end
|
end
|
||||||
|
|
||||||
function supplyPage:disable()
|
function supplyPage:disable()
|
||||||
debug('canceling')
|
|
||||||
Event.cancelNamedTimer('supplyRefresh')
|
Event.cancelNamedTimer('supplyRefresh')
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -158,6 +153,8 @@ function supplyPage:refresh()
|
|||||||
self.statusBar:timedStatus('Refreshed ', 3)
|
self.statusBar:timedStatus('Refreshed ', 3)
|
||||||
local supplies = self.builder:getSupplies()
|
local supplies = self.builder:getSupplies()
|
||||||
if #supplies == 0 then
|
if #supplies == 0 then
|
||||||
|
UI:setPage('blank')
|
||||||
|
self:sync()
|
||||||
self.builder:build()
|
self.builder:build()
|
||||||
else
|
else
|
||||||
self:setSupplies(supplies)
|
self:setSupplies(supplies)
|
||||||
|
|||||||
@@ -110,7 +110,8 @@ function ChestAdapter:getItemInfo(item)
|
|||||||
self:listItems()
|
self:listItems()
|
||||||
end
|
end
|
||||||
local key = table.concat({ item.name, item.damage, item.nbtHash }, ':')
|
local key = table.concat({ item.name, item.damage, item.nbtHash }, ':')
|
||||||
return self.cache[key]
|
local items = self.cache or { }
|
||||||
|
return items[key]
|
||||||
end
|
end
|
||||||
|
|
||||||
function ChestAdapter:getPercentUsed()
|
function ChestAdapter:getPercentUsed()
|
||||||
|
|||||||
@@ -723,6 +723,7 @@ function startPage:eventHandler(event)
|
|||||||
|
|
||||||
elseif event.type == 'begin' then
|
elseif event.type == 'begin' then
|
||||||
UI:setPage('blank')
|
UI:setPage('blank')
|
||||||
|
self:sync()
|
||||||
|
|
||||||
print('Reloading schematic')
|
print('Reloading schematic')
|
||||||
Builder:reloadSchematic(Util.throttle())
|
Builder:reloadSchematic(Util.throttle())
|
||||||
|
|||||||
Reference in New Issue
Block a user