From c6115e341706f1ec647465a21d4728a598737678 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 14 May 2021 10:29:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=81=8A=E5=A4=A9=E7=AA=97?= =?UTF-8?q?=E5=B8=A6=E7=A9=BA=E6=A0=BC=E7=9A=84=E6=B6=88=E6=81=AF=E4=BC=9A?= =?UTF-8?q?=E8=A2=AB=E6=88=AA=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/data.lua | 4 +--- parts/scenes/net_game.lua | 9 ++------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/parts/data.lua b/parts/data.lua index 7881c920..1a3e1ef4 100644 --- a/parts/data.lua +++ b/parts/data.lua @@ -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) diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index 5ba479ac..97efbaf9 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -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