mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 12:57:40 +02:00
Color Persistence for Nightly Games (#881)
Added color persistence between game switches for most of the games in the nightly that needed it: - Basketball Girls - Bouncy Road - Chameleon - Clap Trap - Fillbots - Frog Princess - Sick Beats - Sumo Brothers Slot Monster has none yet, because its color changing is a little different lol
This commit is contained in:
@ -150,6 +150,8 @@ namespace HeavenStudio.Games
|
||||
|
||||
public override void OnPlay(double beat)
|
||||
{
|
||||
PersistColor(beat);
|
||||
|
||||
if (queuedFlys.Count > 0) queuedFlys.Clear();
|
||||
foreach (var evt in scheduledInputs)
|
||||
{
|
||||
@ -296,5 +298,23 @@ namespace HeavenStudio.Games
|
||||
if (GameManager.instance.currentGame == "chameleon")
|
||||
Chameleon.instance.Crown.SetActive(enableCrown);
|
||||
}
|
||||
|
||||
private void PersistColor(double beat)
|
||||
{
|
||||
var allEventsBeforeBeat = EventCaller.GetAllInGameManagerList("chameleon", new string[] { "background appearance" }).FindAll(x => x.beat < beat);
|
||||
if (allEventsBeforeBeat.Count > 0)
|
||||
{
|
||||
allEventsBeforeBeat.Sort((x, y) => x.beat.CompareTo(y.beat)); //just in case
|
||||
var lastEvent = allEventsBeforeBeat[^1];
|
||||
BackgroundColorSet(lastEvent.beat, lastEvent.length, lastEvent["colorBG1Start"], lastEvent["colorBG1End"], lastEvent["colorBG2Start"], lastEvent["colorBG2End"], lastEvent["ease"]);
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnGameSwitch(double beat)
|
||||
{
|
||||
PersistColor(beat);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user