From 42f02bb9fcff3c995ba30cb7bc21a3f48da8405d Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 14 Dec 2020 11:35:39 +0800 Subject: [PATCH] =?UTF-8?q?mod=E5=88=97=E8=A1=A8=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E6=95=B0=E5=AD=97=E4=BD=9C=E4=B8=BA=E7=B4=A2=E5=BC=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/globalTables.lua | 47 +++++++++++++++++++++--------------------- parts/scenes/mod.lua | 10 ++++----- 2 files changed, 29 insertions(+), 28 deletions(-) diff --git a/parts/globalTables.lua b/parts/globalTables.lua index 7a90ee97..787c7cd6 100644 --- a/parts/globalTables.lua +++ b/parts/globalTables.lua @@ -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 diff --git a/parts/scenes/mod.lua b/parts/scenes/mod.lua index c4467120..58684855 100644 --- a/parts/scenes/mod.lua +++ b/parts/scenes/mod.lua @@ -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)