fix edge case where songwheel would break if there is no song in index #7

Merged
Kuenaimaku merged 1 commits from bugfix/filterwheel-collections-no-song-fix into master 2022-03-23 23:53:49 +01:00
1 changed files with 3 additions and 2 deletions

View File

@ -775,7 +775,6 @@ function drawScrollbar()
gfx.ImageRect(fillXPos, scrollbarYPos, sw, sh, scrollBarFillImage, 1, 0);
-- 1st letter of song title on scroll
local letter = string.upper(common.firstLetter(songwheel.songs[selectedIndex].title));
gfx.BeginPath()
gfx.FontSize(16)
gfx.LoadSkinFont('Digital-Serial-Bold.ttf')
@ -784,8 +783,10 @@ function drawScrollbar()
gfx.Fill()
gfx.FillColor(255,255,255)
gfx.TextAlign(gfx.TEXT_ALIGN_MIDDLE + gfx.TEXT_ALIGN_CENTER)
if (songwheel.songs[selectedIndex] ~= nil) then
local letter = string.upper(common.firstLetter(songwheel.songs[selectedIndex].title));
gfx.Text(letter, fillXPos-10, scrollbarYPos + 5);
end
end
function refreshIrLeaderboard(deltaTime)