Update state based on result during LoadComplete

This commit is contained in:
Derrick Timmermans
2022-11-27 20:57:00 +01:00
parent 61bfd2f6b2
commit cff3e06ad6

View File

@ -199,7 +199,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
comboColourBrightness.BindValueChanged(_ => UpdateComboColour());
// Apply transforms
updateState(State.Value, true);
updateStateBasedOnResults();
}
/// <summary>
@ -265,6 +265,16 @@ namespace osu.Game.Rulesets.Objects.Drawables
// If not loaded, the state update happens in LoadComplete().
if (IsLoaded)
{
updateStateBasedOnResults();
// Combo colour may have been applied via a bindable flow while no object entry was attached.
// Update here to ensure we're in a good state.
UpdateComboColour();
}
}
private void updateStateBasedOnResults()
{
if (Result.IsHit)
updateState(ArmedState.Hit, true);
@ -272,11 +282,6 @@ namespace osu.Game.Rulesets.Objects.Drawables
updateState(ArmedState.Miss, true);
else
updateState(ArmedState.Idle, true);
// Combo colour may have been applied via a bindable flow while no object entry was attached.
// Update here to ensure we're in a good state.
UpdateComboColour();
}
}
protected sealed override void OnFree(HitObjectLifetimeEntry entry)