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 -- 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 if assets.image("/cursors/cursors.png"):size()[1] == 64 then
local path = "/cursors/opensb/revert.cursor.patch" local path = "/cursors/opensb/revert.cursor.patch"
assets.add(path, '{"scale":null}') 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" path = "/cursors/opensb/revert.frames.patch"
assets.add(path, '{"frameGrid":{"size":[16,16]}}') assets.add(path, '{"frameGrid":{"size":[16,16]}}')
assets.patch("/cursors/cursors.frames", path) 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 end
-- Add object patches -- Add object patches