Make note accent colour work again.

This commit is contained in:
smoogipooo
2017-05-04 15:36:37 +09:00
parent 956a7288fb
commit f945c636c2
3 changed files with 14 additions and 4 deletions

View File

@ -11,6 +11,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using OpenTK.Graphics;
namespace osu.Desktop.VisualTests.Tests namespace osu.Desktop.VisualTests.Tests
{ {
@ -31,7 +32,8 @@ namespace osu.Desktop.VisualTests.Tests
new DrawableNote(new Note()) new DrawableNote(new Note())
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre Origin = Anchor.Centre,
AccentColour = Color4.Red
} }
} }
}); });

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
@ -17,7 +18,13 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
public DrawableNote(Note hitObject) public DrawableNote(Note hitObject)
: base(hitObject) : base(hitObject)
{ {
Add(new NotePiece()); Add(headPiece = new NotePiece());
}
[BackgroundDependencyLoader]
private void load()
{
headPiece.AccentColour = AccentColour;
} }
protected override void UpdateState(ArmedState state) protected override void UpdateState(ArmedState state)

View File

@ -2,6 +2,7 @@
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.Sprites;
@ -35,7 +36,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
Origin = Anchor.TopCentre, Origin = Anchor.TopCentre,
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
Height = head_colour_height, Height = head_colour_height,
Alpha = 0.5f Alpha = 0.2f
} }
}; };
} }
@ -50,7 +51,7 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables.Pieces
return; return;
accentColour = value; accentColour = value;
colouredBox.Colour = AccentColour; colouredBox.Colour = AccentColour.Lighten(0.9f);
EdgeEffect = new EdgeEffect EdgeEffect = new EdgeEffect
{ {