1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-05 17:33:15 +08:00

Move combo colour to accent propagation logic to osu! ruleset

This commit is contained in:
Dean Herbert 2020-02-19 15:16:07 +09:00
parent 618fb4ccfb
commit fec5c4a73a
2 changed files with 9 additions and 3 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Collections.Generic;
using osu.Game.Rulesets.Objects.Drawables;
using osu.Framework.Graphics;
using osu.Game.Rulesets.Judgements;
@ -55,7 +56,7 @@ namespace osu.Game.Rulesets.Osu.Objects.Drawables
}
}
protected override void UpdateComboColour(Color4 comboColour) => AccentColour.Value = comboColour;
protected override void UpdateComboColour(Color4 proposedColour, IReadOnlyList<Color4> comboColours) => AccentColour.Value = proposedColour;
protected override JudgementResult CreateResult(Judgement judgement) => new OsuJudgementResult(HitObject, judgement);
}

View File

@ -349,11 +349,16 @@ namespace osu.Game.Rulesets.Objects.Drawables
if (HitObject is IHasComboInformation combo)
{
var comboColours = CurrentSkin.GetConfig<GlobalSkinColours, IReadOnlyList<Color4>>(GlobalSkinColours.ComboColours)?.Value;
UpdateComboColour(comboColours?.Count > 0 ? comboColours[combo.ComboIndex % comboColours.Count] : Color4.White);
UpdateComboColour(comboColours?.Count > 0 ? comboColours[combo.ComboIndex % comboColours.Count] : Color4.White, comboColours);
}
}
protected virtual void UpdateComboColour(Color4 comboColour)
/// <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)
{
}