From 67f5ed49ec327a8efbb69d920567b7b84bb1e07c Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 8 Jun 2021 21:34:07 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B0=B8=E4=B9=85=E8=A7=A3=E5=86=B3=E6=8C=89?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=E7=84=A6=E7=82=B9=E5=92=8C=E5=9B=9E?= =?UTF-8?q?=E8=BD=A6=E9=94=AE=E7=9A=84=E4=BA=A4=E4=BA=92=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/init.lua | 2 +- Zframework/widget.lua | 10 ++++++++-- parts/scenes/net_game.lua | 2 +- parts/scenes/net_newRoom.lua | 2 +- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Zframework/init.lua b/Zframework/init.lua index 05290242..f13403d8 100644 --- a/Zframework/init.lua +++ b/Zframework/init.lua @@ -272,7 +272,7 @@ function love.keypressed(key) end elseif not SCN.swapping then if SCN.keyDown then - SCN.keyDown(key) + if #EDITING==0 then SCN.keyDown(key)end elseif key=="escape"then SCN.back() else diff --git a/Zframework/widget.lua b/Zframework/widget.lua index 025a1370..fbad7292 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -1093,7 +1093,10 @@ function WIDGET.isFocus(W) end function WIDGET.focus(W) if WIDGET.sel==W then return end - if WIDGET.sel and WIDGET.sel.type=='inputBox'then kb.setTextInput(false)end + if WIDGET.sel and WIDGET.sel.type=='inputBox'then + kb.setTextInput(false) + EDITING="" + end WIDGET.sel=W if W and W.type=='inputBox'then local _,y1=xOy:transformPoint(0,W.y+W.h) @@ -1103,7 +1106,10 @@ end function WIDGET.unFocus(force) local W=WIDGET.sel if W and(force or not W.keepFocus)then - if W.type=='inputBox'then kb.setTextInput(false)end + if W.type=='inputBox'then + kb.setTextInput(false) + EDITING="" + end WIDGET.sel=false end end diff --git a/parts/scenes/net_game.lua b/parts/scenes/net_game.lua index 7cc34933..0d594d05 100644 --- a/parts/scenes/net_game.lua +++ b/parts/scenes/net_game.lua @@ -133,7 +133,7 @@ function scene.keyDown(key) if #mes>0 then NET.sendMessage(mes) inputBox:clear() - elseif #EDITING==0 then + else _switchChat() end else diff --git a/parts/scenes/net_newRoom.lua b/parts/scenes/net_newRoom.lua index 3234da3d..14aa96c2 100644 --- a/parts/scenes/net_newRoom.lua +++ b/parts/scenes/net_newRoom.lua @@ -43,7 +43,7 @@ function scene.sceneBack() end function scene.keyDown(k) - if k=="return"and #EDITING==0 then + if k=="return"then createRoom() elseif k=="escape"then SCN.go('net_rooms')