From fdb6276869289485ff3f62cbf48ffea5f43c55ec Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sun, 17 Oct 2021 23:39:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BE=93=E5=85=A5=E6=A1=86=E6=8E=A7=E4=BB=B6?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E8=AE=BE=E7=BD=AE=E9=95=BF=E5=BA=A6=E9=99=90?= =?UTF-8?q?=E5=88=B6=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Zframework/widget.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Zframework/widget.lua b/Zframework/widget.lua index 38b6a432..b9ba6969 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -904,7 +904,7 @@ function inputBox:keypress(k) self.value=t end end -function WIDGET.newInputBox(D)--name,x,y,w[,h][,font=30][,secret][,regex],hide +function WIDGET.newInputBox(D)--name,x,y,w[,h][,font=30][,secret][,regex][,limit],hide local _={ name= D.name or"_", @@ -1426,7 +1426,7 @@ end function WIDGET.textinput(texts) local W=WIDGET.sel if W and W.type=='inputBox'then - if not W.regex or texts:match(W.regex)then + if(not W.regex or texts:match(W.regex))and #texts<=W.limit then WIDGET.sel.value=WIDGET.sel.value..texts SFX.play('move') else