This commit is contained in:
kepler155c
2018-10-26 06:19:34 -04:00
parent 2be14cdd43
commit 6dde2245a6
14 changed files with 133 additions and 74 deletions

View File

@@ -40,9 +40,10 @@ end
local listingPage = UI.Page {
menuBar = UI.MenuBar {
buttons = {
{ text = 'Learn', event = 'learn' },
{ text = 'Forget', event = 'forget' },
{ text = 'Craft', event = 'craft' },
{ text = 'Learn', event = 'learn' },
{ text = 'Forget', event = 'forget' },
{ text = 'Craft', event = 'craft' },
{ text = '...', event = 'machines' },
{ text = 'Refresh', event = 'refresh', x = -9 },
},
},
@@ -134,7 +135,12 @@ function listingPage:eventHandler(event)
elseif event.type == 'eject' then
local item = self.grid:getSelected()
if item then
queue(function() Milo:eject(item, 1) end)
queue(function()
Milo:eject(item, 1)
local updated = Milo:getItem(Milo:listItems(), item)
item.count = updated and updated.count or 0
self.grid:draw()
end)
end
elseif event.type == 'eject_stack' then
@@ -225,7 +231,7 @@ function listingPage:enable()
end
function listingPage:refresh()
self.allItems = context.inventoryAdapter:refresh()
self.allItems = Milo:refreshItems()
Milo:mergeResources(self.allItems)
self:applyFilter()
end