修正段位更新条件
模式列表显示获得的段位
This commit is contained in:
@@ -535,29 +535,9 @@ function gameOver()--Save record
|
|||||||
GAME.rank=R
|
GAME.rank=R
|
||||||
end
|
end
|
||||||
if not GAME.replaying and M.score and scoreValid()then
|
if not GAME.replaying and M.score and scoreValid()then
|
||||||
if RANKS[M.name]then--Old rank exist
|
if not RANKS[M.name]or R>RANKS[M.name]then--Old rank exist
|
||||||
local needSave
|
RANKS[M.name]=R
|
||||||
if R>RANKS[M.name]then
|
saveProgress()
|
||||||
RANKS[M.name]=R
|
|
||||||
needSave=true
|
|
||||||
end
|
|
||||||
if R>0 then
|
|
||||||
if M.unlock then
|
|
||||||
for i=1,#M.unlock do
|
|
||||||
local m=M.unlock[i]
|
|
||||||
local n=MODES[m].name
|
|
||||||
if not RANKS[n]then
|
|
||||||
if MODES[m].x then
|
|
||||||
RANKS[n]=0
|
|
||||||
end
|
|
||||||
needSave=true
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if needSave then
|
|
||||||
saveProgress()
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
local D=M.score(P)
|
local D=M.score(P)
|
||||||
local L=M.records
|
local L=M.records
|
||||||
|
|||||||
@@ -13,6 +13,13 @@ BLOCK_COLORS={
|
|||||||
COLOR.dH,COLOR.D,COLOR.lY,COLOR.H,COLOR.lH,COLOR.dV,COLOR.dR,COLOR.dG,
|
COLOR.dH,COLOR.D,COLOR.lY,COLOR.H,COLOR.lH,COLOR.dV,COLOR.dR,COLOR.dG,
|
||||||
}
|
}
|
||||||
RANK_CHARS={'B','A','S','U','X'}for i=1,#RANK_CHARS do RANK_CHARS[i]=CHAR.icon['rank'..RANK_CHARS[i]]end
|
RANK_CHARS={'B','A','S','U','X'}for i=1,#RANK_CHARS do RANK_CHARS[i]=CHAR.icon['rank'..RANK_CHARS[i]]end
|
||||||
|
RANK_BASE_COLORS={
|
||||||
|
{.1,.2,.3},
|
||||||
|
{.3,.42,.32},
|
||||||
|
{.45,.44,.15},
|
||||||
|
{.42,.25,.2},
|
||||||
|
{.42,.15,.4},
|
||||||
|
}
|
||||||
RANK_COLORS={
|
RANK_COLORS={
|
||||||
{.8,.86,.9},
|
{.8,.86,.9},
|
||||||
{.6,.9,.7},
|
{.6,.9,.7},
|
||||||
|
|||||||
@@ -249,6 +249,7 @@ local function _modePannelStencil()
|
|||||||
gc_rectangle('fill',0,0,810,610)
|
gc_rectangle('fill',0,0,810,610)
|
||||||
end
|
end
|
||||||
local _unknownModeText={'???','?','?????'}
|
local _unknownModeText={'???','?','?????'}
|
||||||
|
local _rankName={[0]='','B','A','S','U','X'}
|
||||||
function scene.draw()
|
function scene.draw()
|
||||||
--Gray background
|
--Gray background
|
||||||
gc_setColor(COLOR.dX)
|
gc_setColor(COLOR.dX)
|
||||||
@@ -277,25 +278,53 @@ function scene.draw()
|
|||||||
gc_stencil(_modePannelStencil,'replace',1)
|
gc_stencil(_modePannelStencil,'replace',1)
|
||||||
gc_setStencilTest('equal',1)
|
gc_setStencilTest('equal',1)
|
||||||
gc_translate(40,40)
|
gc_translate(40,40)
|
||||||
|
setFont(50)
|
||||||
for i=1,#results do
|
for i=1,#results do
|
||||||
local item=results[i]
|
local item=results[i]
|
||||||
|
|
||||||
|
local rank=RANKS[item.name]
|
||||||
|
if rank==0 then rank=nil end
|
||||||
|
|
||||||
if item.type=='folder'then
|
if item.type=='folder'then
|
||||||
|
--Folder's yellow back
|
||||||
local r,g,b
|
local r,g,b
|
||||||
if item.name=='_back'then
|
if item.name=='_back'then
|
||||||
r,g,b=.3,.2,0
|
r,g,b=0,0,0
|
||||||
else
|
else
|
||||||
r,g,b=1,.8,.5
|
r,g,b=1,.8,.5
|
||||||
end
|
end
|
||||||
gc_setColor(r,g,b,item.alpha*.3)
|
gc_setColor(r,g,b,item.alpha*.4)
|
||||||
gc_rectangle('fill',item.x,item.y,item.w,item.h)
|
gc_rectangle('fill',item.x,item.y,item.w,item.h)
|
||||||
end
|
gc_setColor(1,1,1,item.alpha)
|
||||||
gc_setColor(1,1,1,item.alpha)
|
|
||||||
if item.type=='folder'then
|
|
||||||
gc_circle('line',item.x+15,item.y+15,8)
|
gc_circle('line',item.x+15,item.y+15,8)
|
||||||
|
else
|
||||||
|
--Rank background
|
||||||
|
if rank then
|
||||||
|
local r,g,b=RANK_BASE_COLORS[rank][1],RANK_BASE_COLORS[rank][2],RANK_BASE_COLORS[rank][3]
|
||||||
|
gc_setColor(r,g,b,item.alpha*.3)
|
||||||
|
gc_rectangle('fill',item.x,item.y,item.w,item.h)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--Icon
|
||||||
|
gc_setColor(1,1,1,item.alpha)
|
||||||
mDraw(item.icon,item.x+item.w/2,item.y+(item.h-30)/2,0,item.icon_scale)
|
mDraw(item.icon,item.x+item.w/2,item.y+(item.h-30)/2,0,item.icon_scale)
|
||||||
|
|
||||||
|
--Frame
|
||||||
gc_rectangle('line',item.x,item.y,item.w,item.h,6)
|
gc_rectangle('line',item.x,item.y,item.w,item.h,6)
|
||||||
gc_draw(item.text,item.x+6,item.y+item.h-28,0,item.text_scaleX,1)
|
gc_draw(item.text,item.x+6,item.y+item.h-28,0,item.text_scaleX,1)
|
||||||
|
|
||||||
|
--Rank
|
||||||
|
if rank then
|
||||||
|
local rankStr=_rankName[RANKS[item.name]]
|
||||||
|
gc_setColor(0,0,0,item.alpha)
|
||||||
|
gc_print(rankStr,item.x-12+2,item.y-26+2)
|
||||||
|
local r,g,b=RANK_COLORS[rank][1],RANK_COLORS[rank][2],RANK_COLORS[rank][3]
|
||||||
|
gc_setColor(r,g,b,item.alpha)
|
||||||
|
gc_print(rankStr,item.x-12,item.y-26)
|
||||||
|
end
|
||||||
|
|
||||||
|
--Selecting glow
|
||||||
if item.selTime>0 then
|
if item.selTime>0 then
|
||||||
gc_setColor(1,1,1,item.selTime*2)
|
gc_setColor(1,1,1,item.selTime*2)
|
||||||
gc_rectangle('fill',item.x+8,item.y+8,item.w-16,item.h-36,5)
|
gc_rectangle('fill',item.x+8,item.y+8,item.w-16,item.h-36,5)
|
||||||
@@ -335,7 +364,7 @@ function scene.draw()
|
|||||||
local L=M.records
|
local L=M.records
|
||||||
gc_setColor(1,1,1)
|
gc_setColor(1,1,1)
|
||||||
setFont(20)
|
setFont(20)
|
||||||
if false and L[1]then
|
if L[1]then
|
||||||
for i=1,#L do
|
for i=1,#L do
|
||||||
local res=M.scoreDisp(L[i])
|
local res=M.scoreDisp(L[i])
|
||||||
gc_print(res,830,310+25*i,0,min(35/#res,1),1)
|
gc_print(res,830,310+25*i,0,min(35/#res,1),1)
|
||||||
|
|||||||
Reference in New Issue
Block a user