From e8b2d21eba131e1009d49d89474f73f59f67e055 Mon Sep 17 00:00:00 2001 From: AstrlJelly Date: Sat, 2 Mar 2024 17:48:56 -0500 Subject: [PATCH] revert some MORE stuff --- Assets/Scripts/Conductor.cs | 10 ++----- .../Games/CheerReaders/CheerReaders.cs | 2 +- Assets/Scripts/Games/KarateMan/KarateMan.cs | 2 -- Assets/Scripts/Games/Minigame.cs | 2 +- Assets/Scripts/Games/Ringside/Ringside.cs | 2 +- Assets/Scripts/Games/Spaceball/Spaceball.cs | 2 +- Assets/Scripts/Games/Tambourine/Tambourine.cs | 26 +++---------------- Assets/Scripts/Games/TapTroupe/TapTroupe.cs | 2 +- Assets/Scripts/Games/TossBoys/TossBoys.cs | 26 +++---------------- .../LevelEditor/Timeline/TimelineEventObj.cs | 13 ++-------- 10 files changed, 17 insertions(+), 70 deletions(-) diff --git a/Assets/Scripts/Conductor.cs b/Assets/Scripts/Conductor.cs index 36e965e49..ecf10bd0b 100644 --- a/Assets/Scripts/Conductor.cs +++ b/Assets/Scripts/Conductor.cs @@ -141,9 +141,7 @@ namespace HeavenStudio public void SetBeat(double beat) { - var gameManager = GameManager.instance; - - var chart = gameManager.Beatmap; + var chart = GameManager.instance.Beatmap; double offset = chart.data.offset; startPos = GetSongPosFromBeat(beat); @@ -154,13 +152,9 @@ namespace HeavenStudio SeekMusicToTime(startPos, offset); - var oldSongPosBeat = songPosBeat; songPosBeat = GetBeatFromSongPos(time); - if (oldSongPosBeat != songPosBeat && gameManager.minigame != null) { - gameManager.minigame.OnTimelineChange(songPosBeat); - } - gameManager.SetCurrentEventToClosest(beat); + GameManager.instance.SetCurrentEventToClosest(beat); } public void PlaySetup(double beat) diff --git a/Assets/Scripts/Games/CheerReaders/CheerReaders.cs b/Assets/Scripts/Games/CheerReaders/CheerReaders.cs index 3b0b48d80..1078b75c9 100644 --- a/Assets/Scripts/Games/CheerReaders/CheerReaders.cs +++ b/Assets/Scripts/Games/CheerReaders/CheerReaders.cs @@ -213,7 +213,7 @@ namespace HeavenStudio.Games } } - public override void OnTimelineChange(double beat) + public override void OnTimeChange(double beat) { UpdateCameraZoom(); } diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs index 07d7a57d9..68dad4059 100644 --- a/Assets/Scripts/Games/KarateMan/KarateMan.cs +++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs @@ -306,7 +306,6 @@ namespace HeavenStudio.Games.Loaders new Param("startTexture", new Color(), "Start Texture Color", "Set the color at the start of the event."), new Param("endTexture", new Color(), "End Texture Color", "Set the color at the end of the event."), }, - isVfx = true, }, // new GameAction("set background effects", "Background Appearance (OLD)") // { @@ -726,7 +725,6 @@ namespace HeavenStudio.Games } public override void OnStop(double beat) => EntityPreCheck(beat); - public override void OnTimelineChange(double beat) => EntityPreCheck(beat); void EntityPreCheck(double beat) { if (gameManager == null) return; diff --git a/Assets/Scripts/Games/Minigame.cs b/Assets/Scripts/Games/Minigame.cs index 5abcafb02..fa9cfe7bb 100644 --- a/Assets/Scripts/Games/Minigame.cs +++ b/Assets/Scripts/Games/Minigame.cs @@ -290,7 +290,7 @@ namespace HeavenStudio.Games { } - public virtual void OnTimelineChange(double beat) + public virtual void OnTimeChange(double beat) { } diff --git a/Assets/Scripts/Games/Ringside/Ringside.cs b/Assets/Scripts/Games/Ringside/Ringside.cs index b40410043..cf7ed69b1 100644 --- a/Assets/Scripts/Games/Ringside/Ringside.cs +++ b/Assets/Scripts/Games/Ringside/Ringside.cs @@ -193,7 +193,7 @@ namespace HeavenStudio.Games } } - public override void OnTimelineChange(double beat) + public override void OnTimeChange(double beat) { UpdateCameraZoom(); } diff --git a/Assets/Scripts/Games/Spaceball/Spaceball.cs b/Assets/Scripts/Games/Spaceball/Spaceball.cs index 4810c91e8..9ddf6676b 100644 --- a/Assets/Scripts/Games/Spaceball/Spaceball.cs +++ b/Assets/Scripts/Games/Spaceball/Spaceball.cs @@ -123,7 +123,7 @@ namespace HeavenStudio.Games Destroy(BallsHolder.transform.GetChild(i).gameObject); } - public override void OnTimelineChange(double beat) + public override void OnTimeChange(double beat) { UpdateCameraZoom(); } diff --git a/Assets/Scripts/Games/Tambourine/Tambourine.cs b/Assets/Scripts/Games/Tambourine/Tambourine.cs index 2bfb3428e..aa9b263e2 100644 --- a/Assets/Scripts/Games/Tambourine/Tambourine.cs +++ b/Assets/Scripts/Games/Tambourine/Tambourine.cs @@ -83,15 +83,7 @@ namespace HeavenStudio.Games { public class Tambourine : Minigame { - private static Color _defaultBGColor; - public static Color defaultBGColor - { - get - { - ColorUtility.TryParseHtmlString("#388cd0", out _defaultBGColor); - return _defaultBGColor; - } - } + public static Color defaultBGColor = new Color(0.22f, 0.55f, 0.82f); [Header("Components")] [SerializeField] Animator handsAnimator; @@ -155,8 +147,6 @@ namespace HeavenStudio.Games frogAnimator.Play("FrogExited", 0, 0); handsAnimator.Play("Idle", 0, 0); monkeyAnimator.Play("MonkeyIdle", 0, 0); - colorStart = defaultBGColor; - colorEnd = defaultBGColor; } void Update() @@ -475,11 +465,7 @@ namespace HeavenStudio.Games } } - private double colorStartBeat = -1; - private float colorLength = 0f; - private Color colorStart = Color.white; //obviously put to the default color of the game - private Color colorEnd = Color.white; - private Util.EasingFunction.Ease colorEase; //putting Util in case this game is using jukebox + private ColorEase bgColorEase = new(); //call this in update private void BackgroundColorUpdate() @@ -487,13 +473,9 @@ namespace HeavenStudio.Games bg.color = bgColorEase.GetColor(); } - public void BackgroundColor(double beat, float length, Color colorStartSet, Color colorEndSet, int ease) + public void BackgroundColor(double beat, float length, Color startColor, Color endColor, int ease) { - colorStartBeat = beat; - colorLength = length; - colorStart = colorStartSet; - colorEnd = colorEndSet; - colorEase = (Util.EasingFunction.Ease)ease; + bgColorEase = new(beat, length, startColor, endColor, ease); } //call this in OnPlay(double beat) and OnGameSwitch(double beat) diff --git a/Assets/Scripts/Games/TapTroupe/TapTroupe.cs b/Assets/Scripts/Games/TapTroupe/TapTroupe.cs index e7839f7ea..c1220898b 100644 --- a/Assets/Scripts/Games/TapTroupe/TapTroupe.cs +++ b/Assets/Scripts/Games/TapTroupe/TapTroupe.cs @@ -179,7 +179,7 @@ namespace HeavenStudio.Games } } - public override void OnTimelineChange(double beat) + public override void OnTimeChange(double beat) { UpdateCameraZoom(); } diff --git a/Assets/Scripts/Games/TossBoys/TossBoys.cs b/Assets/Scripts/Games/TossBoys/TossBoys.cs index 24df894d9..4e0275176 100644 --- a/Assets/Scripts/Games/TossBoys/TossBoys.cs +++ b/Assets/Scripts/Games/TossBoys/TossBoys.cs @@ -114,15 +114,7 @@ namespace HeavenStudio.Games public class TossBoys : Minigame { - private static Color _defaultBGColor; - public static Color defaultBGColor - { - get - { - ColorUtility.TryParseHtmlString("#62FDBB", out _defaultBGColor); - return _defaultBGColor; - } - } + public static Color defaultBGColor = new Color(0.38f, 0.99f, 0.73f); public enum KidChoice { Akachan = 0, @@ -235,8 +227,6 @@ namespace HeavenStudio.Games private void Awake() { instance = this; - colorStart = defaultBGColor; - colorEnd = defaultBGColor; SetupBopRegion("tossBoys", "bop", "auto"); SetPassBallEvents(); } @@ -294,11 +284,7 @@ namespace HeavenStudio.Games } } - private double colorStartBeat = -1; - private float colorLength = 0f; - private Color colorStart = Color.white; //obviously put to the default color of the game - private Color colorEnd = Color.white; - private Util.EasingFunction.Ease colorEase; //putting Util in case this game is using jukebox + private ColorEase bgColorEase = new(defaultBGColor); //call this in update private void BackgroundColorUpdate() @@ -306,13 +292,9 @@ namespace HeavenStudio.Games bg.color = bgColorEase.GetColor(); } - public void BackgroundColor(double beat, float length, Color colorStartSet, Color colorEndSet, int ease) + public void BackgroundColor(double beat, float length, Color startColor, Color endColor, int ease) { - colorStartBeat = beat; - colorLength = length; - colorStart = colorStartSet; - colorEnd = colorEndSet; - colorEase = (Util.EasingFunction.Ease)ease; + bgColorEase = new(beat, length, startColor, endColor, ease); } //call this in OnPlay(double beat) and OnGameSwitch(double beat) diff --git a/Assets/Scripts/LevelEditor/Timeline/TimelineEventObj.cs b/Assets/Scripts/LevelEditor/Timeline/TimelineEventObj.cs index 63109aa22..d4f620684 100644 --- a/Assets/Scripts/LevelEditor/Timeline/TimelineEventObj.cs +++ b/Assets/Scripts/LevelEditor/Timeline/TimelineEventObj.cs @@ -6,7 +6,6 @@ using Jukebox; using TMPro; using System.Linq; using System.Collections.Generic; -using static HeavenStudio.Minigames; namespace HeavenStudio.Editor.Track { @@ -39,7 +38,6 @@ namespace HeavenStudio.Editor.Track [Header("Properties")] public RiqEntity entity; - public GameAction gameAction; public float length; private bool lastVisible; public bool selected; @@ -99,7 +97,6 @@ namespace HeavenStudio.Editor.Track if (action != null) { - gameAction = action; this.resizable = action.resizable; if (action.resizable == false) { @@ -329,15 +326,9 @@ namespace HeavenStudio.Editor.Track if (Conductor.instance.NotStopped()) return; if (Input.GetMouseButton(1) || Input.GetMouseButton(2)) return; - if (!moving) { - if (!altWhenClicked) { + if (!moving) + if (!altWhenClicked) altWhenClicked = Input.GetKey(KeyCode.LeftAlt); - } - } else { - if (gameAction.isVfx) { - gameAction.function.Invoke(); - } - } if (!altWhenClicked) {