diff options
author | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2025-05-08 00:37:37 -0700 |
---|---|---|
committer | David Vazgenovich Shakaryan <dvshakaryan@gmail.com> | 2025-05-08 00:37:37 -0700 |
commit | 66dca0016a0332d774cec039f7e0f4a7b0c0f1af (patch) | |
tree | 3c679459fa68392ee78a8d9982d2142002352e3e /main.lua | |
parent | 87deec5471fd7619df634c07188eec34149f88f9 (diff) | |
download | mpv-iptv-menu-66dca0016a0332d774cec039f7e0f4a7b0c0f1af.tar.gz mpv-iptv-menu-66dca0016a0332d774cec039f7e0f4a7b0c0f1af.tar.xz |
colour currently playing icon
Diffstat (limited to 'main.lua')
-rw-r--r-- | main.lua | 18 |
1 files changed, 12 insertions, 6 deletions
@@ -16,7 +16,7 @@ local osd_cursor_glyph = '{\\p1\\pbo' .. math.floor(font_size / 5) .. '}' .. ' 0 ' .. font_size .. '{\\p0}' local osd_bg = mp.create_osd_overlay('ass-events') osd_bg.z = -1 -osd_bg.data = '{\\alpha&H50&\\c&H&\\pos(0,0)}' .. +osd_bg.data = '{\\alpha&H44&\\c&H&\\pos(0,0)}' .. '{\\p1}m 0 0 l 9999 0 9999 720 0 720{\\p0}' local categories = {} @@ -76,20 +76,26 @@ local function update_osd() menu.page_pos + osd_menu_lines() - 1, #menu.options) do local opt = menu.options[i] local str = opt.name + local col + local icons = '' if opt.type == 'category' then str = '[' .. str .. ']' + col = '99DDFF' elseif opt.stream_id == playing_stream_id then - str = '▶ ' .. str + icons = icons .. '{\\c&HFF6633&&}\226\143\186{\\c} ' end if i == menu.cursor_pos and not menu.search_active then - str = '{\\c&HFF00&}› ' .. str .. '{\\c}' - elseif opt.type == 'category' then - str = '{\\c&H99DDFF&}' .. str .. '{\\c}' + col = 'FF00' + icons = '{\\c&H' .. col .. '&}›{\\c} ' .. icons end - out[#out+1] = str + if col then + str = '{\\c&H' .. col .. '&}' .. str .. '{\\c}' + end + + out[#out+1] = icons .. str end -- \q2 disables line wrapping |