Skip to content

Commit

Permalink
compatible benchwarp options
Browse files Browse the repository at this point in the history
  • Loading branch information
wdghzym committed May 15, 2024
1 parent bd868cb commit f3aea5e
Showing 1 changed file with 36 additions and 12 deletions.
48 changes: 36 additions & 12 deletions BenchDeploy/GUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ private void DetectHotkeys()
{
keylength2 = -1;
//BenchManager.SetBench(0);
DeployClickedbefore();
}
if (InputHandler.Instance.inputActions.left.WasPressed && InputHandler.Instance.inputActions.superDash.IsPressed)
{
Expand All @@ -62,12 +63,7 @@ private void DetectHotkeys()
if (InputHandler.Instance.inputActions.down.WasPressed && InputHandler.Instance.inputActions.superDash.IsPressed)
{
TopMenu.DeployClicked(null);
BenchManager.AddBench(new Bench()
{
benchScene = Benchwarp.Benchwarp.LS.benchScene,
benchX = Benchwarp.Benchwarp.LS.benchX,
benchY = Benchwarp.Benchwarp.LS.benchY,
});
AddBench();
}
if (InputHandler.Instance.inputActions.up.WasPressed && InputHandler.Instance.inputActions.superDash.IsPressed)
{
Expand Down Expand Up @@ -101,12 +97,9 @@ private void DetectHotkeys()
private void keyDown(KeyCode key)
{
if (lastkey == dbd && key == dbb)
BenchManager.AddBench(new Bench()
{
benchScene = Benchwarp.Benchwarp.LS.benchScene,
benchX = Benchwarp.Benchwarp.LS.benchX,
benchY = Benchwarp.Benchwarp.LS.benchY,
});
AddBench();
if (key == dbd)
DeployClickedbefore();
if (key == wdw)
{
keylength++;
Expand All @@ -123,5 +116,36 @@ private void keyDown(KeyCode key)
// keylength++;
lastkey = key;
}
private Bench GetCurrentDeployBench()
{
return new Bench()
{
benchScene = Benchwarp.Benchwarp.LS.benchScene,
benchX = Benchwarp.Benchwarp.LS.benchX,
benchY = Benchwarp.Benchwarp.LS.benchY,
};
}
Bench lastDeployBench;
private void DeployClickedbefore()
{
lastDeployBench = GetCurrentDeployBench();
}
private void AddBench()
{
Bench bench = GetCurrentDeployBench();
//compatible benchwarp options (cd no-air unsafe)
BenchDeploy.LogDebug($"add Bench {bench.benchX} {bench.benchY}/ {lastDeployBench.benchX} {lastDeployBench.benchY} / {HeroController.instance.transform.position.x} {HeroController.instance.transform.position.y}");
if ((lastDeployBench.benchScene == bench.benchScene
&& lastDeployBench.benchX == bench.benchX
&& lastDeployBench.benchY == bench.benchY)
&& (lastDeployBench.benchScene != GameManager.instance.sceneName
|| lastDeployBench.benchX != HeroController.instance.transform.position.x
|| lastDeployBench.benchY != HeroController.instance.transform.position.y))
return;

BenchManager.AddBench(bench);
BenchDeploy.LogDebug("added Bench!");
}

}
}

0 comments on commit f3aea5e

Please sign in to comment.