1
0
mirror of https://github.com/ppy/osu.git synced 2026-06-03 03:20:16 +08:00

Prevent rank display shown in skin editor toolbox from playing samples

Closes https://github.com/ppy/osu/issues/33456.
This commit is contained in:
Bartłomiej Dach
2025-06-06 12:51:53 +02:00
Unverified
parent 6835d7659d
commit e02cd28df6
2 changed files with 19 additions and 4 deletions
@@ -219,7 +219,7 @@ namespace osu.Game.Overlays.SkinEditor
}
}
public partial class DependencyBorrowingContainer : Container
private partial class DependencyBorrowingContainer : Container
{
protected override bool ShouldBeConsideredForInput(Drawable child) => false;
@@ -232,8 +232,19 @@ namespace osu.Game.Overlays.SkinEditor
this.donor = donor;
}
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) =>
new DependencyContainer(donor?.Dependencies ?? base.CreateChildDependencies(parent));
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent)
{
var baseDependencies = base.CreateChildDependencies(parent);
if (donor == null)
return baseDependencies;
var dependencies = new DependencyContainer(donor.Dependencies);
// inject `SkinEditor` again *on top* of the borrowed dependencies.
// this is designed to let components know when they are being displayed in the context of the skin editor
// via attempting to resolve `SkinEditor`.
dependencies.CacheAs(baseDependencies.Get<SkinEditor>());
return dependencies;
}
}
}
}
@@ -8,6 +8,7 @@ using osu.Framework.Graphics.Containers;
using osu.Game.Audio;
using osu.Game.Configuration;
using osu.Game.Online.Leaderboards;
using osu.Game.Overlays.SkinEditor;
using osu.Game.Rulesets.Scoring;
using osu.Game.Scoring;
using osu.Game.Skinning;
@@ -39,7 +40,7 @@ namespace osu.Game.Screens.Play.HUD
}
[BackgroundDependencyLoader]
private void load()
private void load(SkinEditor? skinEditor)
{
InternalChildren = new Drawable[]
{
@@ -50,6 +51,9 @@ namespace osu.Game.Screens.Play.HUD
RelativeSizeAxes = Axes.Both
},
};
if (skinEditor != null)
PlaySamples.Value = false;
}
protected override void LoadComplete()