整理代码

This commit is contained in:
MrZ626
2021-05-18 15:44:01 +08:00
parent 6ec902e618
commit 00464f1e80
2 changed files with 9 additions and 15 deletions

View File

@@ -1,12 +1,11 @@
local kb=love.keyboard local kb,gc=love.keyboard,love.graphics
local gc=love.graphics
local next=next
local int,abs=math.floor,math.abs local int,abs=math.floor,math.abs
local max,min=math.max,math.min local max,min=math.max,math.min
local sub=string.sub local sub,ins=string.sub,table.insert
local ins=table.insert local getFont,setFont,mStr=getFont,setFont,mStr
local setFont,mStr=setFont,mStr local mDraw,mDraw_X,mDraw_Y=ADRAW.draw,ADRAW.simpX,ADRAW.simpY
local mDraw_X,mDraw_Y=ADRAW.simpX,ADRAW.simpY
local clearIcon=DOGC{40,40, local clearIcon=DOGC{40,40,
{'setLW',6}, {'setLW',6},
@@ -519,7 +518,7 @@ function slider:drag(x)
if p~=P then if p~=P then
self.code(P) self.code(P)
end end
if self.change and TIME()-self.lastTime>.18 then if self.change and TIME()-self.lastTime>.26 then
self.lastTime=TIME() self.lastTime=TIME()
self.change() self.change()
end end
@@ -1219,12 +1218,7 @@ end
function WIDGET.update() function WIDGET.update()
for _,W in next,WIDGET.active do for _,W in next,WIDGET.active do
if W.hideF then if W.hideF then W.hide=W.hideF()end
local h=W.hideF()
if h~=W.hide then
W.hide=h
end
end
if W.update then W:update()end if W.update then W:update()end
end end
end end

View File

@@ -5,8 +5,8 @@ local ins=table.insert
local SCR,VK,NET,netPLY=SCR,VK,NET,netPLY 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,hide=false} 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,hide=false} local inputBox=WIDGET.newInputBox{name="input",x=340,y=660,w=600,h=50}
local playing local playing
local lastUpstreamTime local lastUpstreamTime