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

feat: set-button API for scripts to add custom control bar buttons #938

Merged
merged 3 commits into from
Jul 29, 2024

Conversation

tomasklaen
Copy link
Owner

Adds set-button <name> <data_json> message external scripts can send to add or update buttons whose state, look, and click action is defined by data_json.

Users can then add this button into their controls bar with button:<name> syntax.

Example:

mp.commandv('script-message-to', 'uosc', 'set-button', 'button-name', utils.format_json({
  icon = 'icon_name',
  active = true,
  badge = '0',
  tooltip = 'Button tooltip',
  command = 'command to send on click',
}))

Button data interface (pseudo types):

{
  icon: string;
  active?: boolean;
  badge?: string;
  command?: string | string[];
  tooltip?: string;
}

closes #935

Adds `set-button <name> <data_json>` message external scripts can send to add or update buttons whose state, look, and click action is defined by `data_json`.

Users can then add this button into their controls bar with `button:<name>` syntax.
@tomasklaen tomasklaen merged commit fe0d394 into main Jul 29, 2024
@tomasklaen tomasklaen deleted the managed-buttons branch July 29, 2024 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

how do I combine the repeat playlist button?
1 participant