summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2025-05-05 14:10:56 -0700
committerDavid Vazgenovich Shakaryan <dvshakaryan@gmail.com>2025-05-05 14:10:56 -0700
commit5e69e25df6ef735be6e703456ceabedd4d2529ed (patch)
tree79d038f856141d933284ef33e8836271dfb483fd
parentd0dca9f93c69d3db4c8836d49dba00221b8d24a5 (diff)
downloadmpv-iptv-menu-5e69e25df6ef735be6e703456ceabedd4d2529ed.tar.gz
mpv-iptv-menu-5e69e25df6ef735be6e703456ceabedd4d2529ed.tar.xz
display selected category
-rw-r--r--main.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/main.lua b/main.lua
index 25d53f8..76fc7b8 100644
--- a/main.lua
+++ b/main.lua
@@ -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