Allow for chat input hints when directChatInput mode is disabled

This commit is contained in:
Etoh 2017-12-29 14:09:16 +00:00
parent 67a9c04844
commit a6e63dfecc
5 changed files with 14 additions and 7 deletions

View File

@ -339,7 +339,8 @@ opts = {
--
['inputPromptCharacter'] = ">",
--Lang:
['mpv-key-hint'] = "[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode.",
['mpv-key-tab-hint'] = "[TAB] to toggle access to alphabet row key shortcuts.",
['mpv-key-hint'] = "[ENTER] to send message. [ESC] to escape chat mode.",
['alphakey-mode-warning-first-line'] = "You can temporarily use old mpv bindings with a-z keys.",
['alphakey-mode-warning-second-line'] = "Press [TAB] to return to Syncplay chat mode.",
}
@ -444,6 +445,9 @@ function input_ass()
end
local osd_help_message = opts['mpv-key-hint']
if opts['chatDirectInput'] then
osd_help_message = opts['mpv-key-tab-hint'] .. " " .. osd_help_message
end
local help_prompt = '\n{\\an'..alignment..'\\pos('..secondary_pos..')\\fn' .. opts['chatOutputFontFamily'] .. '\\fs' .. (opts['chatInputFontSize']/1.25) .. '\\1c&H'..HINT_TEXT_COLOUR..'}' .. osd_help_message
local firststyle = "{\\an"..alignment.."}{\\pos("..position..")}"
@ -623,7 +627,7 @@ end
-- Insert a character at the current cursor position (' '-'~', Shift+Enter)
function handle_char_input(c)
if key_hints_enabled and string.len(line) > 0 then
if key_hints_enabled and (string.len(line) > 0 or opts['chatDirectInput'] == false) then
key_hints_enabled = false
end
set_active(true)
@ -927,12 +931,12 @@ function set_syncplayintf_options(input)
opt.read_options(user_opts, "osc")
default_oscvisibility_state = user_opts.visibility
if opts['chatInputEnabled'] == true then
key_hints_enabled = true
mp.add_forced_key_binding('enter', handle_enter)
mp.add_forced_key_binding('kp_enter', handle_enter)
if opts['chatDirectInput'] == true then
add_repl_alpharow_bindings(alpharowbindings)
mp.add_forced_key_binding('tab', handle_tab)
key_hints_enabled = true
end
end
end

View File

@ -197,7 +197,7 @@ MPV_SYNCPLAYINTF_OPTIONS_TO_SEND = ["chatInputEnabled","chatInputFontFamily", "c
"notificationTimeout","alertTimeout","chatTimeout","chatOutputEnabled"]
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"]
MPV_SYNCPLAYINTF_LANGUAGE_TO_SEND = ["mpv-key-tab-hint","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']
VLC_SLAVE_MACOS_ARGS = ['--verbose=2', '--no-file-logging']

View File

@ -251,7 +251,8 @@ de = {
"chat-chatroom-option": u"Chatroom style", # TODO: Translate
"chat-scrolling-option": u"Scrolling style", # TODO: Translate
"mpv-key-hint": u"[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode.",# TODO: Translate
"mpv-key-tab-hint": u"[TAB] to toggle access to alphabet row key shortcuts.", # TODO: Translate
"mpv-key-hint": u"[ENTER] to send message. [ESC] to escape chat mode.", # TODO: Translate
"alphakey-mode-warning-first-line": u"You can temporarily use old mpv bindings with a-z keys.", # TODO: Translate
"alphakey-mode-warning-second-line": u"Press [TAB] to return to Syncplay chat mode.", # TODO: Translate

View File

@ -256,7 +256,8 @@ en = {
"chat-chatroom-option": u"Chatroom style",
"chat-scrolling-option": u"Scrolling style",
"mpv-key-hint": u"[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode.",
"mpv-key-tab-hint": u"[TAB] to toggle access to alphabet row key shortcuts.",
"mpv-key-hint": u"[ENTER] to send message. [ESC] to escape chat mode.",
"alphakey-mode-warning-first-line": u"You can temporarily use old mpv bindings with a-z keys.",
"alphakey-mode-warning-second-line": u"Press [TAB] to return to Syncplay chat mode.",

View File

@ -260,7 +260,8 @@ ru = {
"chat-chatroom-option": u"Chatroom style", # TODO: Translate
"chat-scrolling-option": u"Scrolling style", # TODO: Translate
"mpv-key-hint": u"[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode.", # TODO: Translate
"mpv-key-tab-hint": u"[TAB] to toggle access to alphabet row key shortcuts.", # TODO: Translate
"mpv-key-hint": u"[ENTER] to send message. [ESC] to escape chat mode.", # TODO: Translate
"alphakey-mode-warning-first-line": u"You can temporarily use old mpv bindings with a-z keys.", # TODO: Translate
"alphakey-mode-warning-second-line": u"Press [TAB] to return to Syncplay chat mode.", # TODO: Translate