Fix mods, update UI
This commit is contained in:
@@ -362,47 +362,47 @@ do-- Mod data
|
||||
['fast'] =20,
|
||||
['none'] =0,
|
||||
}
|
||||
local function _lockVfunc(k)
|
||||
local function _lockVfunc(k) do
|
||||
local K=k
|
||||
return function(P,O)
|
||||
if not P then return end
|
||||
P.gameEnv[k]=O
|
||||
P.gameEnv.__lock(k)
|
||||
P.gameEnv[K]=O or true
|
||||
P.gameEnv.__lock(K)
|
||||
end
|
||||
end
|
||||
end end
|
||||
MODOPT={-- Mod options
|
||||
-- funcA always triggered, funcA1 only triggered once, but both functions can lock values
|
||||
{no=0,id="NX",name="next",
|
||||
key="q",x=80,y=230,color='lO',
|
||||
list={0,1,2,3,4,5,6},
|
||||
func =function(P,O) P.gameEnv.nextCount=O end,
|
||||
funcA1=_lockVfunc('nextCount')(P,O),
|
||||
funcA1=_lockVfunc('nextCount'),
|
||||
},
|
||||
{no=1,id="HL",name="hold",
|
||||
key="w",x=200,y=230,color='lO',
|
||||
list={0,1,2,3,4,5,6},
|
||||
func =function(P,O) P.gameEnv.holdCount=O end,
|
||||
funcA1=_lockVfunc('holdCount')(P,O),
|
||||
funcA1=_lockVfunc('holdCount'),
|
||||
},
|
||||
{no=2,id="FL",name="hideNext",
|
||||
key="e",x=320,y=230,color='lA',
|
||||
list={1,2,3,4,5},
|
||||
func =function(P,O) P.gameEnv.nextStartPos=O+1 end,
|
||||
funcA1=_lockVfunc('nextStartPos')(P,O),
|
||||
funcA1=_lockVfunc('nextStartPos'),
|
||||
},
|
||||
{no=3,id="IH",name="infHold",
|
||||
key="r",x=440,y=230,color='lA',
|
||||
func =function(P) P.gameEnv.infHold=true end,
|
||||
funcA1=_lockVfunc('infHold')(P,O),
|
||||
funcA1=_lockVfunc('infHold'),
|
||||
},
|
||||
{no=4,id="HB",name="hideBlock",
|
||||
key="y",x=680,y=230,color='lV',
|
||||
func =function(P) P.gameEnv.block=false end,
|
||||
funcA1=_lockVfunc('block')(P,O),
|
||||
funcA1=_lockVfunc('block'),
|
||||
},
|
||||
{no=5,id="HG",name="hideGhost",
|
||||
key="u",x=800,y=230,color='lV',
|
||||
func =function(P) P.gameEnv.ghost=false end,
|
||||
funcA1=_lockVfunc('ghost')(P,O),
|
||||
funcA1=_lockVfunc('ghost'),
|
||||
},
|
||||
{no=6,id="HD",name="hidden",
|
||||
key="i",x=920,y=230,color='lP',
|
||||
@@ -418,13 +418,13 @@ do-- Mod data
|
||||
key="o",x=1040,y=230,color='lP',
|
||||
list={'down','up','all'},
|
||||
func =function(P,O) P.gameEnv.hideBoard=O end,
|
||||
funcA1=_lockVfunc('hideBoard')(P,O),
|
||||
funcA1=_lockVfunc('hideBoard'),
|
||||
},
|
||||
{no=8,id="FB",name="flipBoard",
|
||||
key="p",x=1160,y=230,color='lJ',
|
||||
list={'U-D','L-R','180'},
|
||||
func =function(P,O) P.gameEnv.flipBoard=O end,
|
||||
funcA1=_lockVfunc('flipBoard')(P,O),
|
||||
funcA1=_lockVfunc('flipBoard'),
|
||||
},
|
||||
|
||||
{no=9,id="DT",name="dropDelay",
|
||||
@@ -442,35 +442,35 @@ do-- Mod data
|
||||
key="s",x=260,y=350,color='lR',
|
||||
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,O) P.gameEnv.lock=O end,
|
||||
funcA1=_lockVfunc('lockDelay')(P,O),
|
||||
funcA1=_lockVfunc('lockDelay'),
|
||||
},
|
||||
{no=11,id="ST",name="waitDelay",
|
||||
key="d",x=380,y=350,color='lR',
|
||||
list={0,1,2,3,4,5,6,7,8,10,15,20,30,60},
|
||||
func =function(P,O) P.gameEnv.wait=O end,
|
||||
funcA1=_lockVfunc('waitDelay')(P,O),
|
||||
funcA1=_lockVfunc('waitDelay'),
|
||||
},
|
||||
{no=12,id="CT",name="fallDelay",
|
||||
key="f",x=500,y=350,color='lR',
|
||||
list={0,1,2,3,4,5,6,7,8,10,15,20,30,60},
|
||||
func =function(P,O) P.gameEnv.fall=O end,
|
||||
funcA1=_lockVfunc('fallDelay')(P,O),
|
||||
funcA1=_lockVfunc('fallDelay'),
|
||||
},
|
||||
{no=13,id="LF",name="life",
|
||||
key="j",x=860,y=350,color='lY',
|
||||
list={0,1,2,3,5,10,15,26,42,87,500},
|
||||
func =function(P,O) P.gameEnv.life=O end,
|
||||
funcA1=_lockVfunc('life')(P,O),
|
||||
funcA1=_lockVfunc('life'),
|
||||
},
|
||||
{no=14,id="FB",name="forceB2B",
|
||||
key="k",x=980,y=350,color='lY',
|
||||
func =function(P) P.gameEnv.b2bKill=true end,
|
||||
funcA1=_lockVfunc('b2bKill')(P,O),
|
||||
funcA1=_lockVfunc('b2bKill'),
|
||||
},
|
||||
{no=15,id="PF",name="forceFinesse",
|
||||
key="l",x=1100,y=350,color='lY',
|
||||
func =function(P) P.gameEnv.fineKill=true end,
|
||||
funcA1=_lockVfunc('fineKill')(P,O),
|
||||
funcA1=_lockVfunc('fineKill'),
|
||||
},
|
||||
|
||||
{no=16,id="TL",name="tele",
|
||||
@@ -507,13 +507,13 @@ do-- Mod data
|
||||
key="b",x=680,y=470,color='lB',
|
||||
list={'bag','bagES','his','hisPool','c2','bagP1inf','rnd','mess','reverb'},
|
||||
func =function(P,O) P.gameEnv.sequence=O end,
|
||||
funcA1=_lockVfunc('sequence')(P,O),
|
||||
funcA1=_lockVfunc('sequence'),
|
||||
},
|
||||
{no=20,id="PS",name="pushSpeed",
|
||||
key="n",x=800,y=470,color='lB',
|
||||
list={.5,1,2,3,5,15,1e99},
|
||||
func =function(P,O) P.gameEnv.pushSpeed=O end,
|
||||
funcA1=_lockVfunc('pushSpeed')(P,O),
|
||||
funcA1=_lockVfunc('pushSpeed'),
|
||||
},
|
||||
{no=21,id="BN",name="boneBlock",
|
||||
key="m",x=920,y=470,color='lB',
|
||||
|
||||
@@ -207,6 +207,8 @@ local function _executeMod(P)
|
||||
M.funcA1(P,M.list and M.list[GAME.mod[i]])
|
||||
elseif M.funcA then
|
||||
table.insert(GAME.modCodeList[P.id],function() M.func(P,M.list and M.list[GAME.mod[i]]) end)
|
||||
else
|
||||
M.func(P,M.list and M.list[GAME.mod[i]])
|
||||
end
|
||||
else -- Already checked pre or post before calling _executeMod()
|
||||
M.func(P,M.list and M.list[GAME.mod[i]])
|
||||
@@ -326,7 +328,7 @@ local function _applyGameEnv(P)-- Finish gameEnv processing
|
||||
end
|
||||
end
|
||||
|
||||
if ENV.allowMod and GAME.modApplyAt=='postInit' then
|
||||
if ENV.allowMod and GAME.modApplyAt~='preInit' then
|
||||
_executeMod(P)
|
||||
end
|
||||
|
||||
|
||||
@@ -98,7 +98,12 @@ function scene.draw()
|
||||
local t=M.time*.01-- t range:0~0.1
|
||||
GC.scale(1+3*t)
|
||||
GC.rotate(t)
|
||||
local rad,side=45,5 -- rad=40 --> circle (but that will be a story in the future)
|
||||
local rad,side=45,5
|
||||
if GAME.modApplyAt=='always' then
|
||||
if M.funcA then side=nil
|
||||
elseif M.funcA1 then side=8
|
||||
else side=5 end
|
||||
end
|
||||
local color=M.color
|
||||
GC.setColor(color[1],color[2],color[3],5*t)
|
||||
GC.circle('fill',0,0,rad,side)
|
||||
@@ -125,6 +130,9 @@ function scene.draw()
|
||||
if selected then
|
||||
setFont(30)
|
||||
GC.printf(text.modInfo[selected.name],70,540,950)
|
||||
elseif WIDGET.isFocus(scene.widgetList.modApplyAt) then
|
||||
setFont(20)
|
||||
GC.printf(text.modApplyAtInstruction,70,540,950)
|
||||
else
|
||||
setFont(25)
|
||||
GC.printf(text.modInstruction,70,540,950)
|
||||
@@ -132,11 +140,11 @@ function scene.draw()
|
||||
end
|
||||
|
||||
scene.widgetList={
|
||||
WIDGET.newText{name='title', x=80,y=50,font=70,align='L'},
|
||||
WIDGET.newText{name='unranked', x=1200,y=60,color='Y',font=50,align='R'},
|
||||
WIDGET.newSwitch{name='modPatch',x=1175,y=550,font=20,disp=function() return GAME.modPatch end,code=function() GAME.modPatch=not GAME.modPatch end},
|
||||
WIDGET.newButton{name='reset', x=1095,y=640,w=80,h=80,font=60,fText=CHAR.icon.trash,code=pressKey'tab'},
|
||||
WIDGET.newButton{name='back', x=1185,y=640,w=80,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
|
||||
WIDGET.newText{name='title', x= 80,y=50,font=70,align='L'},
|
||||
WIDGET.newText{name='unranked', x= 970,y=70,color='Y',font=50,align='R'},
|
||||
WIDGET.newSelector{name='modApplyAt',x=1100,y=100,w=230,color='Y',font=20,list={'preInit','postInit','always'},disp=function() return GAME.modApplyAt end,code=function(v) GAME.modApplyAt=v end},
|
||||
WIDGET.newButton{name='reset', x=1140,y=540,w=170,h=80,font=25,code=pressKey'tab'},
|
||||
WIDGET.newButton{name='back', x=1140,y=640,w=170,h=80,sound='back',font=60,fText=CHAR.icon.back,code=backScene},
|
||||
}
|
||||
|
||||
return scene
|
||||
|
||||
Reference in New Issue
Block a user