Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [code]
- diff --git a/player/lua/osc.lua b/player/lua/osc.lua
- index a6cdcbe..7b128fa 100644
- --- a/player/lua/osc.lua
- +++ b/player/lua/osc.lua
- @@ -637,7 +637,20 @@ function render_elements(master_ass)
- elem_ass:append(string.format("{\\1a&H%X&\\2a&H%X&\\3a&H%X&\\4a&H%X&}",
- ar[1], ar[2], ar[3], ar[4]))
- - elem_ass:append(tooltiplabel)
- + local chapters = mp.get_property_native("chapter-list", {})
- +
- + if (#chapters > 0) then
- + local current_chapter = chapters[#chapters].title
- + for n = 1, #chapters do
- + if (mp.format_time(chapters[n].time) > tooltiplabel) then
- + current_chapter = chapters[n-1].title
- + break
- + end
- + end
- + elem_ass:append(tooltiplabel .. " - " .. current_chapter)
- + else
- + elem_ass:append(tooltiplabel)
- + end
- end
- end
- [/code]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement