Fixing encapsulation errors

This commit is contained in:
Gabriel Moreira Minossi 2021-01-08 16:28:15 -03:00
parent 4c11905281
commit e194231476
4 changed files with 36 additions and 29 deletions

View File

@ -1,3 +1,6 @@
{ {
"lua.targetVersion": "5.3" "lua.targetVersion": "5.3",
} "Lua.diagnostics.globals": [
"checkArg"
]
}

View File

@ -18,27 +18,31 @@ local colors = {
black = 0x000000 black = 0x000000
} }
table.concat( ---[[
colors, local newColors = {
{ machineBackground = colors.darkGray,
machineBackground = colors.darkGray, progressBackground = colors.lightGray,
progressBackground = colors.lightGray, labelColor = colors.chocolate,
labelColor = colors.chocolate, errorColor = colors.red,
errorColor = colors.red, idleColor = colors.purple,
idleColor = colors.purple, workingColor = colors.steelBlue,
workingColor = colors.steelBlue, positiveEUColor = colors.lime,
positiveEUColor = colors.lime, negativeEUColor = colors.brown,
negativeEUColor = colors.brown, timeColor = colors.purple,
timeColor = colors.purple, textColor = colors.black,
textColor = colors.black, hudColor = colors.darkSlateGrey,
hudColor = colors.darkSlateGrey, mainColor = colors.rosyBrown,
mainColor = colors.rosyBrown, background = colors.black,
background = colors.black, accentA = colors.cyan,
accentA = colors.cyan, accentB = colors.magenta,
accentB = colors.magenta, barColor = colors.blue
barColor = colors.blue }
}
) for name, color in pairs(newColors) do
colors[name] = color
end
--[[
local RGB = {} local RGB = {}
@ -62,5 +66,5 @@ setmetatable(
end end
} }
) )
--]]
return colors return colors

View File

@ -87,7 +87,7 @@ function graphics.createWindow(GPU, width, height, name)
return pageNumber return pageNumber
end end
local function copyWindow(GPU, x, y, page, destination) function graphics.copyWindow(GPU, x, y, page, destination)
destination = 0 or destination destination = 0 or destination
GPU.bitblt(destination, x, y, 160, 50, page, 1, 1) GPU.bitblt(destination, x, y, 160, 50, page, 1, 1)
end end
@ -95,7 +95,7 @@ end
function graphics.refresh(GPU) function graphics.refresh(GPU)
for window, params in pairs(graphics.currentWindows) do for window, params in pairs(graphics.currentWindows) do
if params.w > 0 then if params.w > 0 then
copyWindow(GPU, params.x, params.y, params.page) graphics.copyWindow(GPU, params.x, params.y, params.page)
end end
end end
GPU.setActiveBuffer(0) GPU.setActiveBuffer(0)
@ -105,7 +105,7 @@ graphics.windows = {}
function graphics.update() function graphics.update()
local function redraw() local function redraw()
for window, params in pairs(graphics.windows) do 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
end end
for name, params in pairs(graphics.windows) do for name, params in pairs(graphics.windows) do

View File

@ -6,7 +6,7 @@ GPU = Component.gpu
Colors = require("colors") Colors = require("colors")
local gui, quit, editing = {}, false, false local gui, quit, editing = {}, false, false
local currentWindows = {} local currentWindows = Graphics.currentWindows
local activeWindow local activeWindow
local keyInput, mouseInput, drag, inContextMenu local keyInput, mouseInput, drag, inContextMenu