mirror of
https://github.com/ppy/osu.git
synced 2025-02-07 00:52:59 +08:00
Add combo colour display support
This commit is contained in:
parent
53b3d23842
commit
f16fc29071
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using JetBrains.Annotations;
|
using JetBrains.Annotations;
|
||||||
using osu.Framework.Allocation;
|
using osu.Framework.Allocation;
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
@ -15,6 +16,7 @@ using osu.Framework.Input.Events;
|
|||||||
using osu.Game.Graphics.UserInterface;
|
using osu.Game.Graphics.UserInterface;
|
||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Rulesets.Objects;
|
using osu.Game.Rulesets.Objects;
|
||||||
|
using osu.Game.Rulesets.Objects.Drawables;
|
||||||
using osu.Game.Rulesets.Objects.Types;
|
using osu.Game.Rulesets.Objects.Types;
|
||||||
using osuTK;
|
using osuTK;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
@ -34,6 +36,10 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
|
|
||||||
private readonly List<Container> shadowComponents = new List<Container>();
|
private readonly List<Container> shadowComponents = new List<Container>();
|
||||||
|
|
||||||
|
private DrawableHitObject drawableHitObject;
|
||||||
|
|
||||||
|
private Bindable<Color4> comboColour;
|
||||||
|
|
||||||
private const float thickness = 5;
|
private const float thickness = 5;
|
||||||
|
|
||||||
private const float shadow_radius = 5;
|
private const float shadow_radius = 5;
|
||||||
@ -123,6 +129,30 @@ namespace osu.Game.Screens.Edit.Compose.Components.Timeline
|
|||||||
updateShadows();
|
updateShadows();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[BackgroundDependencyLoader(true)]
|
||||||
|
private void load(HitObjectComposer composer)
|
||||||
|
{
|
||||||
|
if (composer != null)
|
||||||
|
{
|
||||||
|
// best effort to get the drawable representation for grabbing colour and what not.
|
||||||
|
drawableHitObject = composer.HitObjects.FirstOrDefault(d => d.HitObject == HitObject);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void LoadComplete()
|
||||||
|
{
|
||||||
|
base.LoadComplete();
|
||||||
|
|
||||||
|
if (drawableHitObject != null)
|
||||||
|
{
|
||||||
|
comboColour = drawableHitObject.AccentColour.GetBoundCopy();
|
||||||
|
comboColour.BindValueChanged(colour =>
|
||||||
|
{
|
||||||
|
Colour = drawableHitObject.AccentColour.Value;
|
||||||
|
}, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void Update()
|
protected override void Update()
|
||||||
{
|
{
|
||||||
base.Update();
|
base.Update();
|
||||||
|
Loading…
Reference in New Issue
Block a user