app tweaks
This commit is contained in:
@@ -76,7 +76,7 @@ local function dropOff()
|
|||||||
local inv = turtle.getSummedInventory()
|
local inv = turtle.getSummedInventory()
|
||||||
for _, slot in pairs(inv) do
|
for _, slot in pairs(inv) do
|
||||||
if slot.count >= 16 then
|
if slot.count >= 16 then
|
||||||
if turtle.getFuelLevel() < 1000 then
|
if turtle.getFuelLevel() < 5000 then
|
||||||
turtle.refuel(slot.name, 16)
|
turtle.refuel(slot.name, 16)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -41,9 +41,8 @@ local page = UI.Page {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name = 'config',
|
name = 'config',
|
||||||
text = '\206',
|
text = '\187',
|
||||||
x = -3,
|
x = -3,
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
infoBar = UI.StatusBar {
|
infoBar = UI.StatusBar {
|
||||||
@@ -72,6 +71,8 @@ local page = UI.Page {
|
|||||||
backgroundFocusColor = colors.cyan,
|
backgroundFocusColor = colors.cyan,
|
||||||
accelerators = {
|
accelerators = {
|
||||||
[ 'enter' ] = 'eject',
|
[ 'enter' ] = 'eject',
|
||||||
|
[ 'up' ] = 'grid_up',
|
||||||
|
[ 'down' ] = 'grid_down',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
amount = UI.TextEntry {
|
amount = UI.TextEntry {
|
||||||
@@ -414,6 +415,12 @@ shell.openForegroundTab('packages/milo/MiloRemote')]])
|
|||||||
self:refresh('scan')
|
self:refresh('scan')
|
||||||
self.grid:draw()
|
self.grid:draw()
|
||||||
|
|
||||||
|
elseif event.type == 'grid_up' then
|
||||||
|
self.grid:emit({ type = 'scroll_up' })
|
||||||
|
|
||||||
|
elseif event.type == 'grid_down' then
|
||||||
|
self.grid:emit({ type = 'scroll_down' })
|
||||||
|
|
||||||
elseif event.type == 'refresh' then
|
elseif event.type == 'refresh' then
|
||||||
self:setFocus(self.statusBar.filter)
|
self:setFocus(self.statusBar.filter)
|
||||||
self:refresh('list')
|
self:refresh('list')
|
||||||
|
|||||||
@@ -57,16 +57,29 @@ end
|
|||||||
end
|
end
|
||||||
|
|
||||||
function craftTask:cycle()
|
function craftTask:cycle()
|
||||||
|
local playSound = true
|
||||||
|
|
||||||
for _,key in pairs(Util.keys(context.craftingQueue)) do
|
for _,key in pairs(Util.keys(context.craftingQueue)) do
|
||||||
local item = context.craftingQueue[key]
|
local item = context.craftingQueue[key]
|
||||||
if item.requested - item.crafted > 0 then
|
if item.requested - item.crafted > 0 then
|
||||||
local recipe = Craft.findRecipe(key)
|
local recipe = Craft.findRecipe(key)
|
||||||
if recipe then
|
if recipe then
|
||||||
Sound.play('entity.experience_orb.pickup')
|
|
||||||
self:craft(recipe, item)
|
if playSound then
|
||||||
if item.callback and item.crafted >= item.requested then
|
Sound.play('entity.experience_orb.pickup')
|
||||||
item.callback(item) -- invoke callback
|
playSound = false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self:craft(recipe, item)
|
||||||
|
|
||||||
|
if item.crafted >= item.requested then
|
||||||
|
item.status = 'crafted'
|
||||||
|
item.statusCode = Craft.STATUS_SUCCESS
|
||||||
|
if item.callback then
|
||||||
|
item.callback(item) -- invoke callback
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
elseif not context.controllerAdapter then
|
elseif not context.controllerAdapter then
|
||||||
item.status = '(no recipe)'
|
item.status = '(no recipe)'
|
||||||
item.statusCode = Craft.STATUS_ERROR
|
item.statusCode = Craft.STATUS_ERROR
|
||||||
|
|||||||
Reference in New Issue
Block a user