Merge pull request #86 from OpenStarbound/SilverSokolova-patch-1

postload: upscale all HD cursors
This commit is contained in:
Kae 2024-07-20 05:17:47 +10:00 committed by GitHub
commit 42c8933f55
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 10 additions and 10 deletions

View File

@ -1,3 +0,0 @@
{
"scale" : 1
}

View File

@ -1,3 +0,0 @@
{
"scale" : 1
}

View File

@ -1,3 +0,0 @@
{
"scale" : 1
}

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