diff --git a/Zframework/widget.lua b/Zframework/widget.lua index b9ba6969..7563f124 100644 --- a/Zframework/widget.lua +++ b/Zframework/widget.lua @@ -922,6 +922,7 @@ function WIDGET.newInputBox(D)--name,x,y,w[,h][,font=30][,secret][,regex][,limit font= D.font or int(D.h/7-1)*5, secret=D.secret==true, regex= D.regex, + limit= D.limit, hideF= D.hideF, hide= D.hide, } @@ -1426,7 +1427,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))and #texts<=W.limit then + if(not W.regex or texts:match(W.regex))and(not W.limit or #(WIDGET.sel.value..texts)<=W.limit)then WIDGET.sel.value=WIDGET.sel.value..texts SFX.play('move') else