Use new UpdateComboColour method to simplify colouring

This commit is contained in:
Dean Herbert
2020-02-19 15:16:19 +09:00
parent fec5c4a73a
commit 3f99d25e37
3 changed files with 19 additions and 11 deletions

View File

@ -1,7 +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 osu.Framework.Bindables;
using System.Collections.Generic;
using osu.Framework.Utils;
using osuTK.Graphics;
@ -14,16 +14,9 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable
{
}
protected override void LoadComplete()
{
base.LoadComplete();
AccentColour.BindValueChanged(accentChanged, true);
}
private Color4? colour;
private void accentChanged(ValueChangedEvent<Color4> obj)
protected override void UpdateComboColour(Color4 proposedColour, IReadOnlyList<Color4> comboColours)
{
// override any external colour changes with banananana
AccentColour.Value = (colour ??= getBananaColour());