Correct assets.lua2p types

This commit is contained in:
Sage Vaillancourt 2025-03-21 23:08:23 -04:00
parent 34ea0a7d63
commit c43c01d591
1 changed files with 6 additions and 4 deletions

View File

@ -25,9 +25,11 @@ function generatedFileWarning()
return "-- GENERATED FILE - DO NOT EDIT\n-- Instead, edit the source file directly: assets.lua2p."
end)!!(generatedFileWarning())
!!(dirLookup('assets/images', 'png', 'love.graphics.newImage', 'Image'))
!!(dirLookup('assets/sounds', 'wav', 'love.sound.newSoundData', 'SoundData'))
!!(dirLookup('assets/music', 'wav', 'love.sound.newSoundData', 'SoundData'))
!!(dirLookup('assets/fonts', 'ttf', 'love.graphics.newFont', 'FontData', function(varName, newFunc, file)
!!(dirLookup('assets/images', 'png', 'love.graphics.newImage', 'love.Texture'))
!!(dirLookup('assets/sounds', 'ogg', 'love.audio.newSource', 'love.Source', function(varName, newFunc, file)
return varName .. ' = ' .. newFunc .. '("' .. file .. '", "static")'
end))
!!(dirLookup('assets/music', 'wav', 'love.sound.newSoundData', 'love.SoundData'))
!!(dirLookup('assets/fonts', 'ttf', 'love.graphics.newFont', 'fun(fontSize: number | nil): love.Font', function(varName, newFunc, file)
return varName .. ' = function(fontSize)\n return ' .. newFunc .. '("' .. file .. '", fontSize)\nend'
end))