mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 08:20:00 +09:00
Move combo colour update logic to osu! ruleset
This commit is contained in:
@ -121,7 +121,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
if (HitObject is IHasComboInformation combo)
|
||||
{
|
||||
comboIndexBindable = combo.ComboIndexBindable.GetBoundCopy();
|
||||
comboIndexBindable.BindValueChanged(_ => updateAccentColour(), true);
|
||||
comboIndexBindable.BindValueChanged(_ => updateComboColour(), true);
|
||||
}
|
||||
|
||||
samplesBindable = HitObject.SamplesBindable.GetBoundCopy();
|
||||
@ -336,7 +336,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
{
|
||||
base.SkinChanged(skin, allowFallback);
|
||||
|
||||
updateAccentColour();
|
||||
updateComboColour();
|
||||
|
||||
ApplySkin(skin, allowFallback);
|
||||
|
||||
@ -344,15 +344,24 @@ namespace osu.Game.Rulesets.Objects.Drawables
|
||||
updateState(State.Value, true);
|
||||
}
|
||||
|
||||
private void updateAccentColour()
|
||||
private void updateComboColour()
|
||||
{
|
||||
if (HitObject is IHasComboInformation combo)
|
||||
{
|
||||
var comboColours = CurrentSkin.GetConfig<GlobalSkinColours, IReadOnlyList<Color4>>(GlobalSkinColours.ComboColours)?.Value;
|
||||
AccentColour.Value = comboColours?.Count > 0 ? comboColours[combo.ComboIndex % comboColours.Count] : Color4.White;
|
||||
UpdateComboColour(comboColours?.Count > 0 ? comboColours[combo.ComboIndex % comboColours.Count] : Color4.White, comboColours);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when a combo colour change is proposed.
|
||||
/// </summary>
|
||||
/// <param name="proposedColour">The proposed combo colour, based off the combo index.</param>
|
||||
/// <param name="comboColours">A list of combo colours provided by the beatmap or skin. Can be null if not available.</param>
|
||||
protected virtual void UpdateComboColour(Color4 proposedColour, IReadOnlyList<Color4> comboColours)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Called when a change is made to the skin.
|
||||
/// </summary>
|
||||
|
Reference in New Issue
Block a user