2017-03-22 20:38:40 +08:00
|
|
|
|
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
|
|
|
|
|
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
|
|
|
|
|
|
|
|
|
|
using OpenTK;
|
2017-04-13 09:04:12 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Extensions.Color4Extensions;
|
2017-03-22 20:38:40 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Primitives;
|
2017-04-13 09:04:12 +08:00
|
|
|
|
using osu.Game.Graphics;
|
2017-03-22 20:38:40 +08:00
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
|
using osu.Game.Screens.Play;
|
|
|
|
|
|
2017-04-18 15:05:58 +08:00
|
|
|
|
namespace osu.Game.Rulesets.UI
|
2017-03-22 20:38:40 +08:00
|
|
|
|
{
|
|
|
|
|
public class StandardHudOverlay : HudOverlay
|
|
|
|
|
{
|
2017-04-07 20:20:31 +08:00
|
|
|
|
protected override RollingCounter<double> CreateAccuracyCounter() => new PercentageCounter
|
2017-03-22 20:38:40 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
2017-04-07 20:20:31 +08:00
|
|
|
|
Origin = Anchor.TopRight,
|
|
|
|
|
Position = new Vector2(0, 35),
|
2017-03-22 20:38:40 +08:00
|
|
|
|
TextSize = 20,
|
2017-04-07 20:20:31 +08:00
|
|
|
|
Margin = new MarginPadding { Right = 140 },
|
2017-03-22 20:38:40 +08:00
|
|
|
|
};
|
|
|
|
|
|
2017-04-07 20:20:31 +08:00
|
|
|
|
protected override RollingCounter<int> CreateComboCounter() => new SimpleComboCounter
|
2017-03-22 20:38:40 +08:00
|
|
|
|
{
|
2017-04-07 20:20:31 +08:00
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopLeft,
|
|
|
|
|
Position = new Vector2(0, 35),
|
|
|
|
|
Margin = new MarginPadding { Left = 140 },
|
|
|
|
|
TextSize = 20,
|
2017-03-22 20:38:40 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
protected override HealthDisplay CreateHealthDisplay() => new StandardHealthDisplay
|
|
|
|
|
{
|
|
|
|
|
Size = new Vector2(1, 5),
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
Margin = new MarginPadding { Top = 20 }
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
protected override KeyCounterCollection CreateKeyCounter() => new KeyCounterCollection
|
|
|
|
|
{
|
|
|
|
|
IsCounting = true,
|
|
|
|
|
FadeTime = 50,
|
|
|
|
|
Anchor = Anchor.BottomRight,
|
|
|
|
|
Origin = Anchor.BottomRight,
|
|
|
|
|
Margin = new MarginPadding(10),
|
2017-04-07 19:51:37 +08:00
|
|
|
|
Y = - TwoLayerButton.SIZE_RETRACTED.Y,
|
2017-03-22 20:38:40 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
protected override ScoreCounter CreateScoreCounter() => new ScoreCounter(6)
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopCentre,
|
|
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
|
TextSize = 40,
|
|
|
|
|
Position = new Vector2(0, 30),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
protected override SongProgress CreateProgress() => new SongProgress()
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
};
|
2017-04-15 00:31:42 +08:00
|
|
|
|
|
2017-04-13 09:04:12 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
ComboCounter.AccentColour = colours.BlueLighter;
|
|
|
|
|
AccuracyCounter.AccentColour = colours.BlueLighter;
|
|
|
|
|
ScoreCounter.AccentColour = colours.BlueLighter;
|
|
|
|
|
|
|
|
|
|
var shd = HealthDisplay as StandardHealthDisplay;
|
|
|
|
|
if (shd != null)
|
|
|
|
|
{
|
|
|
|
|
shd.AccentColour = colours.BlueLighter;
|
|
|
|
|
shd.GlowColour = colours.BlueDarker.Opacity(0.6f);
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-03-22 20:38:40 +08:00
|
|
|
|
}
|
|
|
|
|
}
|