recipe reorg + milo fixes

This commit is contained in:
kepler155c
2018-11-19 13:52:32 -05:00
parent 2605410c6d
commit 6b11b29bba
13 changed files with 36 additions and 22 deletions

View File

@@ -10,6 +10,8 @@
\030 \031f\030f\031f\128\0317\143\031f\128\128\0317\143\031f\128\128\128", \030 \031f\030f\031f\128\0317\143\031f\128\128\0317\143\031f\128\128\128",
run = "Turtles.lua", run = "Turtles.lua",
}, },
--[[
Needs work
[ "381e3298b2b8f6caeb2208b57d805ada38402f0b" ] = { [ "381e3298b2b8f6caeb2208b57d805ada38402f0b" ] = {
title = "Scripts", title = "Scripts",
category = "Apps", category = "Apps",
@@ -21,6 +23,7 @@
\0300\0317else\140", \0300\0317else\140",
run = "Script.lua", run = "Script.lua",
}, },
]]
c5497bca58468ae64aed6c0fd921109217988db3 = { c5497bca58468ae64aed6c0fd921109217988db3 = {
title = "Events", title = "Events",
category = "System", category = "System",

View File

@@ -67,6 +67,10 @@ if not modem or not modem.getNameLocal then
Syntax('Wired modem missing') Syntax('Wired modem missing')
end end
if not modem.getNameLocal() then
Syntax('Wired modem is not active')
end
local introspection = Peripheral.get('plethora:introspection') or local introspection = Peripheral.get('plethora:introspection') or
Syntax('Introspection module missing') Syntax('Introspection module missing')

View File

@@ -143,20 +143,19 @@ function networkPage:disable()
end end
function networkPage:applyFilter() function networkPage:applyFilter()
local t = context.config.nodes local t = Util.filter(context.config.nodes, function(v)
local filter = self.filter.value return not v.hidden
end)
if #filter > 0 then if #self.filter.value > 0 then
t = { } local filter = self.filter.value:lower()
filter = filter:lower() Util.filterInplace(t, function(v)
return v.displayName and
for _,v in pairs(context.config.nodes) do string.find(string.lower(v.displayName), filter, 1, true) or
if (v.displayName and string.find(string.lower(v.displayName), filter, 1, true)) or string.find(string.lower(v.name), filter, 1, true)
string.find(string.lower(v.name), filter, 1, true) then end)
table.insert(t, v)
end
end
end end
self.grid:setValues(t) self.grid:setValues(t)
end end
@@ -391,10 +390,12 @@ function nodeWizard.wizard.pages.general:showInventory(node)
local inventory local inventory
if device[node.name] and device[node.name].list then if device[node.name] and device[node.name].list then
inventory = device[node.name].list() pcall(function()
for k,v in pairs(inventory) do inventory = device[node.name].list()
v.slot = k for k,v in pairs(inventory) do
end v.slot = k
end
end)
end end
self.grid:setValues(inventory or { }) self.grid:setValues(inventory or { })
@@ -438,16 +439,17 @@ function nodeWizard:enable(node)
self.node.adapter = adapter self.node.adapter = adapter
node.adapter = adapter node.adapter = adapter
_G._p3 = self.node _G._p3 = self.node -- TODO: remove - debugging
local choices = { local choices = {
{ name = 'Ignore', value = 'ignore' }, { name = 'Ignore', value = 'ignore', '' },
{ name = 'Hidden', value = 'hidden', 'Do not show in list' },
} }
for _, page in pairs(self.wizard.pages) do for _, page in pairs(self.wizard.pages) do
if page.isValidType then if page.isValidType then
local choice = page:isValidType(self.node) local choice = page:isValidType(self.node)
if choice and not Util.find(choices, 'value', choice.value) then if choice and not Util.find(choices, 'value', choice.value) then
table.insert(choices, choice) table.insert(choices, 2, choice)
end end
end end
end end

View File

@@ -252,15 +252,20 @@ function listingPage:enable()
self:sync() self:sync()
end) end)
self.handler = Event.on({ 'storage_offline', 'storage_online' }, function(_, isOnline) local function updateStatus()
self.statusBar.storageStatus.value = self.statusBar.storageStatus.value =
isOnline and '' or 'offline' context.storage:isOnline() and '' or 'offline'
self.statusBar.storageStatus.textColor = self.statusBar.storageStatus.textColor =
isOnline and colors.lime or colors.red context.storage:isOnline() and colors.lime or colors.red
end
self.handler = Event.on({ 'storage_offline', 'storage_online' }, function()
updateStatus()
self.statusBar.storageStatus:draw() self.statusBar.storageStatus:draw()
self:sync() self:sync()
end) end)
updateStatus()
UI.Page.enable(self) UI.Page.enable(self)
end end