revert some MORE stuff

This commit is contained in:
AstrlJelly 2024-03-02 17:48:56 -05:00
parent 4aec45fd74
commit e8b2d21eba
10 changed files with 17 additions and 70 deletions

View file

@ -141,9 +141,7 @@ namespace HeavenStudio
public void SetBeat(double beat) public void SetBeat(double beat)
{ {
var gameManager = GameManager.instance; var chart = GameManager.instance.Beatmap;
var chart = gameManager.Beatmap;
double offset = chart.data.offset; double offset = chart.data.offset;
startPos = GetSongPosFromBeat(beat); startPos = GetSongPosFromBeat(beat);
@ -154,13 +152,9 @@ namespace HeavenStudio
SeekMusicToTime(startPos, offset); SeekMusicToTime(startPos, offset);
var oldSongPosBeat = songPosBeat;
songPosBeat = GetBeatFromSongPos(time); 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) public void PlaySetup(double beat)

View file

@ -213,7 +213,7 @@ namespace HeavenStudio.Games
} }
} }
public override void OnTimelineChange(double beat) public override void OnTimeChange(double beat)
{ {
UpdateCameraZoom(); UpdateCameraZoom();
} }

View file

@ -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("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."), 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)") // 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 OnStop(double beat) => EntityPreCheck(beat);
public override void OnTimelineChange(double beat) => EntityPreCheck(beat);
void EntityPreCheck(double beat) void EntityPreCheck(double beat)
{ {
if (gameManager == null) return; if (gameManager == null) return;

View file

@ -290,7 +290,7 @@ namespace HeavenStudio.Games
{ {
} }
public virtual void OnTimelineChange(double beat) public virtual void OnTimeChange(double beat)
{ {
} }

View file

@ -193,7 +193,7 @@ namespace HeavenStudio.Games
} }
} }
public override void OnTimelineChange(double beat) public override void OnTimeChange(double beat)
{ {
UpdateCameraZoom(); UpdateCameraZoom();
} }

View file

@ -123,7 +123,7 @@ namespace HeavenStudio.Games
Destroy(BallsHolder.transform.GetChild(i).gameObject); Destroy(BallsHolder.transform.GetChild(i).gameObject);
} }
public override void OnTimelineChange(double beat) public override void OnTimeChange(double beat)
{ {
UpdateCameraZoom(); UpdateCameraZoom();
} }

View file

@ -83,15 +83,7 @@ namespace HeavenStudio.Games
{ {
public class Tambourine : Minigame public class Tambourine : Minigame
{ {
private static Color _defaultBGColor; public static Color defaultBGColor = new Color(0.22f, 0.55f, 0.82f);
public static Color defaultBGColor
{
get
{
ColorUtility.TryParseHtmlString("#388cd0", out _defaultBGColor);
return _defaultBGColor;
}
}
[Header("Components")] [Header("Components")]
[SerializeField] Animator handsAnimator; [SerializeField] Animator handsAnimator;
@ -155,8 +147,6 @@ namespace HeavenStudio.Games
frogAnimator.Play("FrogExited", 0, 0); frogAnimator.Play("FrogExited", 0, 0);
handsAnimator.Play("Idle", 0, 0); handsAnimator.Play("Idle", 0, 0);
monkeyAnimator.Play("MonkeyIdle", 0, 0); monkeyAnimator.Play("MonkeyIdle", 0, 0);
colorStart = defaultBGColor;
colorEnd = defaultBGColor;
} }
void Update() void Update()
@ -475,11 +465,7 @@ namespace HeavenStudio.Games
} }
} }
private double colorStartBeat = -1; private ColorEase bgColorEase = new();
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
//call this in update //call this in update
private void BackgroundColorUpdate() private void BackgroundColorUpdate()
@ -487,13 +473,9 @@ namespace HeavenStudio.Games
bg.color = bgColorEase.GetColor(); 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; bgColorEase = new(beat, length, startColor, endColor, ease);
colorLength = length;
colorStart = colorStartSet;
colorEnd = colorEndSet;
colorEase = (Util.EasingFunction.Ease)ease;
} }
//call this in OnPlay(double beat) and OnGameSwitch(double beat) //call this in OnPlay(double beat) and OnGameSwitch(double beat)

View file

@ -179,7 +179,7 @@ namespace HeavenStudio.Games
} }
} }
public override void OnTimelineChange(double beat) public override void OnTimeChange(double beat)
{ {
UpdateCameraZoom(); UpdateCameraZoom();
} }

View file

@ -114,15 +114,7 @@ namespace HeavenStudio.Games
public class TossBoys : Minigame public class TossBoys : Minigame
{ {
private static Color _defaultBGColor; public static Color defaultBGColor = new Color(0.38f, 0.99f, 0.73f);
public static Color defaultBGColor
{
get
{
ColorUtility.TryParseHtmlString("#62FDBB", out _defaultBGColor);
return _defaultBGColor;
}
}
public enum KidChoice public enum KidChoice
{ {
Akachan = 0, Akachan = 0,
@ -235,8 +227,6 @@ namespace HeavenStudio.Games
private void Awake() private void Awake()
{ {
instance = this; instance = this;
colorStart = defaultBGColor;
colorEnd = defaultBGColor;
SetupBopRegion("tossBoys", "bop", "auto"); SetupBopRegion("tossBoys", "bop", "auto");
SetPassBallEvents(); SetPassBallEvents();
} }
@ -294,11 +284,7 @@ namespace HeavenStudio.Games
} }
} }
private double colorStartBeat = -1; private ColorEase bgColorEase = new(defaultBGColor);
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
//call this in update //call this in update
private void BackgroundColorUpdate() private void BackgroundColorUpdate()
@ -306,13 +292,9 @@ namespace HeavenStudio.Games
bg.color = bgColorEase.GetColor(); 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; bgColorEase = new(beat, length, startColor, endColor, ease);
colorLength = length;
colorStart = colorStartSet;
colorEnd = colorEndSet;
colorEase = (Util.EasingFunction.Ease)ease;
} }
//call this in OnPlay(double beat) and OnGameSwitch(double beat) //call this in OnPlay(double beat) and OnGameSwitch(double beat)

View file

@ -6,7 +6,6 @@ using Jukebox;
using TMPro; using TMPro;
using System.Linq; using System.Linq;
using System.Collections.Generic; using System.Collections.Generic;
using static HeavenStudio.Minigames;
namespace HeavenStudio.Editor.Track namespace HeavenStudio.Editor.Track
{ {
@ -39,7 +38,6 @@ namespace HeavenStudio.Editor.Track
[Header("Properties")] [Header("Properties")]
public RiqEntity entity; public RiqEntity entity;
public GameAction gameAction;
public float length; public float length;
private bool lastVisible; private bool lastVisible;
public bool selected; public bool selected;
@ -99,7 +97,6 @@ namespace HeavenStudio.Editor.Track
if (action != null) if (action != null)
{ {
gameAction = action;
this.resizable = action.resizable; this.resizable = action.resizable;
if (action.resizable == false) if (action.resizable == false)
{ {
@ -329,15 +326,9 @@ namespace HeavenStudio.Editor.Track
if (Conductor.instance.NotStopped()) return; if (Conductor.instance.NotStopped()) return;
if (Input.GetMouseButton(1) || Input.GetMouseButton(2)) return; if (Input.GetMouseButton(1) || Input.GetMouseButton(2)) return;
if (!moving) { if (!moving)
if (!altWhenClicked) { if (!altWhenClicked)
altWhenClicked = Input.GetKey(KeyCode.LeftAlt); altWhenClicked = Input.GetKey(KeyCode.LeftAlt);
}
} else {
if (gameAction.isVfx) {
gameAction.function.Invoke();
}
}
if (!altWhenClicked) if (!altWhenClicked)
{ {