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
|
|
|
|
|
|
2017-04-13 09:04:12 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2017-03-22 20:38:40 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
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;
|
2017-04-20 16:11:58 +08:00
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
2017-05-05 12:00:05 +08:00
|
|
|
|
using osu.Game.Screens.Play.HUD;
|
|
|
|
|
using OpenTK;
|
2017-05-17 15:36:57 +08:00
|
|
|
|
using osu.Game.Screens.Play.Options;
|
2017-03-22 20:38:40 +08:00
|
|
|
|
|
2017-05-05 12:00:05 +08:00
|
|
|
|
namespace osu.Game.Screens.Play
|
2017-03-22 20:38:40 +08:00
|
|
|
|
{
|
2017-05-05 12:00:05 +08:00
|
|
|
|
public class StandardHUDOverlay : HUDOverlay
|
2017-03-22 20:38:40 +08:00
|
|
|
|
{
|
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),
|
|
|
|
|
};
|
|
|
|
|
|
2017-04-18 17:10:01 +08:00
|
|
|
|
protected override SongProgress CreateProgress() => new SongProgress
|
2017-03-22 20:38:40 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.BottomLeft,
|
|
|
|
|
Origin = Anchor.BottomLeft,
|
|
|
|
|
RelativeSizeAxes = Axes.X,
|
|
|
|
|
};
|
2017-04-15 00:31:42 +08:00
|
|
|
|
|
2017-05-05 12:00:05 +08:00
|
|
|
|
protected override ModDisplay CreateModsContainer() => new ModDisplay
|
2017-05-03 03:34:07 +08:00
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopRight,
|
|
|
|
|
Origin = Anchor.TopRight,
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
2017-05-05 12:00:05 +08:00
|
|
|
|
Margin = new MarginPadding { Top = 20, Right = 10 },
|
2017-05-03 03:34:07 +08:00
|
|
|
|
};
|
|
|
|
|
|
2017-05-17 15:36:57 +08:00
|
|
|
|
protected override OptionsDisplay CreateOptionsDisplay() => new OptionsDisplay
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.TopRight,
|
|
|
|
|
Origin = Anchor.TopRight,
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Margin = new MarginPadding { Top = 100, Right = 10 },
|
|
|
|
|
};
|
|
|
|
|
|
2017-05-03 13:27:47 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
2017-04-13 09:04:12 +08:00
|
|
|
|
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;
|
2017-04-20 16:11:58 +08:00
|
|
|
|
shd.GlowColour = colours.BlueDarker;
|
2017-04-13 09:04:12 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-04-20 16:11:58 +08:00
|
|
|
|
|
|
|
|
|
public override void BindProcessor(ScoreProcessor processor)
|
|
|
|
|
{
|
|
|
|
|
base.BindProcessor(processor);
|
|
|
|
|
|
|
|
|
|
var shd = HealthDisplay as StandardHealthDisplay;
|
2017-04-20 18:45:15 +08:00
|
|
|
|
if (shd != null)
|
|
|
|
|
processor.NewJudgement += shd.Flash;
|
2017-04-20 16:11:58 +08:00
|
|
|
|
}
|
2017-03-22 20:38:40 +08:00
|
|
|
|
}
|
|
|
|
|
}
|