From 763fce491a86f0211512057645d829da39d91a7e Mon Sep 17 00:00:00 2001 From: Etoh Date: Fri, 29 Dec 2017 13:48:13 +0000 Subject: [PATCH] Use angle brackets rather than greater/less than signs for chat input markers --- resources/syncplayintf.lua | 10 +++++++--- syncplay/constants.py | 5 ++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/resources/syncplayintf.lua b/resources/syncplayintf.lua index a0af4a8..44e45cb 100644 --- a/resources/syncplayintf.lua +++ b/resources/syncplayintf.lua @@ -336,6 +336,8 @@ opts = { ['notificationTimeout'] = 3, ['alertTimeout'] = 5, ['chatTimeout'] = 7, + -- + ['inputPromptCharacter'] = ">", --Lang: ['mpv-key-hint'] = "[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode. This hint disappears after you send a message.", ['alphakey-mode-warning-first-line'] = "You can temporarily use old mpv bindings with a-z keys.", @@ -428,12 +430,13 @@ function input_ass() local alignment = 7 local position = "5,5" + local start_marker = opts['inputPromptStartCharacter'] local end_marker = "" if opts['chatInputPosition'] == "Middle" then alignment = 5 position = tostring(CANVAS_WIDTH/2)..","..tostring(CANVAS_HEIGHT/2) - secondary_pos = tostring(CANVAS_WIDTH/2)..","..tostring((CANVAS_HEIGHT/2)+10+opts['chatInputFontSize']) - end_marker = "{\\u0}".." <" + secondary_pos = tostring(CANVAS_WIDTH/2)..","..tostring((CANVAS_HEIGHT/2)+20+opts['chatInputFontSize']) + end_marker = "{\\u0}"..opts['inputPromptEndCharacter'] elseif opts['chatInputPosition'] == "Bottom" then alignment = 1 position = tostring(5)..","..tostring(CANVAS_HEIGHT-5) @@ -451,7 +454,8 @@ function input_ass() help_prompt = '\n'..firststyle..'{\\1c&H'..HINT_TEXT_COLOUR..'}' .. osd_help_message .. '\n' end if key_hints_enabled == false then help_prompt = "" end - return firststyle..style..'> '..after_style..before_cur..cglyph..style..after_style..after_cur..end_marker..help_prompt + + return firststyle..style..start_marker.." "..after_style..before_cur..cglyph..style..after_style..after_cur..end_marker..help_prompt end diff --git a/syncplay/constants.py b/syncplay/constants.py index 61cd190..f59c0c3 100644 --- a/syncplay/constants.py +++ b/syncplay/constants.py @@ -1,3 +1,4 @@ +# coding:utf8 # You might want to change these DEFAULT_PORT = 8999 OSD_DURATION = 3.0 @@ -187,13 +188,15 @@ MPV_SLAVE_ARGS = ['--msg-level=all=error,cplayer=info,term-msg=info', '--input-t MPV_SLAVE_ARGS_NEW = ['--term-playing-msg=\nANS_filename=${filename}\nANS_length=${=length:${=duration:0}}\nANS_path=${path}\n', '--terminal=yes'] MPV_NEW_VERSION = False MPV_OSC_VISIBILITY_CHANGE_VERSION = False +MPV_INPUT_PROMPT_START_CHARACTER = u"〉" +MPV_INPUT_PROMPT_END_CHARACTER = u" 〈" MPV_SYNCPLAYINTF_OPTIONS_TO_SEND = ["chatInputEnabled","chatInputFontFamily", "chatInputFontSize", "chatInputFontWeight","chatInputFontUnderline", "chatInputFontColor", "chatInputPosition","chatOutputFontFamily","chatOutputFontSize", "chatOutputFontWeight","chatOutputFontUnderline","chatOutputMode","chatMaxLines", "chatTopMargin","chatLeftMargin","chatBottomMargin","chatDirectInput", "notificationTimeout","alertTimeout","chatTimeout","chatOutputEnabled"] -MPV_SYNCPLAYINTF_CONSTANTS_TO_SEND = ["MaxChatMessageLength={}".format(MAX_CHAT_MESSAGE_LENGTH)] +MPV_SYNCPLAYINTF_CONSTANTS_TO_SEND = ["MaxChatMessageLength={}".format(MAX_CHAT_MESSAGE_LENGTH),u"inputPromptStartCharacter={}".format(MPV_INPUT_PROMPT_START_CHARACTER),u"inputPromptEndCharacter={}".format(MPV_INPUT_PROMPT_END_CHARACTER)] MPV_SYNCPLAYINTF_LANGUAGE_TO_SEND = ["mpv-key-hint", "alphakey-mode-warning-first-line", "alphakey-mode-warning-second-line"] VLC_SLAVE_ARGS = ['--extraintf=luaintf', '--lua-intf=syncplay', '--no-quiet', '--no-input-fast-seek', '--play-and-pause', '--start-time=0']