v1.10.0 - Improved the component library to add things like component.gpu.
This commit is contained in:
+1
-1
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
+33
-32
@@ -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()
|
||||
|
||||
@@ -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 = {...}
|
||||
|
||||
@@ -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"]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user