Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve mpv-menu-plugin support #31

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions recentmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ local menu = {

local dyn_menu = {
ready = false,
script_name = 'dyn_menu',
type = 'submenu',
submenu = {}
}
Expand Down Expand Up @@ -301,7 +302,7 @@ function update_dyn_menu_items()
}
end
dyn_menu.submenu = submenu
mp.commandv('script-message-to', 'dyn_menu', 'update', 'recent', utils.format_json(dyn_menu))
mp.commandv('script-message-to', dyn_menu.script_name, 'update', 'recent', utils.format_json(dyn_menu))
end

function play_last()
Expand Down Expand Up @@ -358,7 +359,8 @@ mp.register_script_message('uosc-locale', function(json)
menu.title = t(menu.title)
end)

mp.register_script_message('menu-ready', function()
mp.register_script_message('menu-ready', function(script_name)
dyn_menu.ready = true
dyn_menu.script_name = script_name
update_dyn_menu_items()
end)