* define number of songs drawn around the selected one in a constant
This commit is contained in:
parent
bcfe54fa3b
commit
fdff69f762
|
@ -125,11 +125,22 @@ function drawSong(song, y)
|
|||
end
|
||||
|
||||
function drawSongList()
|
||||
drawSong(songwheel.songs[selectedIndex-2], desh/2-172/2-172*2)
|
||||
drawSong(songwheel.songs[selectedIndex-1], desh/2-172/2-172)
|
||||
local numOfSongsAround = 4; -- How many songs should be up and how many should be down of the selected one
|
||||
|
||||
local i=1;
|
||||
while (i <= numOfSongsAround) do
|
||||
drawSong(songwheel.songs[selectedIndex-i], desh/2-172/2-172*i)
|
||||
i=i+1;
|
||||
end;
|
||||
|
||||
-- Draw the selected song
|
||||
drawSong(songwheel.songs[selectedIndex], desh/2-172/2)
|
||||
drawSong(songwheel.songs[selectedIndex+1], desh/2-172/2+172)
|
||||
drawSong(songwheel.songs[selectedIndex+2], desh/2-172/2+172*2)
|
||||
|
||||
i=1;
|
||||
while (i <= numOfSongsAround) do
|
||||
drawSong(songwheel.songs[selectedIndex+i], desh/2-172/2+172*i)
|
||||
i=i+1;
|
||||
end;
|
||||
end
|
||||
|
||||
function drawCursor()
|
||||
|
|
Loading…
Reference in New Issue