fix swap bagline (#970)

* fix bagline for swap mode

* remove bagline when a block leaves nextqueue
This commit is contained in:
Imple Lee
2023-09-14 16:47:39 +08:00
committed by GitHub
parent c695596285
commit cf147be119
2 changed files with 4 additions and 1 deletions

View File

@@ -570,7 +570,7 @@ local function _drawNext(P,repMode)
if ENV.bagLine then if ENV.bagLine then
gc_setColor(.8,.8,.8,.8) gc_setColor(.8,.8,.8,.8)
for i=1,ENV.nextCount+1 do for i=1,ENV.nextCount+1 do
if queue[i] and queue[i].bagLine>0 then if queue[i] and queue[i].bagLine and queue[i].bagLine>0 then
gc_rectangle('fill',1,72*(i-1)+3,98,2) gc_rectangle('fill',1,72*(i-1)+3,98,2)
end end
end end

View File

@@ -1375,6 +1375,7 @@ function Player:hold_swap(ifpre)
hb.name=C.name hb.name=C.name
hb.color=C.color hb.color=C.color
self.cur,self.nextQueue[hid]=self.nextQueue[hid],hb self.cur,self.nextQueue[hid]=self.nextQueue[hid],hb
self.cur.bagLine=nil
self.curX,self.curY=x,y self.curX,self.curY=x,y
else-- Normal hold else-- Normal hold
@@ -1384,6 +1385,7 @@ function Player:hold_swap(ifpre)
hb.color=C.color hb.color=C.color
hb.name=C.name hb.name=C.name
self.cur,self.nextQueue[hid]=self.nextQueue[hid],hb self.cur,self.nextQueue[hid]=self.nextQueue[hid],hb
self.cur.bagLine=nil
self:resetBlock() self:resetBlock()
end end
@@ -1444,6 +1446,7 @@ function Player:popNext(ifhold)-- Pop nextQueue to hand
if self.nextQueue[1] then if self.nextQueue[1] then
self.cur=rem(self.nextQueue,1) self.cur=rem(self.nextQueue,1)
self.cur.bagLine=nil
self:newNext() self:newNext()
self.pieceCount=self.pieceCount+1 self.pieceCount=self.pieceCount+1