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,9 +18,8 @@ local colors = {
black = 0x000000
}
table.concat(
colors,
{
---[[
local newColors = {
machineBackground = colors.darkGray,
progressBackground = colors.lightGray,
labelColor = colors.chocolate,
@ -37,8 +36,13 @@ table.concat(
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

View File

@ -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

View File

@ -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