From 513617a977f109c113256b635c7fddd78984bcd3 Mon Sep 17 00:00:00 2001 From: AstrlJelly Date: Sat, 8 Jun 2024 13:16:33 -0400 Subject: [PATCH] Revert "commit for sync" This reverts commit 401d3a93867ac14c449819c1f21dae1f88b4bbc6. --- .../Games/DressYourBest/DressYourBest.cs | 36 +++++++------------ 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/Assets/Scripts/Games/DressYourBest/DressYourBest.cs b/Assets/Scripts/Games/DressYourBest/DressYourBest.cs index bbab1cb8..50daab1f 100644 --- a/Assets/Scripts/Games/DressYourBest/DressYourBest.cs +++ b/Assets/Scripts/Games/DressYourBest/DressYourBest.cs @@ -42,15 +42,14 @@ namespace HeavenStudio.Games.Loaders preFunction = delegate { var e = eventCaller.currentEntity; if (eventCaller.gameManager.TryGetMinigame(out DressYourBest instance)) { - instance.QueueStartInterval(e.beat, e.length, e["autoPass"], e["autoReact"]); + instance.QueueStartInterval(e.beat, e.length, e["auto"]); } }, defaultLength = 3f, resizable = true, parameters = new List() { - new("autoPass", true, "Auto Pass Turn", "Toggle if the turn should be passed automatically at the end of the start interval."), - new("autoReact", true, "Auto React", "Toggle if the reaction should be on by default."), + new("auto", true, "Auto Pass Turn", "Toggle if the turn should be passed automatically at the end of the start interval.") } }, new GameAction("monkey call", "Monkey Call") @@ -70,14 +69,14 @@ namespace HeavenStudio.Games.Loaders preFunction = delegate { var e = eventCaller.currentEntity; if (eventCaller.gameManager.TryGetMinigame(out DressYourBest instance)) { - instance.PassTurn(e.beat, e["auto"]); + instance.PassTurn(e.beat); } }, defaultLength = 1f, - parameters = new List() - { - new("auto", true, "Auto React", "Toggle if the reaction should be on by default.") - } + // parameters = new List() + // { + // new("auto", true, "Auto Pass Turn", "Toggle if the turn should be passed automatically at the end of the start interval.") + // } }, new GameAction("background appearance", "Background Appearance") { @@ -153,6 +152,7 @@ namespace HeavenStudio.Games // i set variables to null when they are not initialized by default 👍 private ColorEase bgColorEase = new(DefaultBGColor); + private Material lightMaterialCurrent; private Sound whirringSfx = null; private List callEntities; @@ -253,7 +253,7 @@ namespace HeavenStudio.Games } // startBeat exists so actions that happened when inactive aren't done again. that would suck - public void QueueStartInterval(double beat, float length, bool autoPass, bool autoReact, double startBeat = double.MinValue) + public void QueueStartInterval(double beat, float length, bool auto, double startBeat = double.MinValue) { List neededCalls = GetNeededCalls(beat, length); if (neededCalls.Count <= 0) return; @@ -274,9 +274,9 @@ namespace HeavenStudio.Games actions.Add(new(call.beat, () => monkeyAnim.DoScaledAnimationAsync("Call", 0.5f))); } // have to add this after all the other actions as actions are done in order of beat - if (autoPass) { + if (auto) { actions.Add(new(beat + length, delegate { - PassTurn(beat + length, autoReact, beat, length, neededCalls); + PassTurn(beat + length, beat, length, neededCalls); })); } _ = MultiSound.Play(sounds); @@ -284,7 +284,7 @@ namespace HeavenStudio.Games } } - public void PassTurn(double beat, bool autoReact, double startIntervalBeat = double.NaN, float startIntervalLength = float.NaN, List neededCalls = null) + public void PassTurn(double beat, double startIntervalBeat = double.NaN, float startIntervalLength = float.NaN, List neededCalls = null) { if (double.IsNaN(startIntervalBeat) || double.IsNaN(startIntervalLength)) { RiqEntity startInterval = gameManager.Beatmap.Entities.FindLast(e => e.beat + e.length < beat); @@ -308,25 +308,15 @@ namespace HeavenStudio.Games double relativeBeat = call.beat - startIntervalBeat; _ = ScheduleInput(beat, relativeBeat + 1, InputAction_BasicPress, OnHit, OnMiss, null); } - if (autoReact) { - BeatAction.New(this, new() { new(beat - startIntervalBeat + beat, delegate { - - })}); - } } + private List GetNeededCalls(double beat, float length) { return callEntities.FindAll(e => e.beat >= beat && e.beat <= beat + length); } - public void IntervalReact() - { - - } - private int hitCount = 0; // resets every pass turn - private bool hasMissed = true; private void OnHit(PlayerActionEvent caller, float state) { SoundByte.PlayOneShotGame("dressYourBest/hit_1");