mod列表使用数字作为索引

This commit is contained in:
MrZ626
2020-12-14 11:35:39 +08:00
parent a4348f9646
commit 42f02bb9fc
2 changed files with 29 additions and 28 deletions

View File

@@ -2,92 +2,92 @@ local function disableKey(P,key)
table.insert(P.gameEnv.keyCancel,key)
end
MODOPT={--Mod options
next={no=0,id="NX",
{no=0,id="NX",name="next",
key="q",x=80,y=230,color="orange",
list={0,1,2,3,4,5,6},
func=function(P,M)P.gameEnv.nextCount=M.list[M.sel]end,
},
hold={no=1,id="HL",
{no=1,id="HL",name="hold",
key="w",x=200,y=230,color="orange",
list={0,1,2,3,4,5,6},
func=function(P,M)P.gameEnv.holdCount=M.list[M.sel]end,
unranked=true,
},
hideNext={no=2,id="FL",
{no=2,id="FL",name="hideNext",
key="e",x=320,y=230,color="water",
list={1,2,3,4,5},
func=function(P,M)P.gameEnv.nextStartPos=M.list[M.sel]+1 end,
},
infHold={no=3,id="IH",
{no=3,id="IH",name="infHold",
key="r",x=440,y=230,color="water",
func=function(P)P.gameEnv.infHold=true end,
unranked=true,
},
hideBlock={no=4,id="HB",
{no=4,id="HB",name="hideBlock",
key="y",x=680,y=230,color="purple",
func=function(P)P.gameEnv.block=false end,
},
hideGhost={no=5,id="HG",
{no=5,id="HG",name="hideGhost",
key="u",x=800,y=230,color="purple",
func=function(P)P.gameEnv.ghost=false end,
},
hidden={no=6,id="HD",
{no=6,id="HD",name="hidden",
key="i",x=920,y=230,color="grape",
list={"time","fast","none"},
func=function(P,M)P.gameEnv.visible=M.list[M.sel]end,
unranked=true,
},
hideBoard={no=7,id="HB",
{no=7,id="HB",name="hideBoard",
key="o",x=1040,y=230,color="grape",
list={"down","up","all"},
func=function(P)LOG.print("该mod还没有做好!")end,
},
flipBoard={no=8,id="FB",
{no=8,id="FB",name="flipBoard",
key="p",x=1160,y=230,color="grass",
list={"UD","LR","180"},
func=function(P)LOG.print("该mod还没有做好!")end,
},
dropDelay={no=9,id="DT",
{no=9,id="DT",name="dropDelay",
key="a",x=140,y=350,color="red",
list={0,.125,.25,.5,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99},
func=function(P,M)P.gameEnv.drop=M.list[M.sel]end,
unranked=true,
},
lockDelay={no=10,id="LT",
{no=10,id="LT",name="lockDelay",
key="s",x=260,y=350,color="red",
list={0,1,2,3,4,5,6,7,8,9,10,12,14,16,18,20,25,30,40,60,180,1e99},
func=function(P,M)P.gameEnv.lock=M.list[M.sel]end,
unranked=true,
},
waitDelay={no=11,id="ST",
{no=11,id="ST",name="waitDelay",
key="d",x=380,y=350,color="red",
list={0,1,2,3,4,5,6,7,8,10,15,20,30,60},
func=function(P,M)P.gameEnv.wait=M.list[M.sel]end,
unranked=true,
},
fallDelay={no=12,id="CT",
{no=12,id="CT",name="fallDelay",
key="f",x=500,y=350,color="red",
list={0,1,2,3,4,5,6,7,8,10,15,20,30,60},
func=function(P,M)P.gameEnv.fall=M.list[M.sel]end,
unranked=true,
},
life={no=13,id="LF",
{no=13,id="LF",name="life",
key="j",x=860,y=350,color="yellow",
list={0,1,2,3,5,10,15,26,42,87,500},
func=function(P,M)P.gameEnv.life=M.list[M.sel]end,
unranked=true,
},
forceB2B={no=14,id="FB",
{no=14,id="FB",name="forceB2B",
key="k",x=980,y=350,color="yellow",
func=function(P)P.gameEnv.b2bKill=true end,
},
forceFinesse={no=15,id="PF",
{no=15,id="PF",name="forceFinesse",
key="l",x=1100,y=350,color="yellow",
func=function(P)P.gameEnv.fineKill=true end,
},
tele={no=16,id="TL",
{no=16,id="TL",name="tele",
key="z",x=200,y=470,color="lGrey",
func=function(P)
P.gameEnv.das,P.gameEnv.arr=0,0
@@ -95,7 +95,7 @@ MODOPT={--Mod options
end,
unranked=true,
},
noRotation={no=17,id="FX",
{no=17,id="FX",name="noRotation",
key="x",x=320,y=470,color="lGrey",
func=function(P)
disableKey(P,3)
@@ -103,7 +103,7 @@ MODOPT={--Mod options
disableKey(P,5)
end,
},
noMove={no=18,id="GL",
{no=18,id="GL",name="noMove",
key="c",x=440,y=470,color="lGrey",
func=function(P)
disableKey(P,1)disableKey(P,2)
@@ -112,25 +112,26 @@ MODOPT={--Mod options
disableKey(P,19)disableKey(P,20)
end,
},
customSeq={no=19,id="CS",
{no=19,id="CS",name="customSeq",
key="b",x=680,y=470,color="blue",
list={"bag","his4","rnd","reverb"},
func=function(P,M)P.gameEnv.sequence=M.list[M.sel]end,
unranked=true,
},
pushSpeed={no=20,id="PS",
{no=20,id="PS",name="pushSpeed",
key="n",x=800,y=470,color="blue",
list={.5,1,2,3,5,15,1e99},
func=function(P,M)P.gameEnv.pushSpeed=M.list[M.sel]end,
unranked=true,
},
boneBlock={no=21,id="BN",
{no=21,id="BN",name="boneBlock",
key="m",x=920,y=470,color="blue",
list={"on","off"},
func=function(P,M)P.gameEnv.bone=M.sel==1 end,
},
}
for _,M in next,MODOPT do
for i=1,#MODOPT do
local M=MODOPT[i]
M.sel,M.time=0,0
M.color=COLOR[M.color]
end

View File

@@ -50,9 +50,9 @@ end
function scene.mouseMove(x,y)
selected=nil
for N,M in next,MODOPT do
for _,M in next,MODOPT do
if(x-M.x)^2+(y-M.y)^2<2000 then
selected=N
selected=M
break
end
end
@@ -81,10 +81,10 @@ function scene.keyDown(key)
SFX.play("hold")
end
elseif #key==1 then
for N,M in next,MODOPT do
for _,M in next,MODOPT do
if key==M.key then
toggleMod(M,kb.isDown("lshift","rshift"))
selected=N
selected=M
break
end
end
@@ -146,7 +146,7 @@ function scene.draw()
gc.setColor(1,1,1)
if selected then
setFont(30)
gc.printf(text.modInfo[selected],70,540,950)
gc.printf(text.modInfo[selected.name],70,540,950)
else
setFont(25)
gc.printf(text.modInstruction,70,540,950)