lint warnings
This commit is contained in:
@@ -4,7 +4,6 @@ local Util = require('opus.util')
|
|||||||
local UI = require('opus.ui')
|
local UI = require('opus.ui')
|
||||||
local Event = require('opus.event')
|
local Event = require('opus.event')
|
||||||
|
|
||||||
local args = { ... }
|
|
||||||
local colors = _G.colors
|
local colors = _G.colors
|
||||||
local fs = _G.fs
|
local fs = _G.fs
|
||||||
local gps = _G.gps
|
local gps = _G.gps
|
||||||
@@ -24,7 +23,7 @@ local STARTUP_FILE = 'usr/autorun/gpsServer.lua'
|
|||||||
local positions = { }
|
local positions = { }
|
||||||
|
|
||||||
UI:configure('gps', ...)
|
UI:configure('gps', ...)
|
||||||
local args, options = Util.parse( ... )
|
local args = Util.parse( ... )
|
||||||
|
|
||||||
local page = UI.Page {
|
local page = UI.Page {
|
||||||
menuBar = UI.MenuBar {
|
menuBar = UI.MenuBar {
|
||||||
@@ -60,7 +59,9 @@ function page.grid:getDisplayValues(row)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function page.grid:getRowTextColor(row, selected)
|
function page.grid:getRowTextColor(row, selected)
|
||||||
return row.changed and colors.yellow or not row.alive and colors.lightGray or UI.Grid.getRowTextColor(self, row, selected)
|
return row.changed and colors.yellow or
|
||||||
|
not row.alive and colors.lightGray or
|
||||||
|
UI.Grid.getRowTextColor(self, row, selected)
|
||||||
end
|
end
|
||||||
|
|
||||||
function page.menuBar:eventHandler(event)
|
function page.menuBar:eventHandler(event)
|
||||||
@@ -71,7 +72,7 @@ function page.menuBar:eventHandler(event)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
elseif event.type == 'clear_all' then
|
elseif event.type == 'clear_all' then
|
||||||
for id, detail in pairs(positions) do
|
for id in pairs(positions) do
|
||||||
positions[id] = nil
|
positions[id] = nil
|
||||||
end
|
end
|
||||||
else return UI.MenuBar.eventHandler(self, event)
|
else return UI.MenuBar.eventHandler(self, event)
|
||||||
@@ -251,7 +252,7 @@ local function server(mode)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
Event.on('modem_message', function(e, side, channel, computerId, message, distance)
|
Event.on('modem_message', function(_, side, channel, computerId, message, distance)
|
||||||
if distance and modems[side] then
|
if distance and modems[side] then
|
||||||
if mode == 'gps' and channel == gps.CHANNEL_GPS and message == "PING" then
|
if mode == 'gps' and channel == gps.CHANNEL_GPS and message == "PING" then
|
||||||
for _, modem in pairs(modems) do
|
for _, modem in pairs(modems) do
|
||||||
@@ -268,7 +269,7 @@ local function server(mode)
|
|||||||
|
|
||||||
Event.onInterval(1, function()
|
Event.onInterval(1, function()
|
||||||
local resync = false
|
local resync = false
|
||||||
for id, detail in pairs(positions) do
|
for _, detail in pairs(positions) do
|
||||||
if os.clock() - detail.lastChanged > 10 then
|
if os.clock() - detail.lastChanged > 10 then
|
||||||
detail.changed = false
|
detail.changed = false
|
||||||
resync = true
|
resync = true
|
||||||
|
|||||||
@@ -115,12 +115,14 @@ local function createPage(node)
|
|||||||
},
|
},
|
||||||
storage = UI.ProgressBar {
|
storage = UI.ProgressBar {
|
||||||
x = 2, ex = -2, y = 7, height = 3,
|
x = 2, ex = -2, y = 7, height = 3,
|
||||||
|
progressChar = ' ',
|
||||||
},
|
},
|
||||||
unlockedLabel = UI.Text {
|
unlockedLabel = UI.Text {
|
||||||
x = 2, ex = -1, y = 12,
|
x = 2, ex = -1, y = 12,
|
||||||
},
|
},
|
||||||
unlocked = UI.ProgressBar {
|
unlocked = UI.ProgressBar {
|
||||||
x = 2, ex = -2, y = 13, height = 3,
|
x = 2, ex = -2, y = 13, height = 3,
|
||||||
|
progressChar = ' ',
|
||||||
},
|
},
|
||||||
craftingLabel = UI.Text {
|
craftingLabel = UI.Text {
|
||||||
x = 2, ex = -1, y = 18,
|
x = 2, ex = -1, y = 18,
|
||||||
@@ -128,6 +130,7 @@ local function createPage(node)
|
|||||||
},
|
},
|
||||||
crafting = UI.ProgressBar {
|
crafting = UI.ProgressBar {
|
||||||
x = 2, ex = -2, y = 19, height = 3,
|
x = 2, ex = -2, y = 19, height = 3,
|
||||||
|
progressChar = ' ',
|
||||||
value = 100,
|
value = 100,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,8 +3,12 @@ local Util = require('opus.util')
|
|||||||
local Event = require('opus.event')
|
local Event = require('opus.event')
|
||||||
local Config = require('opus.config')
|
local Config = require('opus.config')
|
||||||
|
|
||||||
|
local colors = _G.colors
|
||||||
|
local fs = _G.fs
|
||||||
|
|
||||||
UI:configure('Shoplogs', ...)
|
UI:configure('Shoplogs', ...)
|
||||||
local args, options = Util.parse( ... )
|
local args = Util.parse( ... )
|
||||||
|
local logFile = args[1] or '/usr/swshop.log'
|
||||||
|
|
||||||
local config = Config.load('Shoplogs', {
|
local config = Config.load('Shoplogs', {
|
||||||
timezone = 0,
|
timezone = 0,
|
||||||
@@ -100,7 +104,7 @@ function page.menuBar:eventHandler(event)
|
|||||||
page.grid.values = {}
|
page.grid.values = {}
|
||||||
page.grid:update()
|
page.grid:update()
|
||||||
page.grid:draw()
|
page.grid:draw()
|
||||||
fs.delete(args[1])
|
fs.delete(logFile)
|
||||||
|
|
||||||
elseif event.type == "set_timezone" then
|
elseif event.type == "set_timezone" then
|
||||||
page.tzSlide:show()
|
page.tzSlide:show()
|
||||||
@@ -146,7 +150,7 @@ function page.grid:addTransaction(transaction)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function page.grid:loadTransactions()
|
function page.grid:loadTransactions()
|
||||||
local logs = Util.readTable(args[1]) or {}
|
local logs = Util.readTable(logFile) or {}
|
||||||
self:setValues(logs)
|
self:setValues(logs)
|
||||||
self:update()
|
self:update()
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user