v1.4.0 - Added automatic registry updates to Ag and removed aspect ratio matching because it would introduce a variable resolution that would be hard to work with for most software.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
Aargentum/registry.cfg
|
Aargentum/registry.cfg
|
||||||
Ahalyde/apps/argentum.lua
|
Ahalyde/apps/argentum.lua
|
||||||
Ahalyde/apps/helpdb/argentum.txt
|
Ahalyde/apps/helpdb/argentum.txt
|
||||||
V1.0.0
|
V1.0.1
|
||||||
Aargentum/
|
Aargentum/
|
||||||
Aargentum/store/
|
Aargentum/store/
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
Ahome/
|
||||||
|
Ahalyde/lib/
|
||||||
|
Ahalyde/core/
|
||||||
|
Ahalyde/config/
|
||||||
|
Ahalyde/apps/helpdb/
|
||||||
|
Ahalyde/apps/
|
||||||
|
V1.3.0
|
||||||
Ainit.lua
|
Ainit.lua
|
||||||
Ahalyde/apps/helpdb/cat.txt
|
Ahalyde/apps/helpdb/cat.txt
|
||||||
Ahalyde/apps/helpdb/cd.txt
|
Ahalyde/apps/helpdb/cd.txt
|
||||||
@@ -15,12 +22,12 @@ Ahalyde/apps/cat.lua
|
|||||||
Ahalyde/apps/cd.lua
|
Ahalyde/apps/cd.lua
|
||||||
Ahalyde/apps/clear.lua
|
Ahalyde/apps/clear.lua
|
||||||
Ahalyde/apps/cp.lua
|
Ahalyde/apps/cp.lua
|
||||||
Ahalyde/apps/download.lua
|
|
||||||
Ahalyde/apps/echo.lua
|
Ahalyde/apps/echo.lua
|
||||||
Ahalyde/apps/fetch.lua
|
Ahalyde/apps/fetch.lua
|
||||||
Ahalyde/apps/help.lua
|
Ahalyde/apps/help.lua
|
||||||
Ahalyde/apps/ls.lua
|
Ahalyde/apps/ls.lua
|
||||||
Ahalyde/apps/lua.lua
|
Ahalyde/apps/lua.lua
|
||||||
|
Ahalyde/apps/mkdir.lua
|
||||||
Ahalyde/apps/mv.lua
|
Ahalyde/apps/mv.lua
|
||||||
Ahalyde/apps/rm.lua
|
Ahalyde/apps/rm.lua
|
||||||
Ahalyde/config/oslogo.ans
|
Ahalyde/config/oslogo.ans
|
||||||
@@ -36,11 +43,4 @@ Ahalyde/core/termlib.lua
|
|||||||
Ahalyde/lib/component.lua
|
Ahalyde/lib/component.lua
|
||||||
Ahalyde/lib/event.lua
|
Ahalyde/lib/event.lua
|
||||||
Ahalyde/lib/filesystem.lua
|
Ahalyde/lib/filesystem.lua
|
||||||
Ahalyde/lib/raster.lua
|
Ahalyde/lib/raster.lua
|
||||||
V1.3.1
|
|
||||||
Ahalyde/
|
|
||||||
Ahalyde/apps/
|
|
||||||
Ahalyde/apps/helpdb/
|
|
||||||
Ahalyde/config/
|
|
||||||
Ahalyde/core/
|
|
||||||
Ahalyde/lib/
|
|
||||||
@@ -290,13 +290,22 @@ local function updatePackage(package)
|
|||||||
return installPackage(package, true)
|
return installPackage(package, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- update registry
|
|
||||||
local fails = {}
|
local fails = {}
|
||||||
if command == "install" then
|
if command == "install" then
|
||||||
if not packages or not packages[1] then
|
if not packages or not packages[1] then
|
||||||
print("Please specify packages to install.")
|
print("Please specify packages to install.")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
print("Fetching Ag registry...")
|
||||||
|
local newRegistry, errorMessage = getFile("https://raw.githubusercontent.com/Team-Cerulean-Blue/Halyde/refs/heads/main/argentum/registry.cfg")
|
||||||
|
if newRegistry then
|
||||||
|
local handle = fs.open("/argentum/registry.cfg", "w")
|
||||||
|
handle:write(newRegistry)
|
||||||
|
handle:close()
|
||||||
|
else
|
||||||
|
print("\27[91mFailed to fetch Ag registry: " .. (errorMessage or "returned nil"))
|
||||||
|
end
|
||||||
|
agReg = import("/argentum/registry.cfg")
|
||||||
while true do
|
while true do
|
||||||
if not doChecks(packages[i]) then
|
if not doChecks(packages[i]) then
|
||||||
table.insert(fails, packages[i])
|
table.insert(fails, packages[i])
|
||||||
@@ -438,6 +447,16 @@ elseif command == "remove" then
|
|||||||
print("Packages that could not be removed: " .. table.concat(fails, ", "))
|
print("Packages that could not be removed: " .. table.concat(fails, ", "))
|
||||||
end
|
end
|
||||||
elseif command == "update" then
|
elseif command == "update" then
|
||||||
|
print("Fetching Ag registry...")
|
||||||
|
local newRegistry, errorMessage = getFile("https://raw.githubusercontent.com/Team-Cerulean-Blue/Halyde/refs/heads/main/argentum/registry.cfg")
|
||||||
|
if newRegistry then
|
||||||
|
local handle = fs.open("/argentum/registry.cfg", "w")
|
||||||
|
handle:write(newRegistry)
|
||||||
|
handle:close()
|
||||||
|
else
|
||||||
|
print("\27[91mFailed to fetch Ag registry: " .. (errorMessage or "returned nil"))
|
||||||
|
end
|
||||||
|
agReg = import("/argentum/registry.cfg")
|
||||||
if not packages[1] then
|
if not packages[1] then
|
||||||
local packagesInstalled = fs.list("/argentum/store/")
|
local packagesInstalled = fs.list("/argentum/store/")
|
||||||
for _, currentPackage in pairs(packagesInstalled) do
|
for _, currentPackage in pairs(packagesInstalled) do
|
||||||
@@ -540,6 +559,16 @@ elseif command == "info" then
|
|||||||
print("Please specify a package to show information about.")
|
print("Please specify a package to show information about.")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
print("Fetching Ag registry...")
|
||||||
|
local newRegistry, errorMessage = getFile("https://raw.githubusercontent.com/Team-Cerulean-Blue/Halyde/refs/heads/main/argentum/registry.cfg")
|
||||||
|
if newRegistry then
|
||||||
|
local handle = fs.open("/argentum/registry.cfg", "w")
|
||||||
|
handle:write(newRegistry)
|
||||||
|
handle:close()
|
||||||
|
else
|
||||||
|
print("\27[91mFailed to fetch Ag registry: " .. (errorMessage or "returned nil"))
|
||||||
|
end
|
||||||
|
agReg = import("/argentum/registry.cfg")
|
||||||
if not agReg[packages[1]] and not source then
|
if not agReg[packages[1]] and not source then
|
||||||
print("\27[91mPackage " .. packages[1] .. " does not exist.")
|
print("\27[91mPackage " .. packages[1] .. " does not exist.")
|
||||||
return
|
return
|
||||||
@@ -554,6 +583,16 @@ elseif command == "search" then
|
|||||||
print("Please specify a search term.")
|
print("Please specify a search term.")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
print("Fetching Ag registry...")
|
||||||
|
local newRegistry, errorMessage = getFile("https://raw.githubusercontent.com/Team-Cerulean-Blue/Halyde/refs/heads/main/argentum/registry.cfg")
|
||||||
|
if newRegistry then
|
||||||
|
local handle = fs.open("/argentum/registry.cfg", "w")
|
||||||
|
handle:write(newRegistry)
|
||||||
|
handle:close()
|
||||||
|
else
|
||||||
|
print("\27[91mFailed to fetch Ag registry: " .. (errorMessage or "returned nil"))
|
||||||
|
end
|
||||||
|
agReg = import("/argentum/registry.cfg")
|
||||||
local searchResults = {}
|
local searchResults = {}
|
||||||
for packageName, _ in pairs(agReg) do
|
for packageName, _ in pairs(agReg) do
|
||||||
if packageName:find(packages[1], 1, true) then
|
if packageName:find(packages[1], 1, true) then
|
||||||
@@ -567,6 +606,16 @@ elseif command == "search" then
|
|||||||
table.sort(searchResults)
|
table.sort(searchResults)
|
||||||
print("Search results: \n " .. table.concat(searchResults, "\n "))
|
print("Search results: \n " .. table.concat(searchResults, "\n "))
|
||||||
elseif command == "list" then
|
elseif command == "list" then
|
||||||
|
print("Fetching Ag registry...")
|
||||||
|
local newRegistry, errorMessage = getFile("https://raw.githubusercontent.com/Team-Cerulean-Blue/Halyde/refs/heads/main/argentum/registry.cfg")
|
||||||
|
if newRegistry then
|
||||||
|
local handle = fs.open("/argentum/registry.cfg", "w")
|
||||||
|
handle:write(newRegistry)
|
||||||
|
handle:close()
|
||||||
|
else
|
||||||
|
print("\27[91mFailed to fetch Ag registry: " .. (errorMessage or "returned nil"))
|
||||||
|
end
|
||||||
|
agReg = import("/argentum/registry.cfg")
|
||||||
local sortedPackages = {}
|
local sortedPackages = {}
|
||||||
for packageName, _ in pairs(agReg) do
|
for packageName, _ in pairs(agReg) do
|
||||||
table.insert(sortedPackages, packageName)
|
table.insert(sortedPackages, packageName)
|
||||||
|
|||||||
+21
-21
@@ -1,7 +1,7 @@
|
|||||||
local loadfile = ...
|
local loadfile = ...
|
||||||
local filesystem = loadfile("/halyde/lib/filesystem.lua")(loadfile)
|
local filesystem = loadfile("/halyde/lib/filesystem.lua")(loadfile)
|
||||||
|
|
||||||
_G._OSVERSION = "Halyde 1.3.1"
|
_G._OSVERSION = "Halyde 1.4.0"
|
||||||
_G._OSLOGO = ""
|
_G._OSLOGO = ""
|
||||||
local handle, tmpdata = filesystem.open("/halyde/config/oslogo.ans", "r"), nil
|
local handle, tmpdata = filesystem.open("/halyde/config/oslogo.ans", "r"), nil
|
||||||
repeat
|
repeat
|
||||||
@@ -11,34 +11,34 @@ until not tmpdata
|
|||||||
|
|
||||||
local gpu = component.proxy(component.list("gpu")())
|
local gpu = component.proxy(component.list("gpu")())
|
||||||
local screenAddress = component.list("screen")()
|
local screenAddress = component.list("screen")()
|
||||||
local screen = component.proxy(screenAddress)
|
--local screen = component.proxy(screenAddress)
|
||||||
|
|
||||||
gpu.bind(screenAddress)
|
gpu.bind(screenAddress)
|
||||||
local maxWidth, maxHeight = gpu.maxResolution()
|
--local maxWidth, maxHeight = gpu.maxResolution()
|
||||||
local aspectX, aspectY = screen.getAspectRatio()
|
--local aspectX, aspectY = screen.getAspectRatio()
|
||||||
local screenRatio = aspectX * 2 / aspectY
|
--local screenRatio = aspectX * 2 / aspectY
|
||||||
|
|
||||||
-- Calculate potential dimensions
|
-- Calculate potential dimensions
|
||||||
local widthLimited = math.floor(maxHeight * screenRatio)
|
--local widthLimited = math.floor(maxHeight * screenRatio)
|
||||||
local heightLimited = math.floor(maxWidth / screenRatio)
|
--local heightLimited = math.floor(maxWidth / screenRatio)
|
||||||
|
|
||||||
local targetWidth, targetHeight
|
--local targetWidth, targetHeight
|
||||||
|
|
||||||
if widthLimited <= maxWidth then
|
--if widthLimited <= maxWidth then
|
||||||
-- Height is the limiting factor
|
-- height is the limiting factor
|
||||||
targetWidth = widthLimited
|
-- targetWidth = widthLimited
|
||||||
targetHeight = maxHeight
|
-- targetHeight = maxHeight
|
||||||
else
|
--else
|
||||||
-- Width is the limiting factor
|
-- width is the limiting factor
|
||||||
targetWidth = maxWidth
|
-- targetWidth = maxWidth
|
||||||
targetHeight = heightLimited
|
-- targetHeight = heightLimited
|
||||||
end
|
--end
|
||||||
|
|
||||||
-- Ensure we never exceed maximum resolution
|
--targetWidth = math.min(targetWidth, maxWidth)
|
||||||
targetWidth = math.min(targetWidth, maxWidth)
|
--targetHeight = math.min(targetHeight, maxHeight)
|
||||||
targetHeight = math.min(targetHeight, maxHeight)
|
|
||||||
|
|
||||||
gpu.setResolution(targetWidth, targetHeight)
|
--gpu.setResolution(targetWidth, targetHeight)
|
||||||
|
gpu.setResolution(gpu.maxResolution())
|
||||||
|
|
||||||
function _G.import(module, ...)
|
function _G.import(module, ...)
|
||||||
local args = table.pack(...)
|
local args = table.pack(...)
|
||||||
|
|||||||
Reference in New Issue
Block a user