diff --git a/scripts/components/danbadge.lua b/scripts/components/danbadge.lua index e0371d7..17ded69 100644 --- a/scripts/components/danbadge.lua +++ b/scripts/components/danbadge.lua @@ -4,28 +4,21 @@ local isBadge = game.GetSkinSetting("is_badges") local none = gfx.CreateSkinImage("dan/none.png", 1) +if not isBadge then + badgePath = "dan/original/" .. badges .. ".png" +else + badgePath = "dan/custom/" .. customBadges .. ".png" +end + +local newBadge = gfx.CreateSkinImage(badgePath, 1) + local badger = function(isDemo) - local newBadge local finalBadge - if not isBadge then - newBadge = gfx.CreateSkinImage("dan/original/"..badges..".png", 1) - if isDemo then - finalBadge = none - elseif badges ~= "NONE" then - finalBadge = newBadge - else - finalBadge = none - end + if isDemo or badges == "NONE" then + finalBadge = none else - newBadge = gfx.CreateSkinImage("dan/custom/"..customBadges..".png", 1) - if isDemo then - finalBadge = none - elseif badges ~= "NONE" then - finalBadge = newBadge - else - finalBadge = none - end + finalBadge = newBadge end return finalBadge diff --git a/scripts/gameplay/user_panel.lua b/scripts/gameplay/user_panel.lua index 83dd4c6..5c73b3e 100644 --- a/scripts/gameplay/user_panel.lua +++ b/scripts/gameplay/user_panel.lua @@ -156,13 +156,14 @@ local render = function (deltaTime, score, bestReplay,users) return end - for i, u in ipairs(users) do - local posistion_w, posistion_h = gfx.ImageSize(pos[i]); - gfx.BeginPath(); - if u.name == username then - gfx.ImageRect(x + 215, y + 78, posistion_w/1.17, posistion_h/1.17, pos[i], 1, 0); - end - end + for i, u in ipairs(users) do + local posistion_w, posistion_h = gfx.ImageSize(pos[i]); + gfx.BeginPath(); + if u.name == username then + gfx.ImageRect(x + 215, y + 78, posistion_w/1.17, posistion_h/1.17, pos[i], 1, 0); + end + return + end else appealCardImage = gfx.CreateSkinImage("gameplay/user_panel/appeal_card.png", 0);