(mpv chat) List Syncplay-defined key bindings during first message input
This commit is contained in:
parent
47d5c83d49
commit
cc8723babd
@ -102,7 +102,7 @@ function chat_update()
|
|||||||
|
|
||||||
if use_alpha_rows_for_chat == false then
|
if use_alpha_rows_for_chat == false then
|
||||||
local alphawarning_ass = assdraw.ass_new()
|
local alphawarning_ass = assdraw.ass_new()
|
||||||
alphawarning_ass = "{\\a6}You can temporarily use old mpv bindings with a-z keys.\n{\\a6}Press [TAB] to return to Syncplay chat mode."
|
alphawarning_ass = "{\\a6}You can temporarily use old mpv bindings with a-z keys.\n{\\a6}Press [TAB] to return to Syncplay chat mode." -- TODO: Move message to messages.py
|
||||||
ass:append(alphawarning_ass)
|
ass:append(alphawarning_ass)
|
||||||
else
|
else
|
||||||
ass:append(chat_ass)
|
ass:append(chat_ass)
|
||||||
@ -297,6 +297,7 @@ local repl_active = false
|
|||||||
local insert_mode = false
|
local insert_mode = false
|
||||||
local line = ''
|
local line = ''
|
||||||
local cursor = 1
|
local cursor = 1
|
||||||
|
local key_hints_enabled = true
|
||||||
|
|
||||||
function input_ass()
|
function input_ass()
|
||||||
if not repl_active then
|
if not repl_active then
|
||||||
@ -350,9 +351,10 @@ function input_ass()
|
|||||||
secondary_pos = "10,"..tostring(CANVAS_HEIGHT-(20+opts['chatInputFontSize']))
|
secondary_pos = "10,"..tostring(CANVAS_HEIGHT-(20+opts['chatInputFontSize']))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- TODO: local osd_help_message = "[TAB] to toggle access to alphabet row key shortcuts. [ENTER] to send message. [ESC] to escape chat mode. Send /hint in chat to disable this hint."
|
local osd_help_message = "[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." -- TODO: Move message to messages.py
|
||||||
-- TODO: local help_prompt = '\n{\\an'..alignment..'\\pos('..secondary_pos..')\\fn' .. opts['chatInputFontFamily'] .. '\\fs' .. (opts['chatInputFontSize']/2) .. '}' .. osd_help_message
|
local help_prompt = '\n{\\an'..alignment..'\\pos('..secondary_pos..')\\fn' .. opts['chatInputFontFamily'] .. '\\fs' .. (opts['chatInputFontSize']/2) .. '}' .. osd_help_message -- TODO: Move message to messages.py
|
||||||
return "{\\an"..alignment.."}{\\pos("..position..")}"..style..'> '..after_style..before_cur..cglyph..style..after_style..after_cur..end_marker -- TODO: ..help_prompt
|
if key_hints_enabled == false then help_prompt = "" end
|
||||||
|
return "{\\an"..alignment.."}{\\pos("..position..")}"..style..'> '..after_style..before_cur..cglyph..style..after_style..after_cur..end_marker..help_prompt
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -545,7 +547,8 @@ function handle_enter()
|
|||||||
|
|
||||||
if line == '' then
|
if line == '' then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
key_hints_enabled = false
|
||||||
line = string.gsub(line,"\\", "\\\\")
|
line = string.gsub(line,"\\", "\\\\")
|
||||||
line = string.gsub(line,"\"", "\\\"")
|
line = string.gsub(line,"\"", "\\\"")
|
||||||
mp.command('print-text "<chat>'..line..'</chat>"')
|
mp.command('print-text "<chat>'..line..'</chat>"')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user