> cleaner positioning code for badges in result
This commit is contained in:
parent
ee62651917
commit
65455099d9
|
@ -72,13 +72,34 @@ local difficultyLabelImages = {
|
||||||
}
|
}
|
||||||
|
|
||||||
local clearBadgeImages = {
|
local clearBadgeImages = {
|
||||||
gfx.CreateSkinImage("result/clears/CRASH.png", 0),
|
{
|
||||||
gfx.CreateSkinImage("result/clears/CRASH.png", 0),
|
image = gfx.CreateSkinImage("result/clears/CRASH.png", 0),
|
||||||
gfx.CreateSkinImage("result/clears/COMPLETE.png", 0),
|
xPos = 970
|
||||||
gfx.CreateSkinImage("result/clears/COMPLETE.png", 0),
|
},
|
||||||
gfx.CreateSkinImage("result/clears/UC.png", 0),
|
{
|
||||||
gfx.CreateSkinImage("result/clears/PUC.png", 0),
|
image = gfx.CreateSkinImage("result/clears/CRASH.png", 0),
|
||||||
gfx.CreateSkinImage("result/clears/AUTOPLAY.png", 0)
|
xPos = 970
|
||||||
|
},
|
||||||
|
{
|
||||||
|
image = gfx.CreateSkinImage("result/clears/COMPLETE.png", 0),
|
||||||
|
xPos = 1090
|
||||||
|
},
|
||||||
|
{
|
||||||
|
image = gfx.CreateSkinImage("result/clears/COMPLETE.png", 0),
|
||||||
|
xPos = 1090
|
||||||
|
},
|
||||||
|
{
|
||||||
|
image = gfx.CreateSkinImage("result/clears/UC.png", 0),
|
||||||
|
xPos = 1150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
image = gfx.CreateSkinImage("result/clears/PUC.png", 0),
|
||||||
|
xPos = 1080
|
||||||
|
},
|
||||||
|
{
|
||||||
|
image = gfx.CreateSkinImage("result/clears/AUTOPLAY.png", 0),
|
||||||
|
xPos = 1080
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- ANIMS
|
-- ANIMS
|
||||||
|
@ -244,53 +265,16 @@ local drawRightPanelContent = function()
|
||||||
local highScoreDelta = result.score - highScoreScore
|
local highScoreDelta = result.score - highScoreScore
|
||||||
|
|
||||||
-- Draw clear badge
|
-- Draw clear badge
|
||||||
local badgeImage = clearBadgeImages[result.badge + 1] or clearBadgeImages[1]
|
local badgeData = clearBadgeImages[result.badge + 1] or clearBadgeImages[1]
|
||||||
if (result.autoplay) then
|
if (result.autoplay) then
|
||||||
badgeImage = clearBadgeImages[7]; -- Display AUTOPLAY badge
|
badgeData = clearBadgeImages[7]; -- Display AUTOPLAY badge
|
||||||
end
|
|
||||||
if badgeImage == clearBadgeImages[1] then -- Adjustments CRASH
|
|
||||||
local tw, th = gfx.ImageSize(badgeImage);
|
|
||||||
gfx.BeginPath();
|
|
||||||
gfx.ImageRect(rightPanelX + 970 - tw, rightPanelY - 10, tw * 0.85,
|
|
||||||
th * 0.85, badgeImage, 1, 0);
|
|
||||||
end
|
|
||||||
if badgeImage == clearBadgeImages[2] then -- Adjustments CRASH
|
|
||||||
local tw, th = gfx.ImageSize(badgeImage);
|
|
||||||
gfx.BeginPath();
|
|
||||||
gfx.ImageRect(rightPanelX + 970 - tw, rightPanelY - 10, tw * 0.85,
|
|
||||||
th * 0.85, badgeImage, 1, 0);
|
|
||||||
end
|
|
||||||
if badgeImage == clearBadgeImages[3] then -- Adjustments COMP
|
|
||||||
local tw, th = gfx.ImageSize(badgeImage);
|
|
||||||
gfx.BeginPath();
|
|
||||||
gfx.ImageRect(rightPanelX + 1090 - tw, rightPanelY - 10, tw * 0.85,
|
|
||||||
th * 0.85, badgeImage, 1, 0);
|
|
||||||
end
|
|
||||||
if badgeImage == clearBadgeImages[4] then -- Adjustments COMP
|
|
||||||
local tw, th = gfx.ImageSize(badgeImage);
|
|
||||||
gfx.BeginPath();
|
|
||||||
gfx.ImageRect(rightPanelX + 1090 - tw, rightPanelY - 10, tw * 0.85,
|
|
||||||
th * 0.85, badgeImage, 1, 0);
|
|
||||||
end
|
|
||||||
if badgeImage == clearBadgeImages[5] then -- Adjustments UC
|
|
||||||
local tw, th = gfx.ImageSize(badgeImage);
|
|
||||||
gfx.BeginPath();
|
|
||||||
gfx.ImageRect(rightPanelX + 1150 - tw, rightPanelY - 10, tw * 0.85,
|
|
||||||
th * 0.85, badgeImage, 1, 0);
|
|
||||||
end
|
|
||||||
if badgeImage == clearBadgeImages[6] then -- Adjustments PUC
|
|
||||||
local tw, th = gfx.ImageSize(badgeImage);
|
|
||||||
gfx.BeginPath();
|
|
||||||
gfx.ImageRect(rightPanelX + 1080 - tw, rightPanelY - 10, tw * 0.85,
|
|
||||||
th * 0.85, badgeImage, 1, 0);
|
|
||||||
end
|
|
||||||
if badgeImage == clearBadgeImages[7] then -- Adjustments AUTOPLAY
|
|
||||||
local tw, th = gfx.ImageSize(badgeImage);
|
|
||||||
gfx.BeginPath();
|
|
||||||
gfx.ImageRect(rightPanelX + 1080 - tw, rightPanelY - 10, tw * 0.85,
|
|
||||||
th * 0.85, badgeImage, 1, 0);
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local tw, th = gfx.ImageSize(badgeData.image);
|
||||||
|
gfx.BeginPath();
|
||||||
|
gfx.ImageRect(rightPanelX + badgeData.xPos - tw, rightPanelY - 10, tw * 0.85,
|
||||||
|
th * 0.85, badgeData.image, 1, 0);
|
||||||
|
|
||||||
-- Draw song name and artist
|
-- Draw song name and artist
|
||||||
gfx.FontSize(28)
|
gfx.FontSize(28)
|
||||||
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)
|
||||||
|
|
Loading…
Reference in New Issue