给一些联网相关的输入框添加输入长度限制
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
|
|
||||||
local inputBox=WIDGET.newInputBox{name="input",x=20,y=110,w=726,h=60,font=40}
|
local inputBox=WIDGET.newInputBox{name="input",x=20,y=110,w=726,h=60,font=40,limit=32}
|
||||||
local int,abs=math.floor,math.abs
|
local int,abs=math.floor,math.abs
|
||||||
local min,sin=math.min,math.sin
|
local min,sin=math.min,math.sin
|
||||||
local ins=table.insert
|
local ins=table.insert
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
local emailBox=WIDGET.newInputBox{name="email",x=380,y=200,w=500,h=60}
|
local emailBox=WIDGET.newInputBox{name="email",x=380,y=200,w=500,h=60,limit=128}
|
||||||
local passwordBox=WIDGET.newInputBox{name="password",x=380,y=300,w=620,h=60,secret=true,regex="[ -~]"}
|
local passwordBox=WIDGET.newInputBox{name="password",x=380,y=300,w=620,h=60,secret=true,regex="[ -~]",limit=64}
|
||||||
|
|
||||||
local savePW=false
|
local savePW=false
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ local SCR,VK,NET,netPLY=SCR,VK,NET,netPLY
|
|||||||
local PLAYERS,GAME=PLAYERS,GAME
|
local PLAYERS,GAME=PLAYERS,GAME
|
||||||
|
|
||||||
local textBox=WIDGET.newTextBox{name="texts",x=340,y=80,w=600,h=560}
|
local textBox=WIDGET.newTextBox{name="texts",x=340,y=80,w=600,h=560}
|
||||||
local inputBox=WIDGET.newInputBox{name="input",x=340,y=660,w=600,h=50}
|
local inputBox=WIDGET.newInputBox{name="input",x=340,y=660,w=600,h=50,limit=256}
|
||||||
|
|
||||||
local playing
|
local playing
|
||||||
local lastUpstreamTime
|
local lastUpstreamTime
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
local ROOMENV=ROOMENV
|
local ROOMENV=ROOMENV
|
||||||
|
|
||||||
local roomName=WIDGET.newText{name="roomName", x=40,y=115,align='L'}
|
local roomName=WIDGET.newText{name="roomName", x=40,y=115,align='L'}
|
||||||
local roomNameBox=WIDGET.newInputBox{ x=40,y=160,w=540,h=60}
|
local roomNameBox=WIDGET.newInputBox{ x=40,y=160,w=540,h=60,limit=64}
|
||||||
local password=WIDGET.newText{name="password", x=40,y=255,align='L'}
|
local password=WIDGET.newText{name="password", x=40,y=255,align='L'}
|
||||||
local passwordBox=WIDGET.newInputBox{ x=40,y=300,w=540,h=60}
|
local passwordBox=WIDGET.newInputBox{ x=40,y=300,w=540,h=60,limit=64}
|
||||||
local description=WIDGET.newText{name="description", x=650,y=55,align='L'}
|
local description=WIDGET.newText{name="description", x=650,y=55,align='L'}
|
||||||
local descriptionBox=WIDGET.newInputBox { x=650,y=100,w=550,h=160,font=25}
|
local descriptionBox=WIDGET.newInputBox{ x=650,y=100,w=550,h=160,font=25,limit=256}
|
||||||
|
|
||||||
local sList={
|
local sList={
|
||||||
visible={"show","easy","slow","medium","fast","none"},
|
visible={"show","easy","slow","medium","fast","none"},
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ local function _hidePW()
|
|||||||
local R=roomList:getSel()
|
local R=roomList:getSel()
|
||||||
return not R or not R.private
|
return not R or not R.private
|
||||||
end
|
end
|
||||||
local passwordBox=WIDGET.newInputBox{name="password",x=350,y=505,w=500,h=50,secret=true,hideF=_hidePW}
|
local passwordBox=WIDGET.newInputBox{name="password",x=350,y=505,w=500,h=50,secret=true,hideF=_hidePW,limit=64}
|
||||||
|
|
||||||
--[[roomList[n]={
|
--[[roomList[n]={
|
||||||
rid="qwerty",
|
rid="qwerty",
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ end
|
|||||||
scene.widgetList={
|
scene.widgetList={
|
||||||
WIDGET.newText{name="title", x=80, y=50,font=70,align='L'},
|
WIDGET.newText{name="title", x=80, y=50,font=70,align='L'},
|
||||||
WIDGET.newButton{name="login", x=1140,y=100,w=170,h=80,color='lY',code=function()SCN.swapTo('login','swipeL')end},
|
WIDGET.newButton{name="login", x=1140,y=100,w=170,h=80,color='lY',code=function()SCN.swapTo('login','swipeL')end},
|
||||||
WIDGET.newInputBox{name="username", x=380, y=200,w=500,h=60,regex="[0-9A-Za-z_]"},
|
WIDGET.newInputBox{name="username", x=380, y=200,w=500,h=60,regex="[0-9A-Za-z_]",limit=64},
|
||||||
WIDGET.newInputBox{name="email", x=380, y=300,w=626,h=60},
|
WIDGET.newInputBox{name="email", x=380, y=300,w=626,h=60,limit=128},
|
||||||
WIDGET.newInputBox{name="password", x=380, y=400,w=626,h=60,secret=true,regex="[ -~]"},
|
WIDGET.newInputBox{name="password", x=380, y=400,w=626,h=60,secret=true,regex="[ -~]",limit=64},
|
||||||
WIDGET.newInputBox{name="password2",x=380, y=500,w=626,h=60,secret=true,regex="[ -~]"},
|
WIDGET.newInputBox{name="password2",x=380, y=500,w=626,h=60,secret=true,regex="[ -~]",limit=64},
|
||||||
|
|
||||||
WIDGET.newKey{name="register", x=640, y=640,w=300,h=80,font=40,code=_register,hideF=function()return NET.getlock('register')end},
|
WIDGET.newKey{name="register", x=640, y=640,w=300,h=80,font=40,code=_register,hideF=function()return NET.getlock('register')end},
|
||||||
WIDGET.newText{name="registering", x=640, y=605,font=50,hideF=function()return not NET.getlock('register')end},
|
WIDGET.newText{name="registering", x=640, y=605,font=50,hideF=function()return not NET.getlock('register')end},
|
||||||
|
|||||||
Reference in New Issue
Block a user