Use angle brackets rather than greater/less than signs for chat input markers

This commit is contained in:
Etoh 2017-12-29 13:48:13 +00:00
parent dcd5a6729b
commit 763fce491a
2 changed files with 11 additions and 4 deletions

View File

@ -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

View File

@ -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=<SyncplayUpdateFile>\nANS_filename=${filename}\nANS_length=${=length:${=duration:0}}\nANS_path=${path}\n</SyncplayUpdateFile>', '--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']