diff --git a/portable_config/input_uosc.conf b/portable_config/input_uosc.conf index 218063da..ad004e70 100644 --- a/portable_config/input_uosc.conf +++ b/portable_config/input_uosc.conf @@ -11,6 +11,7 @@ # script-binding uosc/video #! 导航 > ※ 视频轨列表 # script-binding uosc/audio #! 导航 > ※ 音频轨列表 # script-binding uosc/subtitles #! 导航 > ※ 字幕轨列表 +# script-binding uosc/subtitles-sec #! 导航 > ※ 次字幕轨列表 # playlist-shuffle #! 导航 > 播放列表乱序重排 # script-binding uosc/shot #! ※ 截屏 diff --git a/portable_config/scripts/uosc/lib/lang.lua b/portable_config/scripts/uosc/lib/lang.lua index a9c58bf6..a240f513 100644 --- a/portable_config/scripts/uosc/lib/lang.lua +++ b/portable_config/scripts/uosc/lib/lang.lua @@ -98,6 +98,7 @@ ulang = { _input_empty = 'input-bindings 为空', _sid_submenu_title = '字幕轨列表', + _sid_sec_submenu_title = '次字幕轨列表', _aid_submenu_title = '音频轨列表', _vid_submenu_title = '视频轨列表', _playlist_submenu_title = '播放列表', diff --git a/portable_config/scripts/uosc/lib/menus.lua b/portable_config/scripts/uosc/lib/menus.lua index 0b4e53d5..755a682e 100644 --- a/portable_config/scripts/uosc/lib/menus.lua +++ b/portable_config/scripts/uosc/lib/menus.lua @@ -126,6 +126,7 @@ function create_select_tracklist_type_menu_opener(menu_title, track_type, track_ for _, track in ipairs(tracklist) do if track.type == track_type then local hint_values = {} + local selected_by_prop = track.selected and utils.to_string(track.id) == mp.get_property(track_prop) local function h(value) hint_values[#hint_values + 1] = value end if track.lang then h(track.lang:upper()) end @@ -144,10 +145,10 @@ function create_select_tracklist_type_menu_opener(menu_title, track_type, track_ title = (track.title and track.title or ulang._submenu_id_title .. track.id), hint = table.concat(hint_values, ', '), value = track.id, - active = track.selected, + active = selected_by_prop, } - if track.selected then + if selected_by_prop then if disabled_item then disabled_item.active = false end active_index = #items end diff --git a/portable_config/scripts/uosc/main.lua b/portable_config/scripts/uosc/main.lua index 98bdb91d..da65851e 100644 --- a/portable_config/scripts/uosc/main.lua +++ b/portable_config/scripts/uosc/main.lua @@ -880,6 +880,9 @@ bind_command('load-video', create_track_loader_menu_opener({ bind_command('subtitles', create_select_tracklist_type_menu_opener( ulang._sid_submenu_title, 'sub', 'sid', 'script-binding uosc/load-subtitles', 'script-binding uosc/download-subtitles' )) +bind_command('subtitles-sec', create_select_tracklist_type_menu_opener( + ulang._sid_sec_submenu_title, 'sub', 'secondary-sid', 'script-binding uosc/load-subtitles', 'script-binding uosc/download-subtitles' +)) bind_command('audio', create_select_tracklist_type_menu_opener( ulang._aid_submenu_title, 'audio', 'aid', 'script-binding uosc/load-audio' ))