diff --git a/scripts/result.lua b/scripts/result.lua index 0aeb345..e91c95c 100644 --- a/scripts/result.lua +++ b/scripts/result.lua @@ -15,6 +15,8 @@ local bottomPanelImage = gfx.CreateSkinImage("result/panels/bottom.png", 0); local defaultJacketImage = gfx.CreateSkinImage("result/default_jacket.png", 0); +local bestScoreBadgeImage = gfx.CreateSkinImage("result/best.png", 0); + local appealCardImage = gfx.CreateSkinImage("appeal_card.png", 0); local danBadgeImage = gfx.CreateSkinImage("dan/inf.png", 0); local volforceBadgeImage = gfx.CreateSkinImage("volforce/10.png", 0); @@ -175,6 +177,13 @@ end local scoreNumber = load_number_image("score_num"); local drawRightPanelContent = function() + local highScoreScore = 0; + if highScore then + highScoreScore = highScore.score + end + + local highScoreDelta = result.score - highScoreScore + -- Draw song name and artist gfx.FontSize(28) gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE) @@ -185,6 +194,12 @@ local drawRightPanelContent = function() draw_number(rightPanelX+580, rightPanelY+192, 1.0, math.floor(result.score / 10000), 4, scoreNumber, true, 0.42, 1.12) draw_number(rightPanelX+768, rightPanelY+202, 1.0, result.score, 4, scoreNumber, true, 0.25, 1.12) + -- If this is the highscore, draw over the glowing best badge + if highScoreDelta > 0 then + gfx.BeginPath(); + gfx.ImageRect(rightPanelX+364, rightPanelY+167, 97, 53, bestScoreBadgeImage, 1, 0); + end + -- Draw grade local gradeImageKey = string.gsub(result.grade, '+', '_P'); local gradeImage = gradeImages[gradeImageKey] or gradeImages.D @@ -196,12 +211,6 @@ local drawRightPanelContent = function() gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_MIDDLE) gfx.LoadSkinFont('Digital-Serial-Bold.ttf') - local highScoreScore = 0; - if highScore then - highScoreScore = highScore.score - end - - local highScoreDelta = result.score - highScoreScore local deltaPrefix = '-' if highScoreDelta > 0 then deltaPrefix = '+' diff --git a/textures/result/best.png b/textures/result/best.png new file mode 100644 index 0000000..f68501b Binary files /dev/null and b/textures/result/best.png differ diff --git a/textures/result/panels/right.png b/textures/result/panels/right.png index 72cb90f..81d13a5 100644 Binary files a/textures/result/panels/right.png and b/textures/result/panels/right.png differ