diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2025-05-05 14:10:56 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2025-05-05 14:10:56 -0700 |
commit | 5e69e25df6ef735be6e703456ceabedd4d2529ed (patch) | |
tree | 79d038f856141d933284ef33e8836271dfb483fd /main.lua | |
parent | d0dca9f93c69d3db4c8836d49dba00221b8d24a5 (diff) | |
download | mpv-iptv-menu-5e69e25df6ef735be6e703456ceabedd4d2529ed.tar.gz mpv-iptv-menu-5e69e25df6ef735be6e703456ceabedd4d2529ed.tar.xz |
display selected category
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 |