diff --git a/argentum.cfg b/argentum.cfg index b87d2d1..7b0e75a 100644 --- a/argentum.cfg +++ b/argentum.cfg @@ -1,7 +1,7 @@ local agcfg = { ["halyde"] = { ["maindir"] = "", - ["version"] = "1.9.0", + ["version"] = "1.10.0", ["description"] = "A universal, customizable and feature-packed operating system for OpenComputers.", ["directories"] = { "halyde/apps", diff --git a/argentum/store/halyde/package.cfg b/argentum/store/halyde/package.cfg index 7f1f119..be489d5 100644 --- a/argentum/store/halyde/package.cfg +++ b/argentum/store/halyde/package.cfg @@ -4,7 +4,7 @@ Ahalyde/core/ Ahalyde/config/generate/ Ahalyde/apps/helpdb/ Ahalyde/apps/ -V1.9.0 +V1.10.0 Ainit.lua Ahalyde/apps/helpdb/cat.txt Ahalyde/apps/helpdb/cd.txt diff --git a/halyde/apps/argentum.lua b/halyde/apps/argentum.lua index 3216329..3759b46 100644 --- a/halyde/apps/argentum.lua +++ b/halyde/apps/argentum.lua @@ -12,7 +12,7 @@ if not component.list("internet")() then print("\27[91mThis program requires an internet card to run.") return end -local internet = component.proxy(component.list("internet")()) +local internet = component.internet local source if table.find(packages, "-s") then source = table.remove(packages, table.find(packages, "-s") + 1) diff --git a/halyde/apps/edit.lua b/halyde/apps/edit.lua index c0bfa56..fb499c7 100644 --- a/halyde/apps/edit.lua +++ b/halyde/apps/edit.lua @@ -2,7 +2,7 @@ local file = ... local fs = import("filesystem") local event = import("event") local component = import("component") -local gpu = component.proxy(component.list("gpu")()) +local gpu = component.gpu local width, height = gpu.getResolution() local scrollPosX, scrollPosY = 1, 1 local cursorPosX, cursorPosY = 1, 1 diff --git a/halyde/core/boot.lua b/halyde/core/boot.lua index 10909ce..7cfdc75 100644 --- a/halyde/core/boot.lua +++ b/halyde/core/boot.lua @@ -1,7 +1,7 @@ local loadfile = ... local filesystem = loadfile("/halyde/lib/filesystem.lua")(loadfile) -_G._OSVERSION = "Halyde 1.9.0" +_G._OSVERSION = "Halyde 1.10.0" _G._OSLOGO = "" local handle, tmpdata = filesystem.open("/halyde/config/oslogo.ans", "r"), nil repeat @@ -9,37 +9,6 @@ repeat _OSLOGO = _OSLOGO .. (tmpdata or "") until not tmpdata -local gpu = component.proxy(component.list("gpu")()) -local screenAddress = component.list("screen")() ---local screen = component.proxy(screenAddress) - -gpu.bind(screenAddress) ---local maxWidth, maxHeight = gpu.maxResolution() ---local aspectX, aspectY = screen.getAspectRatio() ---local screenRatio = aspectX * 2 / aspectY - --- Calculate potential dimensions ---local widthLimited = math.floor(maxHeight * screenRatio) ---local heightLimited = math.floor(maxWidth / screenRatio) - ---local targetWidth, targetHeight - ---if widthLimited <= maxWidth then - -- height is the limiting factor --- targetWidth = widthLimited --- targetHeight = maxHeight ---else - -- width is the limiting factor --- targetWidth = maxWidth --- targetHeight = heightLimited ---end - ---targetWidth = math.min(targetWidth, maxWidth) ---targetHeight = math.min(targetHeight, maxHeight) - ---gpu.setResolution(targetWidth, targetHeight) -gpu.setResolution(gpu.maxResolution()) - _G.package = {["preloaded"] = {}} loadfile("/halyde/core/datatools.lua")() @@ -81,6 +50,38 @@ end preload("component") preload("computer") +local component = import("component") +local gpu = component.gpu +local screenAddress = component.list("screen")() +--local screen = component.screen + +gpu.bind(screenAddress) +--local maxWidth, maxHeight = gpu.maxResolution() +--local aspectX, aspectY = screen.getAspectRatio() +--local screenRatio = aspectX * 2 / aspectY + +-- Calculate potential dimensions +--local widthLimited = math.floor(maxHeight * screenRatio) +--local heightLimited = math.floor(maxWidth / screenRatio) + +--local targetWidth, targetHeight + +--if widthLimited <= maxWidth then + -- height is the limiting factor +-- targetWidth = widthLimited +-- targetHeight = maxHeight +--else + -- width is the limiting factor +-- targetWidth = maxWidth +-- targetHeight = heightLimited +--end + +--targetWidth = math.min(targetWidth, maxWidth) +--targetHeight = math.min(targetHeight, maxHeight) + +--gpu.setResolution(targetWidth, targetHeight) +gpu.setResolution(gpu.maxResolution()) + --local handle = assert(filesystem.open("/bazinga.txt", "w")) --assert(handle:write("Bazinga!")) --handle:close() diff --git a/halyde/core/cormgr.lua b/halyde/core/cormgr.lua index 661ef44..ff9d8b5 100644 --- a/halyde/core/cormgr.lua +++ b/halyde/core/cormgr.lua @@ -7,7 +7,7 @@ _G.cormgr.labelList = {} local component = import("component") local filesystem = import("filesystem") local json = import("json") -local gpu = component.proxy(component.list("gpu")()) +local gpu = component.gpu function _G.cormgr.loadCoroutine(path,...) local args = {...} diff --git a/halyde/core/shell.lua b/halyde/core/shell.lua index cf3a3ab..f75b189 100644 --- a/halyde/core/shell.lua +++ b/halyde/core/shell.lua @@ -10,7 +10,7 @@ local shellcfg = json.decode(data) import("/halyde/core/termlib.lua") local event = import("event") local component = import("component") -local gpu = component.proxy(component.list("gpu")()) +local gpu = component.gpu _G.shell = {} _G.shell.workingDirectory = shellcfg["defaultWorkingDirectory"] diff --git a/halyde/core/termlib.lua b/halyde/core/termlib.lua index 30c0738..e595496 100644 --- a/halyde/core/termlib.lua +++ b/halyde/core/termlib.lua @@ -4,7 +4,7 @@ local event = import("event") --local ocelot = component.proxy(component.list("ocelot")()) local component = import("component") local computer = import("computer") -local gpu = component.proxy(component.list("gpu")()) -- replace with component.gpu once implemented +local gpu = component.gpu _G.termlib = {} termlib.cursorPosX = 1 termlib.cursorPosY = 1 diff --git a/halyde/lib/component.lua b/halyde/lib/component.lua index 263804c..0ef52be 100644 --- a/halyde/lib/component.lua +++ b/halyde/lib/component.lua @@ -84,4 +84,13 @@ function compLib.get(address) return nil, "full address not found" end +-- Add main component proxies to the library +setmetatable(compLib, {["__index"] = function(_, item) + if compLib.list(item)() then + return compLib.proxy(compLib.list(item)()) + else + return compLib[item] + end +end}) + return compLib diff --git a/halyde/lib/raster.lua b/halyde/lib/raster.lua index db49347..493b2c9 100644 --- a/halyde/lib/raster.lua +++ b/halyde/lib/raster.lua @@ -10,7 +10,7 @@ local raster = { local component = import("component") -- local ocelot = component.proxy(component.list("ocelot")()) -local gpu = component.proxy(component.list("gpu")()) +local gpu = component.gpu local display = {} local chunksAffected = {}