-
Notifications
You must be signed in to change notification settings - Fork 69
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
Menu script-message changes #653
Conversation
fa5d96c
to
14a49a8
Compare
That was the next thing on my to-do list :) The only thing it's missing is keeping track of currently opened menu on the |
Also, all the menu toggling bindings (menu, subtitles, ...) need to be updated as they no longer toggle. |
Scripts that open their menu already know the type, no need to query a property to update their own menu.
They do still toggle, I made sure of that before submitting it. |
Wait I don't understand now. You need to know if your menu is open to send either I thought that the rework is supposed to implement @po5's requests that:
which I agree with. But then you need to be able to check what menu and of what type is currently open to re-implement these functionalities. Also, |
e5506ef
to
52b427f
Compare
E.g. in quality-menu settting on_close and reacting to it. |
True, that is a viable alternative. But imo accessing a Regardless, I recall this being a requested feature (though I can't remember context anymore), it feels useful for scripts to be able to detect open menus, I think we should provide it, and it feels like it should be part of this PR. Since these are potentially breaking changes, I want to squash it into one |
52b427f
to
b0c85a9
Compare
Added the new property. |
b0c85a9
to
de80bbc
Compare
- `open-menu` now only opens the menu, while closing any existing one first, even if it has the same `type`. - `update-menu` will only update a currently opened menu of the same type. If no menu is open, or current menu's type is different, it doesn't do anything. - `close-menu [type]` can be used to close any currently opened menu when called without a `[type]` argument, or only a menu of `[type]` type. - uosc now keeps track of a currently opened menu type on the `user-data/uosc/menu/type` property, accessible via `mp.get_property_native('user-data/uosc/menu/type')`. This property is `nil` if no uosc menu is opened. This is to achieve a predictable and granular control of menus with no implicit magic going on in the background. The main difference is that `open-menu` can no longer be used to toggle the menu. You have to implement toggling manually by calling `open-menu` or `close-menu [type]` when appropriate. You can check if your menu is still opened either by getting or observing the `user-data/uosc/menu/type` property, or using the `on_close` menu callback.
Ref. #587 (comment)