mirror of
https://github.com/RHeavenStudio/HeavenStudio.git
synced 2025-06-12 13:37:40 +02:00
Color Persistence for R1 games, also fixed lockstep color bug (#882)
Lockstep and Mr Upbeat now have color persistence between game switches. Also, Lockstep can now change colors on a game switch beat.
This commit is contained in:
@ -291,7 +291,7 @@ namespace HeavenStudio.Games
|
||||
|
||||
private void PersistColors(double beat)
|
||||
{
|
||||
var allEventsBeforeBeat = EventCaller.GetAllInGameManagerList("lockstep", new string[] { "" }).FindAll(x => x.beat < beat);
|
||||
var allEventsBeforeBeat = EventCaller.GetAllInGameManagerList("lockstep", new string[] { "set colours" }).FindAll(x => x.beat < beat);
|
||||
if (allEventsBeforeBeat.Count > 0)
|
||||
{
|
||||
allEventsBeforeBeat.Sort((x, y) => x.beat.CompareTo(y.beat));
|
||||
@ -307,14 +307,15 @@ namespace HeavenStudio.Games
|
||||
public override void OnGameSwitch(double beat)
|
||||
{
|
||||
QueueSwitchBGs(beat);
|
||||
PersistColors(beat);
|
||||
|
||||
}
|
||||
|
||||
public override void OnPlay(double beat)
|
||||
{
|
||||
|
||||
queuedInputs.Clear();
|
||||
QueueSwitchBGs(beat);
|
||||
PersistColors(beat);
|
||||
|
||||
}
|
||||
|
||||
private void QueueSwitchBGs(double beat)
|
||||
@ -346,6 +347,9 @@ namespace HeavenStudio.Games
|
||||
stepperMaterial.SetColor("_ColorBravo", stepperDark);
|
||||
stepperMaterial.SetColor("_ColorDelta", stepperLight);
|
||||
|
||||
EntityPreCheck(Conductor.instance.songPositionInBeatsAsDouble);
|
||||
|
||||
|
||||
masterSprite = masterStepperSprite.sprite;
|
||||
stepswitcherLeft.gameObject.SetActive(lessSteppers);
|
||||
stepswitcherRight.gameObject.SetActive(lessSteppers);
|
||||
@ -358,6 +362,11 @@ namespace HeavenStudio.Games
|
||||
cameraDV.Render();
|
||||
}
|
||||
|
||||
void EntityPreCheck(double beat)
|
||||
{
|
||||
PersistColors(beat);
|
||||
}
|
||||
|
||||
void UpdateAndRenderSlaves()
|
||||
{
|
||||
foreach (var stepper in slaveSteppers)
|
||||
|
Reference in New Issue
Block a user