From 4f82c6c5aaef18ee7686298a1bd0b8fff39aafdd Mon Sep 17 00:00:00 2001 From: FajsiEx Date: Mon, 25 Oct 2021 21:06:06 +0200 Subject: [PATCH] * rewrite the scoreboard --- scripts/songselect/songwheel.lua | 64 +++++++++++++++----------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/scripts/songselect/songwheel.lua b/scripts/songselect/songwheel.lua index 510235d..e19f294 100644 --- a/scripts/songselect/songwheel.lua +++ b/scripts/songselect/songwheel.lua @@ -12,7 +12,7 @@ local effectedBgImage = gfx.CreateSkinImage("song_select/data_panel/effected_bg. local illustratedBgImage = gfx.CreateSkinImage("song_select/data_panel/illust_bg.png", 1) local songPlateBg = gfx.CreateSkinImage("song_select/plate/bg.png", 1) local songPlateBottomBarOverlayImage = gfx.CreateSkinImage("song_select/plate/bottom_bar_overlay.png", 1) -local tstImage = gfx.CreateSkinImage("song_select/textboard.png", 1) +local scoreBoardBarBgImage = gfx.CreateSkinImage("song_select/textboard.png", 1) local crownImage = gfx.CreateSkinImage("song_select/crown.png", 1) local laserAnimBaseImage = gfx.CreateSkinImage("song_select/laser_anim.png", 1) @@ -475,58 +475,52 @@ function drawData() -- Draws the song data on the left panel gfx.ImageRect(DIFF_X_START+(index-1)*DIFF_GAP-tw/2, 1050, tw, th, diffLabelImage, 1, 0) end gfx.GlobalAlpha(1); + -local drawTOPLAY = function() -local topX = 430 -local topTX = 326 -local div = 33 -local divH = 1300 -local spdiv= 33.3 + -- Scoreboard gfx.LoadSkinFont('Digital-Serial-Bold.ttf') gfx.FontSize(32) + + local scoreBoardX = 75; + local scoreBoardY = 1250; + + local sbBarWidth = 336*1.2; + local sbBarHeight = 33; + + local sbBarContentLeftX = scoreBoardX + sbBarWidth/2 - 30; + local sbBarContentRightX = scoreBoardX + sbBarWidth/2 + 30; + + -- Draw the header gfx.BeginPath(); - gfx.ImageRect(75, 1250, 336*1.2, spdiv, tstImage, 1, 0); - gfx.BeginPath(); - gfx.ImageRect(75, 1250+spdiv, 336*1.2, spdiv, tstImage, 1, 0); - gfx.BeginPath(); - gfx.ImageRect(75, 1250+spdiv+spdiv, 336*1.2, spdiv, tstImage, 1, 0); - gfx.BeginPath(); - gfx.ImageRect(75, 1250+spdiv+spdiv+spdiv, 336*1.2, spdiv, tstImage, 1, 0); - gfx.BeginPath(); - gfx.ImageRect(75, 1250+spdiv+spdiv+spdiv+spdiv, 336*1.2, spdiv, tstImage, 1, 0); - gfx.BeginPath(); - gfx.ImageRect(75, 1250+spdiv+spdiv+spdiv+spdiv+spdiv, 336*1.2, spdiv, tstImage, 1, 0); + gfx.ImageRect(scoreBoardX, scoreBoardY, sbBarWidth, sbBarHeight, scoreBoardBarBgImage, 1, 0); + gfx.BeginPath(); gfx.ImageRect(205, 1252.5, 800*0.045, 600*0.045, crownImage, 1, 0); - gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_MIDDLE) + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE) + gfx.BeginPath(); + gfx.Text("TOP", sbBarContentRightX, scoreBoardY + sbBarHeight/2); - gfx.Text("TOP", topTX+div/2, divH-div); - gfx.Text(scoreNumber, topX, divH); - gfx.Text(game.GetSkinSetting("username"), topX/1.78, divH); + for i = 1, 5, 1 do + gfx.BeginPath(); + gfx.ImageRect(scoreBoardX, scoreBoardY + i*sbBarHeight, sbBarWidth, sbBarHeight, scoreBoardBarBgImage, 1, 0); - gfx.Text(scoreNumber, topX, divH+div); - gfx.Text(game.GetSkinSetting("username"), topX/1.78, divH+div); + gfx.TextAlign(gfx.TEXT_ALIGN_RIGHT + gfx.TEXT_ALIGN_MIDDLE) + gfx.BeginPath(); + gfx.Text(game.GetSkinSetting("username"), sbBarContentLeftX, scoreBoardY + sbBarHeight/2 + i*sbBarHeight); - gfx.Text(scoreNumber, topX, divH+div+div); - gfx.Text(game.GetSkinSetting("username"), topX/1.78, divH+div+div); + gfx.TextAlign(gfx.TEXT_ALIGN_LEFT + gfx.TEXT_ALIGN_MIDDLE) + gfx.BeginPath(); + gfx.Text((diff.scores[i]) and diff.scores[i].score or "00000000", sbBarContentRightX, scoreBoardY + sbBarHeight/2 + i*sbBarHeight); + end - gfx.Text(scoreNumber, topX, divH+div+div+div); - gfx.Text(game.GetSkinSetting("username"), topX/1.78, divH+div+div+div); - - gfx.Text(scoreNumber, topX, divH+div+div+div+div); - gfx.Text(game.GetSkinSetting("username"), topX/1.78, divH+div+div+div+div); - - -end gfx.FontSize(22) gfx.GlobalAlpha(transitionAfterscrollDataOverlayAlpha); gfx.Text(diff.effector, 270, 1180); -- effected by gfx.Text(diff.illustrator, 270, 1210); -- illustrated by gfx.GlobalAlpha(1); -drawTOPLAY() end function drawFilterInfo(deltatime)