diff --git a/.vscode/settings.json b/.vscode/settings.json index b1549cb..013b97d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,6 @@ -{ - "lua.targetVersion": "5.3" -} \ No newline at end of file +{ + "lua.targetVersion": "5.3", + "Lua.diagnostics.globals": [ + "checkArg" + ] +} diff --git a/Libraries/graphics/colors.lua b/Libraries/graphics/colors.lua index 8050118..d1288dd 100644 --- a/Libraries/graphics/colors.lua +++ b/Libraries/graphics/colors.lua @@ -18,27 +18,31 @@ local colors = { black = 0x000000 } -table.concat( - colors, - { - machineBackground = colors.darkGray, - progressBackground = colors.lightGray, - labelColor = colors.chocolate, - errorColor = colors.red, - idleColor = colors.purple, - workingColor = colors.steelBlue, - positiveEUColor = colors.lime, - negativeEUColor = colors.brown, - timeColor = colors.purple, - textColor = colors.black, - hudColor = colors.darkSlateGrey, - mainColor = colors.rosyBrown, - background = colors.black, - accentA = colors.cyan, - accentB = colors.magenta, - barColor = colors.blue - } -) +---[[ +local newColors = { + machineBackground = colors.darkGray, + progressBackground = colors.lightGray, + labelColor = colors.chocolate, + errorColor = colors.red, + idleColor = colors.purple, + workingColor = colors.steelBlue, + positiveEUColor = colors.lime, + negativeEUColor = colors.brown, + timeColor = colors.purple, + textColor = colors.black, + hudColor = colors.darkSlateGrey, + mainColor = colors.rosyBrown, + background = colors.black, + accentA = colors.cyan, + accentB = colors.magenta, + barColor = colors.blue +} + +for name, color in pairs(newColors) do + colors[name] = color +end + +--[[ local RGB = {} @@ -62,5 +66,5 @@ setmetatable( end } ) - +--]] return colors diff --git a/Libraries/graphics/graphics.lua b/Libraries/graphics/graphics.lua index 0c158b9..fb289e8 100644 --- a/Libraries/graphics/graphics.lua +++ b/Libraries/graphics/graphics.lua @@ -87,7 +87,7 @@ function graphics.createWindow(GPU, width, height, name) return pageNumber end -local function copyWindow(GPU, x, y, page, destination) +function graphics.copyWindow(GPU, x, y, page, destination) destination = 0 or destination GPU.bitblt(destination, x, y, 160, 50, page, 1, 1) end @@ -95,7 +95,7 @@ end function graphics.refresh(GPU) for window, params in pairs(graphics.currentWindows) do if params.w > 0 then - copyWindow(GPU, params.x, params.y, params.page) + graphics.copyWindow(GPU, params.x, params.y, params.page) end end GPU.setActiveBuffer(0) @@ -105,7 +105,7 @@ graphics.windows = {} function graphics.update() local function redraw() for window, params in pairs(graphics.windows) do - copyWindow(params.GPU, params.x, params.y, params.page) + graphics.copyWindow(params.GPU, params.x, params.y, params.page) end end for name, params in pairs(graphics.windows) do diff --git a/Libraries/graphics/gui.lua b/Libraries/graphics/gui.lua index 42585d4..edcd547 100644 --- a/Libraries/graphics/gui.lua +++ b/Libraries/graphics/gui.lua @@ -6,7 +6,7 @@ GPU = Component.gpu Colors = require("colors") local gui, quit, editing = {}, false, false -local currentWindows = {} +local currentWindows = Graphics.currentWindows local activeWindow local keyInput, mouseInput, drag, inContextMenu