From 631e96c8cdde711b4bfd0e6603514b2909c5deb8 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Sat, 28 Aug 2021 22:03:48 +0300 Subject: [PATCH] add icons support to ui:show_buttons --- README.md | 2 ++ README_ru.md | 2 ++ main/kodi-remote-widget.lua | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1938d8b..742d43d 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,8 @@ First line
Second line Text on green background ``` +The `ui:show_buttons()` function supports Fontawesome icons. Simply specify `fa:icon_name` as the button name, for example: `fa:play`. + # Dialogs * `ui:show_dialog(title, text, [button1_text], [button2_text])` - show dialog, the first argument is the title, the second is the text, button1\_text is the name of the first button, button2\_text is the name of the second button; diff --git a/README_ru.md b/README_ru.md index 10dc751..61d6a34 100644 --- a/README_ru.md +++ b/README_ru.md @@ -47,6 +47,8 @@ First line
Second line Text on green background ``` +Функция `ui:show_buttons()` поддерживает иконки Fontawesome. Просто укажите в качестве имени кнопки `fa:имя_иконки`, например: `fa:play`. + # Диалоги * `ui:show_dialog(title, text, [button1_text], [button2_text])` - показать диалог; первый аргумент - заголовок, второй - текст, button1\_text - имя первой кнопки, button2\_text - имя второй кнопки; diff --git a/main/kodi-remote-widget.lua b/main/kodi-remote-widget.lua index 15ea5cb..7e779ac 100644 --- a/main/kodi-remote-widget.lua +++ b/main/kodi-remote-widget.lua @@ -14,13 +14,14 @@ local media_type = "application/json" local get_players_cmd = [[ { "id": 1, "jsonrpc": "2.0", "method": "Player.GetActivePlayers" } ]] local play_cmd = [[ {"jsonrpc": "2.0", "method": "Player.PlayPause", "params": { "playerid": XXX }, "id": 1} ]] +local stop_cmd = [[ {"jsonrpc": "2.0", "method": "Player.Stop", "params": { "playerid": XXX }, "id": 1} ]] local prev_cmd = [[ {"jsonrpc": "2.0", "method": "Player.GoTo", "params": {"playerid": XXX,"to":"previous"}, "id":1} ]] local next_cmd = [[ {"jsonrpc": "2.0", "method": "Player.GoTo", "params": {"playerid": XXX,"to":"next"}, "id":1} ]] local forward_cmd = [[ {"jsonrpc": "2.0", "method": "Player.Seek", "params": { "playerid": XXX, "value": { "seconds": 300 } }, "id": 1} ]] local backward_cmd = [[ {"jsonrpc": "2.0", "method": "Player.Seek", "params": { "playerid": XXX, "value": { "seconds": -300 } }, "id": 1} ]] -local buttons = { "ᐊᐊ", "-5m", "ᐅ", "+5m", "ᐅᐅ", "Open Kore" } -local buttons_cmds = { prev_cmd, backward_cmd, play_cmd, forward_cmd, next_cmd } +local buttons = { "fa:fast-backward", "-5m", "fa:play", "fa:stop", "+5m", "fa:fast-forward", "Open Kore" } +local buttons_cmds = { prev_cmd, backward_cmd, play_cmd, stop_cmd, forward_cmd, next_cmd } -- global vars