修正文本框控件长度限制判定问题
This commit is contained in:
@@ -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,
|
font= D.font or int(D.h/7-1)*5,
|
||||||
secret=D.secret==true,
|
secret=D.secret==true,
|
||||||
regex= D.regex,
|
regex= D.regex,
|
||||||
|
limit= D.limit,
|
||||||
hideF= D.hideF,
|
hideF= D.hideF,
|
||||||
hide= D.hide,
|
hide= D.hide,
|
||||||
}
|
}
|
||||||
@@ -1426,7 +1427,7 @@ end
|
|||||||
function WIDGET.textinput(texts)
|
function WIDGET.textinput(texts)
|
||||||
local W=WIDGET.sel
|
local W=WIDGET.sel
|
||||||
if W and W.type=='inputBox'then
|
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
|
WIDGET.sel.value=WIDGET.sel.value..texts
|
||||||
SFX.play('move')
|
SFX.play('move')
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user