1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 10:57:30 +08:00
osu-lazer/osu.Game/Screens/Play/StandardHUDOverlay.cs

99 lines
3.3 KiB
C#
Raw Normal View History

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 osu.Framework.Allocation;
2017-03-22 20:38:40 +08:00
using osu.Framework.Graphics;
using osu.Game.Graphics;
2017-03-22 20:38:40 +08:00
using osu.Game.Graphics.UserInterface;
using osu.Game.Rulesets.Scoring;
using osu.Game.Screens.Play.HUD;
using OpenTK;
2017-03-22 20:38:40 +08:00
namespace osu.Game.Screens.Play
2017-03-22 20:38:40 +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),
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
protected override ModDisplay CreateModsContainer() => new ModDisplay
2017-05-03 03:34:07 +08:00
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
AutoSizeAxes = Axes.Both,
Margin = new MarginPadding { Top = 20, Right = 10 },
2017-05-03 03:34:07 +08:00
};
2017-05-03 13:27:47 +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;
}
}
public override void BindProcessor(ScoreProcessor processor)
{
base.BindProcessor(processor);
var shd = HealthDisplay as StandardHealthDisplay;
if (shd != null)
processor.NewJudgement += shd.Flash;
}
2017-03-22 20:38:40 +08:00
}
}