mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-13 18:17:37 +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:
@ -443,6 +443,8 @@ namespace HeavenStudio.Games
|
||||
public override void OnGameSwitch(double beat) // stole code from manzai
|
||||
{
|
||||
FindNextGameswitchBeat(beat);
|
||||
PersistColor(beat);
|
||||
|
||||
|
||||
foreach(var entity in GameManager.instance.Beatmap.Entities)
|
||||
{
|
||||
@ -464,6 +466,8 @@ namespace HeavenStudio.Games
|
||||
{
|
||||
bgTypeNext = BGType.None;
|
||||
FindNextGameswitchBeat(beat);
|
||||
PersistColor(beat);
|
||||
|
||||
}
|
||||
|
||||
private void FindNextGameswitchBeat(double beat)
|
||||
@ -1306,6 +1310,17 @@ namespace HeavenStudio.Games
|
||||
}
|
||||
}
|
||||
|
||||
private void PersistColor(double beat)
|
||||
{
|
||||
var allEventsBeforeBeat = EventCaller.GetAllInGameManagerList("sumoBrothers", new string[] { "background color" }).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];
|
||||
BackgroundColor(lastEvent.beat, lastEvent.length, lastEvent["colorFrom"], lastEvent["colorTo"], lastEvent["colorFrom2"], lastEvent["colorTo2"], lastEvent["ease"]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user