mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 11:12:54 +08:00
feat: make KeyCounterDisplay
skinnable
This commit is contained in:
parent
c637fddf73
commit
e26aeea589
@ -8,13 +8,14 @@ using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Configuration;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Skinning;
|
||||
|
||||
namespace osu.Game.Screens.Play.HUD
|
||||
{
|
||||
/// <summary>
|
||||
/// A flowing display of all gameplay keys. Individual keys can be added using <see cref="InputTrigger"/> implementations.
|
||||
/// </summary>
|
||||
public abstract partial class KeyCounterDisplay : CompositeDrawable, IAttachableSkinComponent
|
||||
public abstract partial class KeyCounterDisplay : CompositeDrawable, IAttachableSkinComponent, ISerialisableDrawable
|
||||
{
|
||||
/// <summary>
|
||||
/// Whether the key counter should be visible regardless of the configuration value.
|
||||
@ -78,5 +79,7 @@ namespace osu.Game.Screens.Play.HUD
|
||||
base.Dispose(isDisposing);
|
||||
controller.OnNewTrigger -= Add;
|
||||
}
|
||||
|
||||
public bool UsesFixedAnchor { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,7 @@ using osu.Game.Audio;
|
||||
using osu.Game.Beatmaps.Formats;
|
||||
using osu.Game.Extensions;
|
||||
using osu.Game.IO;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Screens.Play.HUD.HitErrorMeters;
|
||||
using osuTK;
|
||||
@ -113,6 +114,7 @@ namespace osu.Game.Skinning
|
||||
var combo = container.OfType<DefaultComboCounter>().FirstOrDefault();
|
||||
var ppCounter = container.OfType<PerformancePointsCounter>().FirstOrDefault();
|
||||
var songProgress = container.OfType<ArgonSongProgress>().FirstOrDefault();
|
||||
var keyCounter = container.OfType<ArgonKeyCounterDisplay>().FirstOrDefault();
|
||||
|
||||
if (score != null)
|
||||
{
|
||||
@ -168,6 +170,13 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
songProgress.Position = new Vector2(0, -10);
|
||||
songProgress.Scale = new Vector2(0.9f, 1);
|
||||
|
||||
if (keyCounter != null)
|
||||
{
|
||||
keyCounter.Anchor = Anchor.BottomLeft;
|
||||
keyCounter.Origin = Anchor.BottomLeft;
|
||||
keyCounter.Position = new Vector2(50, -57);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -179,6 +188,7 @@ namespace osu.Game.Skinning
|
||||
new DefaultAccuracyCounter(),
|
||||
new DefaultHealthDisplay(),
|
||||
new ArgonSongProgress(),
|
||||
new ArgonKeyCounterDisplay(),
|
||||
new BarHitErrorMeter(),
|
||||
new BarHitErrorMeter(),
|
||||
new PerformancePointsCounter()
|
||||
|
@ -90,6 +90,8 @@ namespace osu.Game.Skinning
|
||||
var accuracy = container.OfType<DefaultAccuracyCounter>().FirstOrDefault();
|
||||
var combo = container.OfType<DefaultComboCounter>().FirstOrDefault();
|
||||
var ppCounter = container.OfType<PerformancePointsCounter>().FirstOrDefault();
|
||||
var songProgress = container.OfType<DefaultSongProgress>().FirstOrDefault();
|
||||
var keyCounter = container.OfType<DefaultKeyCounterDisplay>().FirstOrDefault();
|
||||
|
||||
if (score != null)
|
||||
{
|
||||
@ -141,6 +143,13 @@ namespace osu.Game.Skinning
|
||||
hitError2.Origin = Anchor.CentreLeft;
|
||||
}
|
||||
}
|
||||
|
||||
if (songProgress != null && keyCounter != null)
|
||||
{
|
||||
keyCounter.Anchor = Anchor.BottomRight;
|
||||
keyCounter.Origin = Anchor.BottomRight;
|
||||
keyCounter.Position = new Vector2(10, songProgress.Height + 10);
|
||||
}
|
||||
})
|
||||
{
|
||||
Children = new Drawable[]
|
||||
@ -150,6 +159,7 @@ namespace osu.Game.Skinning
|
||||
new DefaultAccuracyCounter(),
|
||||
new DefaultHealthDisplay(),
|
||||
new DefaultSongProgress(),
|
||||
new DefaultKeyCounterDisplay(),
|
||||
new BarHitErrorMeter(),
|
||||
new BarHitErrorMeter(),
|
||||
new PerformancePointsCounter()
|
||||
|
Loading…
Reference in New Issue
Block a user