diff --git a/scripts/result.lua b/scripts/result.lua index f296b7b..dbb7a92 100644 --- a/scripts/result.lua +++ b/scripts/result.lua @@ -72,13 +72,34 @@ local difficultyLabelImages = { } local clearBadgeImages = { - gfx.CreateSkinImage("result/clears/CRASH.png", 0), - gfx.CreateSkinImage("result/clears/CRASH.png", 0), - gfx.CreateSkinImage("result/clears/COMPLETE.png", 0), - gfx.CreateSkinImage("result/clears/COMPLETE.png", 0), - gfx.CreateSkinImage("result/clears/UC.png", 0), - gfx.CreateSkinImage("result/clears/PUC.png", 0), - gfx.CreateSkinImage("result/clears/AUTOPLAY.png", 0) + { + image = gfx.CreateSkinImage("result/clears/CRASH.png", 0), + xPos = 970 + }, + { + image = gfx.CreateSkinImage("result/clears/CRASH.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 @@ -244,53 +265,16 @@ local drawRightPanelContent = function() local highScoreDelta = result.score - highScoreScore -- 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 - badgeImage = 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); + badgeData = clearBadgeImages[7]; -- Display AUTOPLAY badge 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 gfx.FontSize(28) gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE)