暂停时显示所选mod

This commit is contained in:
MrZ626
2020-11-23 01:38:23 +08:00
parent 467c8f44d6
commit 7649d23ac4
4 changed files with 52 additions and 27 deletions

View File

@@ -501,8 +501,8 @@ function gameStart()
end end
end end
function scoreValid() function scoreValid()
for _,v in next,GAME.mod do for _,M in next,GAME.mod do
if v.unranked then if M.unranked then
return false return false
end end
end end

View File

@@ -2,116 +2,116 @@ local function disableKey(P,key)
table.insert(P.gameEnv.keyCancel,key) table.insert(P.gameEnv.keyCancel,key)
end end
MODOPT={--Mod options MODOPT={--Mod options
noNext={id="NN", noNext={no=0,id="NN",
key="q",x=80,y=230,color="red", key="q",x=80,y=230,color="red",
conflict={"hideNext","fullNext"}, conflict={"hideNext","fullNext"},
func=function(P)P.gameEnv.nextCount=0 end, func=function(P)P.gameEnv.nextCount=0 end,
}, },
fullNext={id="FN", fullNext={no=1,id="FN",
key="w",x=200,y=230,color="water", key="w",x=200,y=230,color="water",
conflict={"noNext"}, conflict={"noNext"},
func=function(P)P.gameEnv.nextCount=6 end, func=function(P)P.gameEnv.nextCount=6 end,
unranked=true, unranked=true,
}, },
noHold={id="NH", noHold={no=2,id="NH",
key="e",x=320,y=230,color="red", key="e",x=320,y=230,color="red",
conflict={"multiHold"}, conflict={"multiHold"},
func=function(P)P.gameEnv.holdCount=0 end, func=function(P)P.gameEnv.holdCount=0 end,
}, },
multiHold={id="MH", multiHold={no=3,id="MH",
key="r",x=440,y=230,color="water", key="r",x=440,y=230,color="water",
list={2,3,4,5,6}, list={2,3,4,5,6},
conflict={"noHold"}, conflict={"noHold"},
func=function(P,M)P.gameEnv.holdCount=M.list[M.sel] end, func=function(P,M)P.gameEnv.holdCount=M.list[M.sel] end,
unranked=true, unranked=true,
}, },
hideNext={id="FL", hideNext={no=4,id="FL",
key="y",x=680,y=230,color="orange", key="y",x=680,y=230,color="orange",
list={1,2,3,4,5}, list={1,2,3,4,5},
conflict={"noNext"}, conflict={"noNext"},
func=function(P,M)P.gameEnv.nextStartPos=M.list[M.sel]+1 end, func=function(P,M)P.gameEnv.nextStartPos=M.list[M.sel]+1 end,
}, },
hideBlock={id="HB", hideBlock={no=5,id="HB",
key="u",x=800,y=230,color="orange", key="u",x=800,y=230,color="orange",
func=function(P)P.gameEnv.block=false end, func=function(P)P.gameEnv.block=false end,
}, },
hideGhost={id="HG", hideGhost={no=6,id="HG",
key="i",x=920,y=230,color="orange", key="i",x=920,y=230,color="orange",
func=function(P)P.gameEnv.ghost=false end, func=function(P)P.gameEnv.ghost=false end,
}, },
hidden={id="HD", hidden={no=7,id="HD",
key="o",x=1040,y=230,color="grape", key="o",x=1040,y=230,color="grape",
list={"time","fast","none"}, list={"time","fast","none"},
conflict={"coverBoard"}, conflict={"coverBoard"},
func=function(P,M)P.gameEnv.visible=M.list[M.sel]end, func=function(P,M)P.gameEnv.visible=M.list[M.sel]end,
unranked=true, unranked=true,
}, },
coverBoard={id="CB", coverBoard={no=8,id="CB",
key="p",x=1160,y=230,color="grape", key="p",x=1160,y=230,color="grape",
list={"down","up","all"}, list={"down","up","all"},
conflict={"hidden"}, conflict={"hidden"},
func=function(P)LOG.print("该mod还没有做好!")end, func=function(P)LOG.print("该mod还没有做好!")end,
}, },
maxG={id="20G", maxG={no=9,id="20G",
key="a",x=140,y=350,color="red", key="a",x=140,y=350,color="red",
conflict={"minG","suddenLock"}, conflict={"minG","suddenLock"},
func=function(P)P.gameEnv.drop=0 end, func=function(P)P.gameEnv.drop=0 end,
unranked=true, unranked=true,
}, },
suddenLock={id="SL", suddenLock={no=10,id="SL",
key="s",x=260,y=350,color="red", key="s",x=260,y=350,color="red",
conflict={"maxG","infLock"}, conflict={"maxG","infLock"},
func=function(P)P.gameEnv.lock=0 end, func=function(P)P.gameEnv.lock=0 end,
unranked=true, unranked=true,
}, },
oneLife={id="SD", oneLife={no=11,id="SD",
key="d",x=380,y=350,color="red", key="d",x=380,y=350,color="red",
conflict={"infLife"}, conflict={"infLife"},
func=function(P)P.gameEnv.life=0 end, func=function(P)P.gameEnv.life=0 end,
unranked=true, unranked=true,
}, },
noTele={id="NT", noTele={no=12,id="NT",
key="f",x=500,y=350,color="red", key="f",x=500,y=350,color="red",
conflict={"teleMove"}, conflict={"teleMove"},
func=function(P)P.gameEnv.noTele=true end, func=function(P)P.gameEnv.noTele=true end,
}, },
forceB2B={id="FB", forceB2B={no=13,id="FB",
key="h",x=740,y=350,color="yellow", key="h",x=740,y=350,color="yellow",
func=function(P)P.gameEnv.b2bKill=true end, func=function(P)P.gameEnv.b2bKill=true end,
}, },
forceFinesse={id="PF", forceFinesse={no=14,id="PF",
key="j",x=860,y=350,color="yellow", key="j",x=860,y=350,color="yellow",
func=function(P)P.gameEnv.fineKill=true end, func=function(P)P.gameEnv.fineKill=true end,
}, },
mirror={id="MR", mirror={no=15,id="MR",
key="k",x=980,y=350,color="grass", key="k",x=980,y=350,color="grass",
func=function(P)LOG.print("该mod还没有做好!")end, func=function(P)LOG.print("该mod还没有做好!")end,
}, },
flip={id="HR", flip={no=16,id="HR",
key="l",x=1100,y=350,color="grass", key="l",x=1100,y=350,color="grass",
func=function(P)LOG.print("该mod还没有做好!")end, func=function(P)LOG.print("该mod还没有做好!")end,
}, },
minG={id="0G", minG={no=17,id="0G",
key="z",x=200,y=470,color="cyan", key="z",x=200,y=470,color="cyan",
conflict={"maxG"}, conflict={"maxG"},
func=function(P)P.gameEnv.drop=1e99 end, func=function(P)P.gameEnv.drop=1e99 end,
unranked=true, unranked=true,
}, },
infLock={id="IF", infLock={no=18,id="IF",
key="x",x=320,y=470,color="cyan", key="x",x=320,y=470,color="cyan",
conflict={"suddenLock"}, conflict={"suddenLock"},
func=function(P)P.gameEnv.lock=1e99 end, func=function(P)P.gameEnv.lock=1e99 end,
unranked=true, unranked=true,
}, },
infLife={id="NF", infLife={no=19,id="NF",
key="c",x=440,y=470,color="cyan", key="c",x=440,y=470,color="cyan",
conflict={"oneLife"}, conflict={"oneLife"},
func=function(P)P.gameEnv.life=1e99 end, func=function(P)P.gameEnv.life=1e99 end,
unranked=true, unranked=true,
}, },
teleMove={id="TL", teleMove={no=20,id="TL",
key="v",x=560,y=470,color="cyan", key="v",x=560,y=470,color="cyan",
conflict={"noTele"}, conflict={"noTele"},
func=function(P) func=function(P)
@@ -123,13 +123,13 @@ MODOPT={--Mod options
end, end,
unranked=true, unranked=true,
}, },
customSeq={id="CS", customSeq={no=21,id="CS",
key="b",x=680,y=470,color="purple", key="b",x=680,y=470,color="purple",
list={"bag","his4","rnd","reverb"}, list={"bag","his4","rnd","reverb"},
func=function(P,M)P.gameEnv.sequence=M.list[M.sel]end, func=function(P,M)P.gameEnv.sequence=M.list[M.sel]end,
unranked=true, unranked=true,
}, },
noRotation={id="FX", noRotation={no=22,id="FX",
key="n",x=800,y=470,color="lGrey", key="n",x=800,y=470,color="lGrey",
func=function(P) func=function(P)
disableKey(P,3) disableKey(P,3)
@@ -137,7 +137,7 @@ MODOPT={--Mod options
disableKey(P,5) disableKey(P,5)
end, end,
}, },
noMove={id="ST", noMove={no=23,id="ST",
key="m",x=920,y=470,color="lGrey", key="m",x=920,y=470,color="lGrey",
func=function(P) func=function(P)
disableKey(P,1)disableKey(P,2) disableKey(P,1)disableKey(P,2)

View File

@@ -1,6 +1,9 @@
local gc=love.graphics local gc=love.graphics
local ins,rem=table.insert,table.remove local ins,rem=table.insert,table.remove
local function modComp(a,b)
return a.no<b.no
end
local function remMod(M) local function remMod(M)
for i=1,#GAME.mod do for i=1,#GAME.mod do
if GAME.mod[i]==M then if GAME.mod[i]==M then
@@ -12,6 +15,7 @@ end
local function toggleMod(M) local function toggleMod(M)
if M.sel==0 then if M.sel==0 then
ins(GAME.mod,M) ins(GAME.mod,M)
table.sort(GAME.mod,modComp)
end end
if M.list then if M.list then
M.sel=(M.sel+1)%(#M.list+1) M.sel=(M.sel+1)%(#M.list+1)

View File

@@ -1,6 +1,7 @@
local gc=love.graphics local gc=love.graphics
local Timer=love.timer.getTime local Timer=love.timer.getTime
local int=math.floor
local sin,log=math.sin,math.log local sin,log=math.sin,math.log
local format=string.format local format=string.format
@@ -191,6 +192,25 @@ function Pnt.pause()
end end
end end
--Mods
if #GAME.mod>0 then
if scoreValid()then
gc.setColor(.7,.7,.7,T*.3)
else
gc.setColor(1,0,0,T*.3)
end
gc.rectangle("fill",780,575,485,140)
setFont(35)
for _,M in next,MODOPT do
if M.sel>0 then
i=M.color
gc.setColor(i[1],i[2],i[3],T)
i=M.no
mStr(M.id,810+i%8*60,575+int(i/8)*45)
end
end
end
--Level rank --Level rank
if GAME.rank>0 then if GAME.rank>0 then
local str=text.ranks[GAME.rank] local str=text.ranks[GAME.rank]
@@ -216,7 +236,8 @@ function Pnt.pause()
--Finesse rank & trophy --Finesse rank & trophy
if S.rank then if S.rank then
setFont(60) setFont(60)
gc.setColor(S.fnsRankColor[1],S.fnsRankColor[2],S.fnsRankColor[3],T) local c=S.fnsRankColor
gc.setColor(c[1],c[2],c[3],T)
gc.print(S.rank,420,635) gc.print(S.rank,420,635)
if S.trophy then if S.trophy then
setFont(40) setFont(40)