milo wip
This commit is contained in:
@@ -17,23 +17,33 @@ local SHIELD_SLOT = 2
|
|||||||
local config = Config.load('miloRemote', { })
|
local config = Config.load('miloRemote', { })
|
||||||
|
|
||||||
local page = UI.Page {
|
local page = UI.Page {
|
||||||
dummy = UI.Window {
|
menuBar = UI.MenuBar {
|
||||||
x = 1, ex = -13, y = 1, height = 1,
|
y = 1, height = 1,
|
||||||
|
buttons = {
|
||||||
|
{
|
||||||
|
text = 'Refresh',
|
||||||
|
x = -12,
|
||||||
|
event = 'refresh'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text = '\206',
|
||||||
|
x = -3,
|
||||||
|
dropdown = {
|
||||||
|
{ text = 'Setup', event = 'setup' },
|
||||||
|
UI.MenuBar.spacer,
|
||||||
|
{
|
||||||
|
text = 'Rescan storage',
|
||||||
|
event = 'rescan',
|
||||||
|
help = 'Rescan all inventories'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
infoBar = UI.StatusBar {
|
infoBar = UI.StatusBar {
|
||||||
|
x = 1, ex = -13,
|
||||||
backgroundColor = colors.lightGray,
|
backgroundColor = colors.lightGray,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
refresh = UI.Button {
|
|
||||||
y = 1, x = -12,
|
|
||||||
event = 'refresh',
|
|
||||||
text = 'Refresh',
|
|
||||||
},
|
|
||||||
setupButton = UI.Button {
|
|
||||||
y = 1, x = -3,
|
|
||||||
event = 'setup',
|
|
||||||
text = '\206',
|
|
||||||
help = 'Configuration',
|
|
||||||
},
|
|
||||||
grid = UI.Grid {
|
grid = UI.Grid {
|
||||||
y = 2, ey = -2,
|
y = 2, ey = -2,
|
||||||
columns = {
|
columns = {
|
||||||
@@ -129,10 +139,6 @@ local page = UI.Page {
|
|||||||
[[bound introspection module. The neural interface must ]] ..
|
[[bound introspection module. The neural interface must ]] ..
|
||||||
[[also have an introspection module.]],
|
[[also have an introspection module.]],
|
||||||
},
|
},
|
||||||
[5] = UI.Button {
|
|
||||||
x = 1, y = -2,
|
|
||||||
text = 'Force scan', event = 'rescan', help = 'Force a scan of all inventories',
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
statusBar = UI.StatusBar {
|
statusBar = UI.StatusBar {
|
||||||
backgroundColor = colors.cyan,
|
backgroundColor = colors.cyan,
|
||||||
@@ -164,7 +170,7 @@ local function filterItems(t, filter, displayMode)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function page:setStatus(status)
|
function page:setStatus(status)
|
||||||
self.dummy.infoBar:setStatus(status)
|
self.menuBar.infoBar:setStatus(status)
|
||||||
self:sync()
|
self:sync()
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -273,12 +279,14 @@ function page:eventHandler(event)
|
|||||||
self.setup:hide()
|
self.setup:hide()
|
||||||
self:refresh('list')
|
self:refresh('list')
|
||||||
self.grid:draw()
|
self.grid:draw()
|
||||||
|
self:setFocus(self.statusBar.filter)
|
||||||
|
|
||||||
elseif event.type == 'form_cancel' then
|
elseif event.type == 'form_cancel' then
|
||||||
self.setup:hide()
|
self.setup:hide()
|
||||||
|
self:setFocus(self.statusBar.filter)
|
||||||
|
|
||||||
elseif event.type == 'focus_change' then
|
elseif event.type == 'focus_change' then
|
||||||
self.dummy.infoBar:setStatus(event.focused.help)
|
self.menuBar.infoBar:setStatus(event.focused.help)
|
||||||
|
|
||||||
elseif event.type == 'eject' or event.type == 'grid_select' then
|
elseif event.type == 'eject' or event.type == 'grid_select' then
|
||||||
local item = self.grid:getSelected()
|
local item = self.grid:getSelected()
|
||||||
|
|||||||
@@ -62,11 +62,11 @@ local jobMonitor = UI.Page {
|
|||||||
{ heading = 'Qty', key = 'remaining', width = 4 },
|
{ heading = 'Qty', key = 'remaining', width = 4 },
|
||||||
{ heading = 'Crafting', key = 'displayName', },
|
{ heading = 'Crafting', key = 'displayName', },
|
||||||
{ heading = 'Status', key = 'status', },
|
{ heading = 'Status', key = 'status', },
|
||||||
-- { heading = 'need', key = 'need', width = 4 },
|
{ heading = 'need', key = 'need', width = 4 },
|
||||||
-- { heading = 'total', key = 'total', width = 4 },
|
-- { heading = 'total', key = 'total', width = 4 },
|
||||||
-- { heading = 'used', key = 'used', width = 4 },
|
-- { heading = 'used', key = 'used', width = 4 },
|
||||||
-- { heading = 'count', key = 'count', width = 4 },
|
-- { heading = 'count', key = 'count', width = 4 },
|
||||||
{ heading = 'crafted', key = 'crafted', width = 4 },
|
{ heading = 'crafted', key = 'crafted', width = 5 },
|
||||||
-- { heading = 'Progress', key = 'progress', width = 8 },
|
-- { heading = 'Progress', key = 'progress', width = 8 },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -37,7 +37,19 @@ local listingPage = UI.Page {
|
|||||||
{ text = 'Craft', event = 'craft' },
|
{ text = 'Craft', event = 'craft' },
|
||||||
{ text = 'Edit', event = 'details' },
|
{ text = 'Edit', event = 'details' },
|
||||||
{ text = 'Refresh', event = 'refresh', x = -12 },
|
{ text = 'Refresh', event = 'refresh', x = -12 },
|
||||||
{ text = '\206', event = 'network', x = -3 },
|
{
|
||||||
|
text = '\206',
|
||||||
|
x = -3,
|
||||||
|
dropdown = {
|
||||||
|
{ text = 'Setup', event = 'network' },
|
||||||
|
UI.MenuBar.spacer,
|
||||||
|
{
|
||||||
|
text = 'Rescan storage',
|
||||||
|
event = 'rescan',
|
||||||
|
help = 'Rescan all inventories'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
grid = UI.Grid {
|
grid = UI.Grid {
|
||||||
@@ -175,9 +187,14 @@ function listingPage:eventHandler(event)
|
|||||||
end
|
end
|
||||||
|
|
||||||
elseif event.type == 'refresh' then
|
elseif event.type == 'refresh' then
|
||||||
|
self:refresh()
|
||||||
|
self.grid:draw()
|
||||||
|
self:setFocus(self.statusBar.filter)
|
||||||
|
|
||||||
|
elseif event.type == 'rescan' then
|
||||||
self:refresh(true)
|
self:refresh(true)
|
||||||
self.grid:draw()
|
self.grid:draw()
|
||||||
self.statusBar.filter:focus()
|
self:setFocus(self.statusBar.filter)
|
||||||
|
|
||||||
elseif event.type == 'toggle_display' then
|
elseif event.type == 'toggle_display' then
|
||||||
local values = {
|
local values = {
|
||||||
|
|||||||
Reference in New Issue
Block a user