Skip to content

Commit

Permalink
配置更新
Browse files Browse the repository at this point in the history
  • Loading branch information
dyphire committed Jan 31, 2024
1 parent d18bc97 commit 93e9dd3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
11 changes: 11 additions & 0 deletions scripts/dyn_menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -512,3 +512,14 @@ if #menu_items > 0 then
else
mp.observe_property(menu_prop, 'native', menu_data_cb)
end

mp.register_script_message('menu-open', function()
mp.add_forced_key_binding('MBTN_LEFT', 'click_ignore')
end)

mp.register_script_message('menu-close', function()
local sec = mp.get_property_number("input-doubleclick-time", 300) / 1000
mp.add_timeout(sec, function()
mp.remove_key_binding('click_ignore')
end)
end)
Binary file modified scripts/menu.dll
Binary file not shown.
9 changes: 4 additions & 5 deletions scripts/subtitle-lines.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,13 @@ local function acquire_subtitles()
local sub_visibility = mp.get_property_bool(sub_strings.visibility)
mp.set_property_bool(sub_strings.visibility, false)

-- ensure we're at some subtitle
-- go to the first subtitle line
mp.commandv('set', sub_strings.delay, mp.get_property_number('duration', 0) + 365 * 24 * 60 * 60)
mp.commandv('sub-step', 1, sub_strings.step)
mp.commandv('sub-step', -1, sub_strings.step)

-- find first one
-- this shouldn't be necessary, but it's kept just in case there actually
-- are subtitles further in the past then the huge delay used above
local retry_delay = sub_delay
-- if we're not at the very beginning
-- this missies the first subtitle for some reason
while true do
mp.commandv('sub-step', -1, sub_strings.step)
local delay = mp.get_property_number(sub_strings.delay)
Expand Down

0 comments on commit 93e9dd3

Please sign in to comment.