Skip to content

Commit

Permalink
Fix judgment preview
Browse files Browse the repository at this point in the history
  • Loading branch information
natano committed Mar 24, 2022
1 parent 5598a8d commit 6e22203
Showing 1 changed file with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,26 @@ local already_loaded = {}
local judgment_dirs = FILEMAN:GetDirListing(THEME:GetCurrentThemeDirectory().."Graphics/_judgments/", true, false)

for profile in ivalues(args.profile_data) do
if profile.judgment ~= nil and profile.judgment ~= "" and not FindInTable(profile.judgment, already_loaded) then

for dir in ivalues(judgment_dirs) do

-- THEME:GetCurrentThemeDirectory() already has a trailing slash.
local path = ("/%sGraphics/_judgments/%s/%s"):format(THEME:GetCurrentThemeDirectory(), dir, profile.judgment)
if FILEMAN:DoesFileExist(path) then

af[#af+1] = Def.Sprite{
Name="JudgmentGraphic_"..StripSpriteHints(profile.judgment),
Texture=path,
InitCommand=function(self)
self:y(-50):animate(false)
end
}

table.insert(already_loaded, profile.judgment)
break
if profile.judgment ~= nil and profile.judgment ~= "" then
local name = StripSpriteHints(profile.judgment)
if not FindInTable(name, already_loaded) then
for dir in ivalues(judgment_dirs) do

-- THEME:GetCurrentThemeDirectory() already has a trailing slash.
local path = ("/%sGraphics/_judgments/%s/%s"):format(THEME:GetCurrentThemeDirectory(), dir, profile.judgment)
if FILEMAN:DoesFileExist(path) then

af[#af+1] = Def.Sprite{
Name="JudgmentGraphic_"..name,
Texture=path,
InitCommand=function(self)
self:y(-50):animate(false)
end
}

table.insert(already_loaded, name)
break
end
end
end
end
Expand Down

0 comments on commit 6e22203

Please sign in to comment.