Rename `OverridesClosestAnchor` to `UsesFixedAnchor`

This commit is contained in:
Robin Avery 2021-06-08 08:22:35 -04:00
parent 65f594f860
commit dc50ae40b9
No known key found for this signature in database
GPG Key ID: 0496DF10CEF7E226
15 changed files with 22 additions and 22 deletions

View File

@ -59,7 +59,7 @@ public static void ApplySkinnableInfo(this Drawable component, SkinnableInfo inf
component.Origin = info.Origin;
if (component is ISkinnableDrawable skinnable)
skinnable.OverridesClosestAnchor = info.OverridesClosestAnchor;
skinnable.UsesFixedAnchor = info.UsesFixedAnchor;
if (component is Container container)
{

View File

@ -12,7 +12,7 @@ public class DefaultAccuracyCounter : GameplayAccuracyCounter, ISkinnableDrawabl
[Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; }
public bool OverridesClosestAnchor { get; set; }
public bool UsesFixedAnchor { get; set; }
[BackgroundDependencyLoader]
private void load(OsuColour colours)

View File

@ -17,7 +17,7 @@ public class DefaultComboCounter : RollingCounter<int>, ISkinnableDrawable
[Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; }
public bool OverridesClosestAnchor { get; set; }
public bool UsesFixedAnchor { get; set; }
public DefaultComboCounter()
{

View File

@ -72,7 +72,7 @@ public Color4 GlowColour
}
}
public bool OverridesClosestAnchor { get; set; }
public bool UsesFixedAnchor { get; set; }
public DefaultHealthDisplay()
{

View File

@ -20,7 +20,7 @@ public DefaultScoreCounter()
[Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; }
public bool OverridesClosestAnchor { get; set; }
public bool UsesFixedAnchor { get; set; }
[BackgroundDependencyLoader]
private void load(OsuColour colours)

View File

@ -22,7 +22,7 @@ public abstract class HitErrorMeter : CompositeDrawable, ISkinnableDrawable
[Resolved]
private OsuColour colours { get; set; }
public bool OverridesClosestAnchor { get; set; }
public bool UsesFixedAnchor { get; set; }
[BackgroundDependencyLoader(true)]
private void load(DrawableRuleset drawableRuleset)

View File

@ -59,7 +59,7 @@ public bool HiddenByRulesetImplementation
set => counterContainer.Alpha = value ? 1 : 0;
}
public bool OverridesClosestAnchor { get; set; }
public bool UsesFixedAnchor { get; set; }
public LegacyComboCounter()
{

View File

@ -32,8 +32,8 @@ public class SkinnableInfo : IJsonSerializable
public Anchor Origin { get; set; }
/// <inheritdoc cref="ISkinnableDrawable.OverridesClosestAnchor"/>
public bool OverridesClosestAnchor { get; set; }
/// <inheritdoc cref="ISkinnableDrawable.UsesFixedAnchor"/>
public bool UsesFixedAnchor { get; set; }
public List<SkinnableInfo> Children { get; } = new List<SkinnableInfo>();
@ -57,7 +57,7 @@ public SkinnableInfo(Drawable component)
Origin = component.Origin;
if (component is ISkinnableDrawable skinnable)
OverridesClosestAnchor = skinnable.OverridesClosestAnchor;
UsesFixedAnchor = skinnable.UsesFixedAnchor;
if (component is Container<Drawable> container)
{

View File

@ -78,7 +78,7 @@ public IEnumerable<HitObject> Objects
private IClock referenceClock;
public bool OverridesClosestAnchor { get; set; }
public bool UsesFixedAnchor { get; set; }
public SongProgress()
{

View File

@ -160,7 +160,7 @@ public override bool HandleMovement(MoveSelectionEvent<ISkinnableDrawable> moveE
private void updateDrawableAnchorIfUsingClosest(ISkinnableDrawable item)
{
if (item.OverridesClosestAnchor) return;
if (item.UsesFixedAnchor) return;
var drawable = (Drawable)item;
@ -188,12 +188,12 @@ protected override IEnumerable<MenuItem> GetContextMenuItemsForSelection(IEnumer
{
var closestItem = new TernaryStateRadioMenuItem("Closest", MenuItemType.Standard, _ => applyClosestAnchor())
{
State = { Value = GetStateFromSelection(selection, c => !c.Item.OverridesClosestAnchor) }
State = { Value = GetStateFromSelection(selection, c => !c.Item.UsesFixedAnchor) }
};
yield return new OsuMenuItem("Anchor")
{
Items = createAnchorItems((i, a) => i.OverridesClosestAnchor && ((Drawable)i).Anchor == a, applyCustomAnchor)
Items = createAnchorItems((i, a) => i.UsesFixedAnchor && ((Drawable)i).Anchor == a, applyCustomAnchor)
.Prepend(closestItem)
.ToArray()
};
@ -261,7 +261,7 @@ private void applyCustomAnchor(Anchor anchor)
{
var drawable = (Drawable)item;
item.OverridesClosestAnchor = true;
item.UsesFixedAnchor = true;
updateDrawableAnchor(drawable, anchor);
}
}
@ -272,7 +272,7 @@ private void applyClosestAnchor()
{
var drawable = (Drawable)item;
item.OverridesClosestAnchor = false;
item.UsesFixedAnchor = false;
updateDrawableAnchor(drawable, getClosestAnchorForDrawable(drawable));
}
}

View File

@ -17,8 +17,8 @@ public interface ISkinnableDrawable : IDrawable
/// <summary>
/// <see langword="false"/> if this <see cref="ISkinnableDrawable"/>'s <see cref="Drawable.Anchor"/> is automatically determined by proximity,
/// <see langword="true"/> if the user has overridden it.
/// <see langword="true"/> if the user has chosen a fixed anchor point.
/// </summary>
bool OverridesClosestAnchor { get; set; }
bool UsesFixedAnchor { get; set; }
}
}

View File

@ -12,7 +12,7 @@ namespace osu.Game.Skinning
{
public class LegacyAccuracyCounter : GameplayAccuracyCounter, ISkinnableDrawable
{
public bool OverridesClosestAnchor { get; set; }
public bool UsesFixedAnchor { get; set; }
public LegacyAccuracyCounter()
{

View File

@ -30,7 +30,7 @@ public class LegacyHealthDisplay : HealthDisplay, ISkinnableDrawable
private bool isNewStyle;
public bool OverridesClosestAnchor { get; set; }
public bool UsesFixedAnchor { get; set; }
[BackgroundDependencyLoader]
private void load()

View File

@ -13,7 +13,7 @@ public class LegacyScoreCounter : GameplayScoreCounter, ISkinnableDrawable
protected override double RollingDuration => 1000;
protected override Easing RollingEasing => Easing.Out;
public bool OverridesClosestAnchor { get; set; }
public bool UsesFixedAnchor { get; set; }
public LegacyScoreCounter()
: base(6)

View File

@ -17,7 +17,7 @@ public class SkinnableTargetComponentsContainer : Container, ISkinnableDrawable
{
public bool IsEditable => false;
public bool OverridesClosestAnchor { get; set; }
public bool UsesFixedAnchor { get; set; }
private readonly Action<Container> applyDefaults;