next中高度超过2的方块会缩小显示

This commit is contained in:
MrZ626
2021-01-28 15:57:41 +08:00
parent aaa9ca607f
commit 9d4ef9f7ef

View File

@@ -166,33 +166,39 @@ local function drawNextPreview(P,B)
end end
local draw={} local draw={}
function draw.drawNext_norm(P) function draw.drawNext_norm(P)
local ENV=P.gameEnv local ENV=P.gameEnv
local N=ENV.nextCount*72
local texture=SKIN.curText local texture=SKIN.curText
gc_push("transform") gc_push("transform")
gc_translate(316,116) gc_translate(316,36)
gc_setColor(0,0,0,.4)gc_rectangle("fill",0,-80,124,N+8) local N=ENV.nextCount*72
gc_setColor(1,1,1)gc_rectangle("line",0,-80,124,N+8) gc_setColor(0,0,0,.4)gc_rectangle("fill",0,0,124,N+8)
mText(drawableText.next,62,-131) gc_setColor(1,1,1)gc_rectangle("line",0,0,124,N+8)
mText(drawableText.next,62,-51)
N=1 N=1
while N<=ENV.nextCount and P.nextQueue[N]do gc_push("transform")
local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color gc_translate(62,40)
for i=1,#bk do for j=1,#bk[1] do while N<=ENV.nextCount and P.nextQueue[N]do
if bk[i][j]then local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color
gc_draw(texture[clr],30*(j+2.06-#bk[1]*.5)-30,-30*(i+3.76-2.4*N-#bk*.5))-- drawCell(i-2.4*N-#bk*.5,j+12.6-#bk[1]*.5,clr) local k=#bk>2 and 2.2/#bk or 1
end gc_scale(k)
end end for i=1,#bk do for j=1,#bk[1] do
N=N+1 if bk[i][j]then
end gc_draw(texture[clr],30*(j-#bk[1]*.5)-30,-30*(i-#bk*.5))-- drawCell(i-#bk*.5,j-#bk[1]*.5,clr)
end
end end
gc_scale(1/k)
N=N+1
gc_translate(0,72)
end
gc_pop()
if ENV.bagLine then if ENV.bagLine then
local len=ENV.bagLen local len=ENV.bagLen
local phase=-P.pieceCount%len local phase=-P.pieceCount%len
gc_setColor(.8,.5,.5) gc_setColor(.8,.5,.5)
for i=phase,N-1,len do for i=phase,N-1,len do
local y=72*i-77 local y=72*i+3
gc_line(2+P.fieldOff.x,y,120,y) gc_line(2+P.fieldOff.x,y,120,y)
end end
end end
@@ -200,30 +206,37 @@ function draw.drawNext_norm(P)
end end
function draw.drawNext_hidden(P) function draw.drawNext_hidden(P)
local ENV=P.gameEnv local ENV=P.gameEnv
local N=ENV.nextCount*72
local texture=SKIN.curText local texture=SKIN.curText
gc_push("transform") gc_push("transform")
gc_translate(316,116) gc_translate(316,36)
gc_setColor(.5,0,0,.4)gc_rectangle("fill",0,-80,124,N+8) local N=ENV.nextCount*72
gc_setColor(1,1,1)gc_rectangle("line",0,-80,124,N+8) gc_setColor(.5,0,0,.4)gc_rectangle("fill",0,0,124,N+8)
mText(drawableText.next,62,-131) gc_setColor(1,1,1)gc_rectangle("line",0,0,124,N+8)
mText(drawableText.next,62,-51)
N=min(ENV.nextStartPos,P.pieceCount+1) N=min(ENV.nextStartPos,P.pieceCount+1)
while N<=ENV.nextCount and P.nextQueue[N]do gc_push("transform")
local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color gc_translate(62,40)
for i=1,#bk do for j=1,#bk[1] do while N<=ENV.nextCount and P.nextQueue[N]do
if bk[i][j]then local bk,clr=P.nextQueue[N].bk,P.nextQueue[N].color
gc_draw(texture[clr],30*(j+2.06-#bk[1]*.5)-30,-30*(i+3.76-2.4*N-#bk*.5))-- drawCell(i-2.4*N-#bk*.5,j+12.6-#bk[1]*.5,clr) local k=#bk>2 and 2.2/#bk or 1
end gc_scale(k)
end end for i=1,#bk do for j=1,#bk[1] do
N=N+1 if bk[i][j]then
end gc_draw(texture[clr],30*(j-#bk[1]*.5)-30,-30*(i-#bk*.5))-- drawCell(i-#bk*.5,j-#bk[1]*.5,clr)
end
end end
gc_scale(1/k)
N=N+1
gc_translate(0,72)
end
gc_pop()
if ENV.bagLine then if ENV.bagLine then
local len=ENV.bagLen local len=ENV.bagLen
local phase=-P.pieceCount%len local phase=-P.pieceCount%len
gc_setColor(.8,.5,.5) gc_setColor(.8,.5,.5)
for i=phase,N-1,len do for i=phase,N-1,len do
local y=72*i-77 local y=72*i+3
gc_line(2+P.fieldOff.x,y,120,y) gc_line(2+P.fieldOff.x,y,120,y)
end end
end end