diff --git a/scripts/songselect/filterwheel.lua b/scripts/songselect/filterwheel.lua index 951d699..83a609c 100644 --- a/scripts/songselect/filterwheel.lua +++ b/scripts/songselect/filterwheel.lua @@ -122,7 +122,11 @@ function getFolderData(folderLabel) local folderType = 'unknown'; if (string.find(folderLabel, 'Folder: ')) then folderType = 'folder'; - folderLabel = folderLabel:gsub('Folder: ', '') -- Delete the useless info + folderLabel = folderLabel:gsub('Folder: ', '') -- Delete default prefix + elseif (string.find(folderLabel, 'Level: ')) then + folderType = 'level'; + folderLabel = folderLabel:gsub('Level: ', '') -- Delete default prefix + folderLabel = 'LEVEL ' .. folderLabel; end local labelMatcherString = string.upper(folderLabel) @@ -170,28 +174,32 @@ end function drawFolderList() local numOfItemsAround = 7; local selectedIndex = 1; + local folderList = filters.folder; + if selectionMode == 'folders' then selectedIndex = selectedFolder + folderList = filters.folder; else selectedIndex = selectedLevel + folderList = filters.level; end local i = 1; while (i <= numOfItemsAround) do local index = getCorrectedIndex(selectedIndex, -i) - drawFolder(filters.folder[index], desh / 2 - ITEM_HEIGHT / 2 - + drawFolder(folderList[index], desh / 2 - ITEM_HEIGHT / 2 - ITEM_HEIGHT * i + transitionScrollOffsetY) i = i + 1; end -- Draw the selected song - drawFolder(filters.folder[selectedIndex], + drawFolder(folderList[selectedIndex], desh / 2 - ITEM_HEIGHT / 2 + transitionScrollOffsetY) i = 1; while (i <= numOfItemsAround) do local index = getCorrectedIndex(selectedIndex, i) - drawFolder(filters.folder[index], desh / 2 - ITEM_HEIGHT / 2 + + drawFolder(folderList[index], desh / 2 - ITEM_HEIGHT / 2 + ITEM_HEIGHT * i + transitionScrollOffsetY) i = i + 1; end