+ badges to songwheel plates

This commit is contained in:
FajsiEx 2021-07-30 18:27:43 +02:00
parent a7fef7687f
commit 5861b249de
1 changed files with 29 additions and 2 deletions

View File

@ -3,6 +3,8 @@ local backgroundImage = gfx.CreateSkinImage("song_select/bg.png", 1)
local songPlateBg = gfx.CreateSkinImage("song_select/plate/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 songPlateBottomBarOverlayImage = gfx.CreateSkinImage("song_select/plate/bottom_bar_overlay.png", 1)
local cursorImage = gfx.CreateSkinImage("song_select/cursor.png", 1)
local difficultyLabelImages = { local difficultyLabelImages = {
gfx.CreateSkinImage("song_select/plate/difficulty_labels/novice.png", 1), gfx.CreateSkinImage("song_select/plate/difficulty_labels/novice.png", 1),
gfx.CreateSkinImage("song_select/plate/difficulty_labels/advanced.png", 1), gfx.CreateSkinImage("song_select/plate/difficulty_labels/advanced.png", 1),
@ -14,6 +16,15 @@ local difficultyLabelImages = {
gfx.CreateSkinImage("song_select/plate/difficulty_labels/vivid.png", 1), gfx.CreateSkinImage("song_select/plate/difficulty_labels/vivid.png", 1),
} }
local badgeImages = {
gfx.CreateSkinImage("song_select/medal/nomedal.png", 1),
gfx.CreateSkinImage("song_select/medal/played.png", 1),
gfx.CreateSkinImage("song_select/medal/cleared.png", 1),
gfx.CreateSkinImage("song_select/medal/hard.png", 1),
gfx.CreateSkinImage("song_select/medal/uc.png", 1),
gfx.CreateSkinImage("song_select/medal/puc.png", 1),
}
local difficultyNumbers; local difficultyNumbers;
local resx, resy = game.GetResolution() local resx, resy = game.GetResolution()
@ -76,6 +87,8 @@ end
function drawSong(song, y) function drawSong(song, y)
local songX = desw/2+28 local songX = desw/2+28
local selectedSongDifficulty = song.difficulties[selectedDifficulty]
local bestScore = selectedSongDifficulty.scores[1] or nil;
-- Draw the bg for the song plate -- Draw the bg for the song plate
gfx.BeginPath() gfx.BeginPath()
@ -92,12 +105,20 @@ function drawSong(song, y)
-- Draw the difficulty notch background -- Draw the difficulty notch background
gfx.BeginPath() gfx.BeginPath()
gfx.ImageRect(songX, y+95, 83, 74, difficultyLabelImages[song.difficulties[selectedDifficulty].difficulty+1], 1, 0) gfx.ImageRect(songX, y+95, 83, 74, difficultyLabelImages[selectedSongDifficulty.difficulty+1], 1, 0)
-- Draw the difficulty level number -- Draw the difficulty level number
gfx.BeginPath() gfx.BeginPath()
draw_number(songX+30, y+125, 1.0, song.difficulties[selectedDifficulty].level, 2, difficultyNumbers, false, 0.65, 1) draw_number(songX+30, y+125, 1.0, selectedSongDifficulty.level, 2, difficultyNumbers, false, 0.65, 1)
-- Draw score badge
local badgeImage = badgeImages[1];
if bestScore and bestScore.badge > 0 then
badgeImage = badgeImages[bestScore.badge+1];
end
gfx.BeginPath()
gfx.ImageRect(songX+282, y+44, 79, 69, badgeImage, 1, 0)
end end
function drawSongList() function drawSongList()
@ -108,6 +129,11 @@ function drawSongList()
drawSong(songwheel.songs[selectedIndex+2], desh/2-172/2+172*2) drawSong(songwheel.songs[selectedIndex+2], desh/2-172/2+172*2)
end end
function drawCursor()
gfx.BeginPath()
gfx.ImageRect(desw/2-14, desh/2-213/2, 555, 213, cursorImage, 1, 0)
end
render = function (deltaTime) render = function (deltaTime)
resetLayoutInformation(); resetLayoutInformation();
gfx.Scale(scale, scale); gfx.Scale(scale, scale);
@ -119,6 +145,7 @@ render = function (deltaTime)
drawBackground(); drawBackground();
drawSongList() drawSongList()
drawCursor()
gfx.BeginPath(); gfx.BeginPath();
gfx.FontSize(18) gfx.FontSize(18)