forked from ppy/osu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add "Argon" performance points counter
- Loading branch information
1 parent
daf4a03
commit 56eeb11
Showing
2 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using osu.Framework.Allocation; | ||
using osu.Framework.Extensions.LocalisationExtensions; | ||
using osu.Framework.Graphics; | ||
using osu.Framework.Graphics.Containers; | ||
using osu.Framework.Graphics.Sprites; | ||
using osu.Framework.Localisation; | ||
using osu.Game.Graphics; | ||
using osu.Game.Graphics.Sprites; | ||
using osu.Game.Resources.Localisation.Web; | ||
using osu.Game.Screens.Play.HUD; | ||
using osu.Game.Skinning; | ||
|
||
namespace osu.Game.Screens.Play | ||
{ | ||
public partial class ArgonPerformancePointsCounter : GameplayPerformancePointsCounter, ISerialisableDrawable | ||
{ | ||
public bool UsesFixedAnchor { get; set; } | ||
|
||
[BackgroundDependencyLoader] | ||
private void load() | ||
{ | ||
} | ||
|
||
protected override IHasText CreateText() => new TextComponent(); | ||
|
||
private partial class TextComponent : CompositeDrawable, IHasText | ||
{ | ||
private readonly OsuSpriteText text; | ||
|
||
public LocalisableString Text | ||
{ | ||
get => text.Text; | ||
set => text.Text = value; | ||
} | ||
|
||
public TextComponent() | ||
{ | ||
AutoSizeAxes = Axes.Both; | ||
|
||
InternalChild = new FillFlowContainer | ||
{ | ||
Direction = FillDirection.Vertical, | ||
Children = new[] | ||
{ | ||
new OsuSpriteText | ||
{ | ||
Text = BeatmapsetsStrings.ShowScoreboardHeaderspp.ToUpper(), | ||
Font = OsuFont.Torus.With(size: 12, weight: FontWeight.Bold), | ||
}, | ||
text = new OsuSpriteText | ||
{ | ||
Font = OsuFont.Torus.With(size: 16.8f, weight: FontWeight.Regular), | ||
} | ||
} | ||
}; | ||
} | ||
} | ||
} | ||
} |