diff --git a/gps/gpsServer.lua b/gps/gpsServer.lua index c324cf0..15191e5 100644 --- a/gps/gpsServer.lua +++ b/gps/gpsServer.lua @@ -4,7 +4,6 @@ local Util = require('opus.util') local UI = require('opus.ui') local Event = require('opus.event') -local args = { ... } local colors = _G.colors local fs = _G.fs local gps = _G.gps @@ -24,7 +23,7 @@ local STARTUP_FILE = 'usr/autorun/gpsServer.lua' local positions = { } UI:configure('gps', ...) -local args, options = Util.parse( ... ) +local args = Util.parse( ... ) local page = UI.Page { menuBar = UI.MenuBar { @@ -60,7 +59,9 @@ function page.grid:getDisplayValues(row) end 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 function page.menuBar:eventHandler(event) @@ -71,7 +72,7 @@ function page.menuBar:eventHandler(event) end end elseif event.type == 'clear_all' then - for id, detail in pairs(positions) do + for id in pairs(positions) do positions[id] = nil end else return UI.MenuBar.eventHandler(self, event) @@ -251,7 +252,7 @@ local function server(mode) 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 mode == 'gps' and channel == gps.CHANNEL_GPS and message == "PING" then for _, modem in pairs(modems) do @@ -268,7 +269,7 @@ local function server(mode) Event.onInterval(1, function() local resync = false - for id, detail in pairs(positions) do + for _, detail in pairs(positions) do if os.clock() - detail.lastChanged > 10 then detail.changed = false resync = true diff --git a/milo/plugins/statsView.lua b/milo/plugins/statsView.lua index 3f1ba3c..9f9c0a2 100644 --- a/milo/plugins/statsView.lua +++ b/milo/plugins/statsView.lua @@ -115,12 +115,14 @@ local function createPage(node) }, storage = UI.ProgressBar { x = 2, ex = -2, y = 7, height = 3, + progressChar = ' ', }, unlockedLabel = UI.Text { x = 2, ex = -1, y = 12, }, unlocked = UI.ProgressBar { x = 2, ex = -2, y = 13, height = 3, + progressChar = ' ', }, craftingLabel = UI.Text { x = 2, ex = -1, y = 18, @@ -128,6 +130,7 @@ local function createPage(node) }, crafting = UI.ProgressBar { x = 2, ex = -2, y = 19, height = 3, + progressChar = ' ', value = 100, }, }, diff --git a/swshop/Shoplogs.lua b/swshop/Shoplogs.lua index 0f8c587..476744b 100644 --- a/swshop/Shoplogs.lua +++ b/swshop/Shoplogs.lua @@ -3,8 +3,12 @@ local Util = require('opus.util') local Event = require('opus.event') local Config = require('opus.config') +local colors = _G.colors +local fs = _G.fs + 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', { timezone = 0, @@ -100,7 +104,7 @@ function page.menuBar:eventHandler(event) page.grid.values = {} page.grid:update() page.grid:draw() - fs.delete(args[1]) + fs.delete(logFile) elseif event.type == "set_timezone" then page.tzSlide:show() @@ -146,7 +150,7 @@ function page.grid:addTransaction(transaction) end function page.grid:loadTransactions() - local logs = Util.readTable(args[1]) or {} + local logs = Util.readTable(logFile) or {} self:setValues(logs) self:update() end