mirror of
https://github.com/ppy/osu
synced 2024-12-26 00:32:52 +00:00
Add UsingClosestAnchor to ISkinnableDrawable
Also implement it as an auto property in its inheritors. The auto properties default to true.
This commit is contained in:
parent
6a456e53f4
commit
ce635af83e
@ -12,6 +12,8 @@ namespace osu.Game.Screens.Play.HUD
|
||||
[Resolved(canBeNull: true)]
|
||||
private HUDOverlay hud { get; set; }
|
||||
|
||||
public bool UsingClosestAnchor { get; set; } = true;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
|
@ -17,6 +17,8 @@ namespace osu.Game.Screens.Play.HUD
|
||||
[Resolved(canBeNull: true)]
|
||||
private HUDOverlay hud { get; set; }
|
||||
|
||||
public bool UsingClosestAnchor { get; set; } = true;
|
||||
|
||||
public DefaultComboCounter()
|
||||
{
|
||||
Current.Value = DisplayedCount = 0;
|
||||
|
@ -72,6 +72,8 @@ namespace osu.Game.Screens.Play.HUD
|
||||
}
|
||||
}
|
||||
|
||||
public bool UsingClosestAnchor { get; set; } = true;
|
||||
|
||||
public DefaultHealthDisplay()
|
||||
{
|
||||
Size = new Vector2(1, 5);
|
||||
|
@ -20,6 +20,8 @@ namespace osu.Game.Screens.Play.HUD
|
||||
[Resolved(canBeNull: true)]
|
||||
private HUDOverlay hud { get; set; }
|
||||
|
||||
public bool UsingClosestAnchor { get; set; } = true;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
|
@ -22,6 +22,8 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
|
||||
[Resolved]
|
||||
private OsuColour colours { get; set; }
|
||||
|
||||
public bool UsingClosestAnchor { get; set; } = true;
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(DrawableRuleset drawableRuleset)
|
||||
{
|
||||
|
@ -59,6 +59,8 @@ namespace osu.Game.Screens.Play.HUD
|
||||
set => counterContainer.Alpha = value ? 1 : 0;
|
||||
}
|
||||
|
||||
public bool UsingClosestAnchor { get; set; } = true;
|
||||
|
||||
public LegacyComboCounter()
|
||||
{
|
||||
AutoSizeAxes = Axes.Both;
|
||||
|
@ -32,11 +32,7 @@ namespace osu.Game.Screens.Play.HUD
|
||||
|
||||
public Anchor Origin { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// <p><see langword="true"/> if this <see cref="ISkinnableDrawable"/>'s <see cref="Drawable.Anchor"/> is
|
||||
/// automatically determined by proximity, <see langword="false"/> if the user has overridden it.</p>
|
||||
/// <p>Corresponds to <see cref="osu.Game.Extensions.DrawableExtensions.UsingClosestAnchor"/> at runtime.</p>
|
||||
/// </summary>
|
||||
/// <inheritdoc cref="ISkinnableDrawable.UsingClosestAnchor"/>
|
||||
public bool UsingClosestAnchor { get; set; } = true;
|
||||
|
||||
public List<SkinnableInfo> Children { get; } = new List<SkinnableInfo>();
|
||||
|
@ -78,6 +78,8 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private IClock referenceClock;
|
||||
|
||||
public bool UsingClosestAnchor { get; set; } = true;
|
||||
|
||||
public SongProgress()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
|
@ -14,5 +14,11 @@ namespace osu.Game.Skinning
|
||||
/// Whether this component should be editable by an end user.
|
||||
/// </summary>
|
||||
bool IsEditable => true;
|
||||
|
||||
/// <summary>
|
||||
/// <see langword="true"/> if this <see cref="ISkinnableDrawable"/>'s <see cref="Drawable.Anchor"/> is automatically determined by proximity,
|
||||
/// <see langword="false"/> if the user has overridden it.
|
||||
/// </summary>
|
||||
bool UsingClosestAnchor { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
public class LegacyAccuracyCounter : GameplayAccuracyCounter, ISkinnableDrawable
|
||||
{
|
||||
public bool UsingClosestAnchor { get; set; } = true;
|
||||
|
||||
public LegacyAccuracyCounter()
|
||||
{
|
||||
Anchor = Anchor.TopRight;
|
||||
|
@ -30,6 +30,8 @@ namespace osu.Game.Skinning
|
||||
|
||||
private bool isNewStyle;
|
||||
|
||||
public bool UsingClosestAnchor { get; set; } = true;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
|
@ -13,6 +13,8 @@ namespace osu.Game.Skinning
|
||||
protected override double RollingDuration => 1000;
|
||||
protected override Easing RollingEasing => Easing.Out;
|
||||
|
||||
public bool UsingClosestAnchor { get; set; } = true;
|
||||
|
||||
public LegacyScoreCounter()
|
||||
: base(6)
|
||||
{
|
||||
|
@ -17,6 +17,8 @@ namespace osu.Game.Skinning
|
||||
{
|
||||
public bool IsEditable => false;
|
||||
|
||||
public bool UsingClosestAnchor { get; set; } = true;
|
||||
|
||||
private readonly Action<Container> applyDefaults;
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
Reference in New Issue
Block a user