diff --git a/osu.Game/Extensions/DrawableExtensions.cs b/osu.Game/Extensions/DrawableExtensions.cs
index 2ac6e6ff22..52d8230fb6 100644
--- a/osu.Game/Extensions/DrawableExtensions.cs
+++ b/osu.Game/Extensions/DrawableExtensions.cs
@@ -7,6 +7,7 @@ using osu.Framework.Graphics.Containers;
using osu.Framework.Input.Bindings;
using osu.Framework.Threading;
using osu.Game.Screens.Play.HUD;
+using osu.Game.Skinning;
using osuTK;
namespace osu.Game.Extensions
@@ -57,6 +58,9 @@ namespace osu.Game.Extensions
component.Anchor = info.Anchor;
component.Origin = info.Origin;
+ if (component is ISkinnableDrawable skinnable)
+ skinnable.UsesFixedAnchor = info.UsesFixedAnchor;
+
if (component is Container container)
{
foreach (var child in info.Children)
diff --git a/osu.Game/Screens/Play/HUD/DefaultAccuracyCounter.cs b/osu.Game/Screens/Play/HUD/DefaultAccuracyCounter.cs
index 45ba05e036..324e5d43b5 100644
--- a/osu.Game/Screens/Play/HUD/DefaultAccuracyCounter.cs
+++ b/osu.Game/Screens/Play/HUD/DefaultAccuracyCounter.cs
@@ -12,6 +12,8 @@ namespace osu.Game.Screens.Play.HUD
[Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; }
+ public bool UsesFixedAnchor { get; set; }
+
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
diff --git a/osu.Game/Screens/Play/HUD/DefaultComboCounter.cs b/osu.Game/Screens/Play/HUD/DefaultComboCounter.cs
index c4575c5ad0..718ae24cf1 100644
--- a/osu.Game/Screens/Play/HUD/DefaultComboCounter.cs
+++ b/osu.Game/Screens/Play/HUD/DefaultComboCounter.cs
@@ -17,6 +17,8 @@ namespace osu.Game.Screens.Play.HUD
[Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; }
+ public bool UsesFixedAnchor { get; set; }
+
public DefaultComboCounter()
{
Current.Value = DisplayedCount = 0;
diff --git a/osu.Game/Screens/Play/HUD/DefaultHealthDisplay.cs b/osu.Game/Screens/Play/HUD/DefaultHealthDisplay.cs
index ed297f0ffc..4f93868a66 100644
--- a/osu.Game/Screens/Play/HUD/DefaultHealthDisplay.cs
+++ b/osu.Game/Screens/Play/HUD/DefaultHealthDisplay.cs
@@ -72,6 +72,8 @@ namespace osu.Game.Screens.Play.HUD
}
}
+ public bool UsesFixedAnchor { get; set; }
+
public DefaultHealthDisplay()
{
Size = new Vector2(1, 5);
diff --git a/osu.Game/Screens/Play/HUD/DefaultScoreCounter.cs b/osu.Game/Screens/Play/HUD/DefaultScoreCounter.cs
index 16e3642181..63de5c8de5 100644
--- a/osu.Game/Screens/Play/HUD/DefaultScoreCounter.cs
+++ b/osu.Game/Screens/Play/HUD/DefaultScoreCounter.cs
@@ -20,6 +20,8 @@ namespace osu.Game.Screens.Play.HUD
[Resolved(canBeNull: true)]
private HUDOverlay hud { get; set; }
+ public bool UsesFixedAnchor { get; set; }
+
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
diff --git a/osu.Game/Screens/Play/HUD/HitErrorMeters/HitErrorMeter.cs b/osu.Game/Screens/Play/HUD/HitErrorMeters/HitErrorMeter.cs
index 9844b9f10d..788ba5be8c 100644
--- a/osu.Game/Screens/Play/HUD/HitErrorMeters/HitErrorMeter.cs
+++ b/osu.Game/Screens/Play/HUD/HitErrorMeters/HitErrorMeter.cs
@@ -22,6 +22,8 @@ namespace osu.Game.Screens.Play.HUD.HitErrorMeters
[Resolved]
private OsuColour colours { get; set; }
+ public bool UsesFixedAnchor { get; set; }
+
[BackgroundDependencyLoader(true)]
private void load(DrawableRuleset drawableRuleset)
{
diff --git a/osu.Game/Screens/Play/HUD/LegacyComboCounter.cs b/osu.Game/Screens/Play/HUD/LegacyComboCounter.cs
index 1737634e31..acff949353 100644
--- a/osu.Game/Screens/Play/HUD/LegacyComboCounter.cs
+++ b/osu.Game/Screens/Play/HUD/LegacyComboCounter.cs
@@ -59,6 +59,8 @@ namespace osu.Game.Screens.Play.HUD
set => counterContainer.Alpha = value ? 1 : 0;
}
+ public bool UsesFixedAnchor { get; set; }
+
public LegacyComboCounter()
{
AutoSizeAxes = Axes.Both;
diff --git a/osu.Game/Screens/Play/HUD/SkinnableInfo.cs b/osu.Game/Screens/Play/HUD/SkinnableInfo.cs
index e08044b14c..b64e5ca98f 100644
--- a/osu.Game/Screens/Play/HUD/SkinnableInfo.cs
+++ b/osu.Game/Screens/Play/HUD/SkinnableInfo.cs
@@ -32,6 +32,9 @@ namespace osu.Game.Screens.Play.HUD
public Anchor Origin { get; set; }
+ ///
+ public bool UsesFixedAnchor { get; set; }
+
public List Children { get; } = new List();
[JsonConstructor]
@@ -53,6 +56,9 @@ namespace osu.Game.Screens.Play.HUD
Anchor = component.Anchor;
Origin = component.Origin;
+ if (component is ISkinnableDrawable skinnable)
+ UsesFixedAnchor = skinnable.UsesFixedAnchor;
+
if (component is Container container)
{
foreach (var child in container.OfType().OfType())
diff --git a/osu.Game/Screens/Play/SongProgress.cs b/osu.Game/Screens/Play/SongProgress.cs
index cab44c7473..bd861dc598 100644
--- a/osu.Game/Screens/Play/SongProgress.cs
+++ b/osu.Game/Screens/Play/SongProgress.cs
@@ -78,6 +78,8 @@ namespace osu.Game.Screens.Play
private IClock referenceClock;
+ public bool UsesFixedAnchor { get; set; }
+
public SongProgress()
{
RelativeSizeAxes = Axes.X;
diff --git a/osu.Game/Skinning/Editor/SkinSelectionHandler.cs b/osu.Game/Skinning/Editor/SkinSelectionHandler.cs
index 9cca0ba2c7..23f36ffe5b 100644
--- a/osu.Game/Skinning/Editor/SkinSelectionHandler.cs
+++ b/osu.Game/Skinning/Editor/SkinSelectionHandler.cs
@@ -149,13 +149,21 @@ namespace osu.Game.Skinning.Editor
{
foreach (var c in SelectedBlueprints)
{
- Drawable drawable = (Drawable)c.Item;
+ var item = c.Item;
+ Drawable drawable = (Drawable)item;
+
drawable.Position += drawable.ScreenSpaceDeltaToParentSpace(moveEvent.ScreenSpaceDelta);
+
+ if (item.UsesFixedAnchor) continue;
+
+ applyClosestAnchor(drawable);
}
return true;
}
+ private static void applyClosestAnchor(Drawable drawable) => applyAnchor(drawable, getClosestAnchor(drawable));
+
protected override void OnSelectionChanged()
{
base.OnSelectionChanged();
@@ -171,20 +179,27 @@ namespace osu.Game.Skinning.Editor
protected override IEnumerable