diff options
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -23,12 +23,16 @@ local menu_pos = {1} function update_osd() local out = {} + for i = 1, depth - 1 do + out[#out+1] = '{\\c&H999999&}[' .. + menus[i][menu_pos[i]]['category_name'] .. ']{\\c}' + end for i = menu_top[depth], math.min( - menu_top[depth] + osd_lines - 1, #menus[depth]) do + menu_top[depth] + osd_lines - depth, #menus[depth]) do local key = (depth == 1 and 'category_name' or 'name') local str = menus[depth][i][key] if i == menu_pos[depth] then - str = '{\\c&HFF00&}* ' .. str .. '{\\c&HFFFFFF&}' + str = '{\\c&HFF00&}* ' .. str .. '{\\c}' end out[#out+1] = str end @@ -56,7 +60,7 @@ function handle_down() end menu_pos[depth] = menu_pos[depth] + 1 - if menu_pos[depth] > menu_top[depth] + osd_lines - 1 then + if menu_pos[depth] > menu_top[depth] + osd_lines - depth then menu_top[depth] = menu_top[depth] + 1 end |