milo: categories, better listing page separation

This commit is contained in:
kepler155c@gmail.com
2018-12-01 00:52:39 -05:00
parent c5d209161e
commit e1084422e5
17 changed files with 146 additions and 96 deletions

View File

@@ -133,15 +133,12 @@ function turtleLearnWizard.wizard.pages.confirmation:validate()
local recipe, msg = learnRecipe(self)
if recipe then
local listingPage = UI:getPage('listing')
local displayName = itemDB:getName(recipe)
listingPage.statusBar.filter:setValue(displayName)
listingPage.notification:success('Learned: ' .. displayName)
listingPage.filter = displayName
listingPage:refresh()
listingPage.grid:draw()
UI:setPage('listing', {
filter = displayName,
message = 'Learned: ' .. displayName,
})
return true
else
turtleLearnWizard.notification:error(msg)
@@ -149,7 +146,8 @@ function turtleLearnWizard.wizard.pages.confirmation:validate()
end
function turtleLearnWizard:eventHandler(event)
if event.type == 'cancel' or event.type == 'accept' then
if event.type == 'cancel' then
turtle.emptyInventory()
UI:setPage('listing')
else
return UI.Page.eventHandler(self, event)