修复聊天窗带空格的消息会被截断
This commit is contained in:
@@ -114,9 +114,7 @@ function DATA.pasteBoard(str,page)--Paste [str] data to [page] board
|
|||||||
local _,__
|
local _,__
|
||||||
|
|
||||||
--Decode
|
--Decode
|
||||||
if not str:find("%S")then return end
|
str=STRING.trim(str)
|
||||||
str=str:sub((str:find("%S"))):reverse()
|
|
||||||
str=str:sub((str:find("%S"))):reverse()
|
|
||||||
_,str=pcall(data.decode,'string','base64',str)
|
_,str=pcall(data.decode,'string','base64',str)
|
||||||
if not _ then return end
|
if not _ then return end
|
||||||
_,str=pcall(data.decompress,'string','zlib',str)
|
_,str=pcall(data.decompress,'string','zlib',str)
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ function scene.keyDown(key)
|
|||||||
TASK.new(function()YIELD()WIDGET.sel=inputBox end)
|
TASK.new(function()YIELD()WIDGET.sel=inputBox end)
|
||||||
enableTextInput()
|
enableTextInput()
|
||||||
else
|
else
|
||||||
local mes=inputBox:getText():match"%S+"
|
local mes=STRING.trim(inputBox:getText())
|
||||||
if mes and #mes>0 then
|
if mes and #mes>0 then
|
||||||
NET.sendMessage(mes)
|
NET.sendMessage(mes)
|
||||||
inputBox:clear()
|
inputBox:clear()
|
||||||
@@ -133,12 +133,7 @@ function scene.keyUp(key)
|
|||||||
end
|
end
|
||||||
function scene.gamepadDown(key)
|
function scene.gamepadDown(key)
|
||||||
if key=="back"then
|
if key=="back"then
|
||||||
if TIME()-lastBackTime<1 then
|
scene.keyDown("escape")
|
||||||
NET.signal_quit()
|
|
||||||
else
|
|
||||||
lastBackTime=TIME()
|
|
||||||
LOG.print(text.sureQuit,COLOR.O)
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
local k=keyMap.joystick[key]
|
local k=keyMap.joystick[key]
|
||||||
if k and k>0 then
|
if k and k>0 then
|
||||||
|
|||||||
Reference in New Issue
Block a user