Fix for Lag caused by the Danbadge

This commit is contained in:
RealFD 2023-12-04 07:34:47 +01:00
parent 9083a790d4
commit 7373bc6fc2
2 changed files with 19 additions and 25 deletions

View File

@ -4,28 +4,21 @@ local isBadge = game.GetSkinSetting("is_badges")
local none = gfx.CreateSkinImage("dan/none.png", 1) 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 badger = function(isDemo)
local newBadge
local finalBadge local finalBadge
if not isBadge then if isDemo or badges == "NONE" then
newBadge = gfx.CreateSkinImage("dan/original/"..badges..".png", 1) finalBadge = none
if isDemo then
finalBadge = none
elseif badges ~= "NONE" then
finalBadge = newBadge
else
finalBadge = none
end
else else
newBadge = gfx.CreateSkinImage("dan/custom/"..customBadges..".png", 1) finalBadge = newBadge
if isDemo then
finalBadge = none
elseif badges ~= "NONE" then
finalBadge = newBadge
else
finalBadge = none
end
end end
return finalBadge return finalBadge

View File

@ -156,13 +156,14 @@ local render = function (deltaTime, score, bestReplay,users)
return return
end end
for i, u in ipairs(users) do for i, u in ipairs(users) do
local posistion_w, posistion_h = gfx.ImageSize(pos[i]); local posistion_w, posistion_h = gfx.ImageSize(pos[i]);
gfx.BeginPath(); gfx.BeginPath();
if u.name == username then if u.name == username then
gfx.ImageRect(x + 215, y + 78, posistion_w/1.17, posistion_h/1.17, pos[i], 1, 0); gfx.ImageRect(x + 215, y + 78, posistion_w/1.17, posistion_h/1.17, pos[i], 1, 0);
end end
end return
end
else else
appealCardImage = gfx.CreateSkinImage("gameplay/user_panel/appeal_card.png", 0); appealCardImage = gfx.CreateSkinImage("gameplay/user_panel/appeal_card.png", 0);