修复聊天窗带空格的消息会被截断

This commit is contained in:
MrZ626
2021-05-14 10:29:52 +08:00
parent 0ad122ce01
commit c6115e3417
2 changed files with 3 additions and 10 deletions

View File

@@ -114,9 +114,7 @@ function DATA.pasteBoard(str,page)--Paste [str] data to [page] board
local _,__
--Decode
if not str:find("%S")then return end
str=str:sub((str:find("%S"))):reverse()
str=str:sub((str:find("%S"))):reverse()
str=STRING.trim(str)
_,str=pcall(data.decode,'string','base64',str)
if not _ then return end
_,str=pcall(data.decompress,'string','zlib',str)

View File

@@ -92,7 +92,7 @@ function scene.keyDown(key)
TASK.new(function()YIELD()WIDGET.sel=inputBox end)
enableTextInput()
else
local mes=inputBox:getText():match"%S+"
local mes=STRING.trim(inputBox:getText())
if mes and #mes>0 then
NET.sendMessage(mes)
inputBox:clear()
@@ -133,12 +133,7 @@ function scene.keyUp(key)
end
function scene.gamepadDown(key)
if key=="back"then
if TIME()-lastBackTime<1 then
NET.signal_quit()
else
lastBackTime=TIME()
LOG.print(text.sureQuit,COLOR.O)
end
scene.keyDown("escape")
else
local k=keyMap.joystick[key]
if k and k>0 then