【警告:可能有bug,需要测试】

较大规模整理玩家相关代码
较大规模整理玩家相关代码,重构出块延迟和消行延迟逻辑,现在0是真的无延迟,不再有1帧等待了
添加出块延迟打断(即ARE打断)(不包括消行延迟,默认为打断至无穷大,相当于无此功能)
自定义游戏和自定义房间ui跟进
close #471
This commit is contained in:
MrZ626
2021-11-23 20:26:31 +08:00
parent 95879827c8
commit 83bdd9f2c4
19 changed files with 407 additions and 389 deletions

View File

@@ -12,7 +12,7 @@ local dict--Dict list
local result--Result Lable
local lastTickInput
local waiting--Searching animation timer
local searchWait--Searching animation timer
local selected--Selected option
local scrollPos--Scroll down length
@@ -53,7 +53,7 @@ local function _clearResult()
TABLE.cut(result)
selected=1
scrollPos=0
waiting,lastSearch=0,false
searchWait,lastSearch=0,false
scene.widgetList.copy.hide=false
end
local function _search()
@@ -82,7 +82,7 @@ function scene.sceneInit()
inputBox:clear()
result={}
waiting=0
searchWait=0
selected=1
scrollPos=0
@@ -153,13 +153,13 @@ function scene.update(dt)
if #input==0 then
_clearResult()
else
waiting=.8
searchWait=.8
end
lastTickInput=input
end
if waiting>0 then
waiting=waiting-dt
if waiting<=0 then
if searchWait>0 then
searchWait=searchWait-dt
if searchWait<=0 then
if #input>0 and input~=lastSearch then
_search()
end
@@ -202,7 +202,7 @@ function scene.draw()
gc.rectangle('line',300,180,958,526,5)
gc.rectangle('line',20,180,280,526,5)
if waiting>0 then
if searchWait>0 then
local r=TIME()*2
local R=int(r)%7+1
gc.setColor(1,1,1,1-abs(r%1*2-1))