1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 23:03:02 +08:00

Rename UsingClosestAnchor

It is now "OverridesClosestAnchor". The logic is inverted accordingly.
This commit is contained in:
Robin Avery 2021-06-07 00:14:36 -04:00
parent f28916e30f
commit 133d72a8c0
No known key found for this signature in database
GPG Key ID: 0496DF10CEF7E226
15 changed files with 26 additions and 28 deletions

View File

@ -59,7 +59,7 @@ namespace osu.Game.Extensions
component.Origin = info.Origin; component.Origin = info.Origin;
if (component is ISkinnableDrawable skinnable) if (component is ISkinnableDrawable skinnable)
skinnable.UsingClosestAnchor = info.UsingClosestAnchor; skinnable.OverridesClosestAnchor = info.OverridesClosestAnchor;
if (component is Container container) if (component is Container container)
{ {

View File

@ -12,7 +12,7 @@ namespace osu.Game.Screens.Play.HUD
[Resolved(canBeNull: true)] [Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; } private HUDOverlay hud { get; set; }
public bool UsingClosestAnchor { get; set; } = true; public bool OverridesClosestAnchor { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)

View File

@ -17,7 +17,7 @@ namespace osu.Game.Screens.Play.HUD
[Resolved(canBeNull: true)] [Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; } private HUDOverlay hud { get; set; }
public bool UsingClosestAnchor { get; set; } = true; public bool OverridesClosestAnchor { get; set; }
public DefaultComboCounter() public DefaultComboCounter()
{ {

View File

@ -72,7 +72,7 @@ namespace osu.Game.Screens.Play.HUD
} }
} }
public bool UsingClosestAnchor { get; set; } = true; public bool OverridesClosestAnchor { get; set; }
public DefaultHealthDisplay() public DefaultHealthDisplay()
{ {

View File

@ -20,7 +20,7 @@ namespace osu.Game.Screens.Play.HUD
[Resolved(canBeNull: true)] [Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; } private HUDOverlay hud { get; set; }
public bool UsingClosestAnchor { get; set; } = true; public bool OverridesClosestAnchor { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)

View File

@ -22,7 +22,7 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
[Resolved] [Resolved]
private OsuColour colours { get; set; } private OsuColour colours { get; set; }
public bool UsingClosestAnchor { get; set; } = true; public bool OverridesClosestAnchor { get; set; }
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load(DrawableRuleset drawableRuleset) private void load(DrawableRuleset drawableRuleset)

View File

@ -59,7 +59,7 @@ namespace osu.Game.Screens.Play.HUD
set => counterContainer.Alpha = value ? 1 : 0; set => counterContainer.Alpha = value ? 1 : 0;
} }
public bool UsingClosestAnchor { get; set; } = true; public bool OverridesClosestAnchor { get; set; }
public LegacyComboCounter() public LegacyComboCounter()
{ {

View File

@ -32,8 +32,8 @@ namespace osu.Game.Screens.Play.HUD
public Anchor Origin { get; set; } public Anchor Origin { get; set; }
/// <inheritdoc cref="ISkinnableDrawable.UsingClosestAnchor"/> /// <inheritdoc cref="ISkinnableDrawable.OverridesClosestAnchor"/>
public bool UsingClosestAnchor { get; set; } = true; public bool OverridesClosestAnchor { get; set; }
public List<SkinnableInfo> Children { get; } = new List<SkinnableInfo>(); public List<SkinnableInfo> Children { get; } = new List<SkinnableInfo>();
@ -56,9 +56,7 @@ namespace osu.Game.Screens.Play.HUD
Anchor = component.Anchor; Anchor = component.Anchor;
Origin = component.Origin; Origin = component.Origin;
UsingClosestAnchor = OverridesClosestAnchor = component is ISkinnableDrawable { OverridesClosestAnchor: true };
// true if it's not an ISkinnableDrawable
!(component is ISkinnableDrawable skinnable) || skinnable.UsingClosestAnchor;
if (component is Container<Drawable> container) if (component is Container<Drawable> container)
{ {

View File

@ -78,7 +78,7 @@ namespace osu.Game.Screens.Play
private IClock referenceClock; private IClock referenceClock;
public bool UsingClosestAnchor { get; set; } = true; public bool OverridesClosestAnchor { get; set; }
public SongProgress() public SongProgress()
{ {

View File

@ -241,7 +241,7 @@ namespace osu.Game.Skinning.Editor
private void updateDrawableAnchorIfUsingClosest(Drawable drawable) private void updateDrawableAnchorIfUsingClosest(Drawable drawable)
{ {
if (!(drawable is ISkinnableDrawable { UsingClosestAnchor: true })) return; if (drawable is ISkinnableDrawable { OverridesClosestAnchor: true }) return;
var closestAnchor = getClosestAnchorForDrawable(drawable); var closestAnchor = getClosestAnchorForDrawable(drawable);
@ -266,9 +266,9 @@ namespace osu.Game.Skinning.Editor
protected override IEnumerable<MenuItem> GetContextMenuItemsForSelection(IEnumerable<SelectionBlueprint<ISkinnableDrawable>> selection) protected override IEnumerable<MenuItem> GetContextMenuItemsForSelection(IEnumerable<SelectionBlueprint<ISkinnableDrawable>> selection)
{ {
static int checkAnchor(Drawable drawable) => static int checkAnchor(Drawable drawable) =>
drawable is ISkinnableDrawable { UsingClosestAnchor: true } drawable is ISkinnableDrawable { OverridesClosestAnchor: true }
? closest_text_hash ? (int)drawable.Anchor
: (int)drawable.Anchor; : closest_text_hash;
yield return new OsuMenuItem(nameof(Anchor)) yield return new OsuMenuItem(nameof(Anchor))
{ {
@ -331,12 +331,12 @@ namespace osu.Game.Skinning.Editor
{ {
var drawable = (Drawable)item; var drawable = (Drawable)item;
var (usingClosest, anchor) = var (overridesClosest, anchor) =
hash == closest_text_hash hash == closest_text_hash
? (true, getClosestAnchorForDrawable(drawable)) ? (false, getClosestAnchorForDrawable(drawable))
: (false, (Anchor)hash); : (true, (Anchor)hash);
item.UsingClosestAnchor = usingClosest; item.OverridesClosestAnchor = overridesClosest;
updateDrawableAnchor(drawable, anchor); updateDrawableAnchor(drawable, anchor);
} }
} }

View File

@ -16,9 +16,9 @@ namespace osu.Game.Skinning
bool IsEditable => true; bool IsEditable => true;
/// <summary> /// <summary>
/// <see langword="true"/> if this <see cref="ISkinnableDrawable"/>'s <see cref="Drawable.Anchor"/> is automatically determined by proximity, /// <see langword="false"/> if this <see cref="ISkinnableDrawable"/>'s <see cref="Drawable.Anchor"/> is automatically determined by proximity,
/// <see langword="false"/> if the user has overridden it. /// <see langword="true"/> if the user has overridden it.
/// </summary> /// </summary>
bool UsingClosestAnchor { get; set; } bool OverridesClosestAnchor { get; set; }
} }
} }

View File

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

View File

@ -30,7 +30,7 @@ namespace osu.Game.Skinning
private bool isNewStyle; private bool isNewStyle;
public bool UsingClosestAnchor { get; set; } = true; public bool OverridesClosestAnchor { get; set; }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()

View File

@ -13,7 +13,7 @@ namespace osu.Game.Skinning
protected override double RollingDuration => 1000; protected override double RollingDuration => 1000;
protected override Easing RollingEasing => Easing.Out; protected override Easing RollingEasing => Easing.Out;
public bool UsingClosestAnchor { get; set; } = true; public bool OverridesClosestAnchor { get; set; }
public LegacyScoreCounter() public LegacyScoreCounter()
: base(6) : base(6)

View File

@ -17,7 +17,7 @@ namespace osu.Game.Skinning
{ {
public bool IsEditable => false; public bool IsEditable => false;
public bool UsingClosestAnchor { get; set; } = true; public bool OverridesClosestAnchor { get; set; }
private readonly Action<Container> applyDefaults; private readonly Action<Container> applyDefaults;