postload: upscale all HD cursors

This commit is contained in:
SilverSokolova 2024-07-17 03:26:32 -05:00 committed by GitHub
parent 044d6a38d4
commit 74ea816f8a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,5 @@
-- Revert cursor frames if a mod replaced cursors.png with a SD version again
-- Otherwise, scale down our HD cursors
if assets.image("/cursors/cursors.png"):size()[1] == 64 then
local path = "/cursors/opensb/revert.cursor.patch"
assets.add(path, '{"scale":null}')
@ -8,6 +9,14 @@ if assets.image("/cursors/cursors.png"):size()[1] == 64 then
path = "/cursors/opensb/revert.frames.patch"
assets.add(path, '{"frameGrid":{"size":[16,16]}}')
assets.patch("/cursors/cursors.frames", path)
else
local cursors = assets.json("/cursors/cursors.frames:frameGrid.names")
local path = "/cursors/%s.cursor.patch"
for i = 1, #cursors do
for j = 1, #cursors[i] do
assets.add(string.format(path, cursors[i][j]), '{"scale":1}')
end
end
end
-- Add object patches
@ -15,4 +24,4 @@ local objects = assets.byExtension("object")
local path = "/objects/opensb/object.patch.lua"
for i = 1, #objects do
assets.patch(objects[i], path)
end
end