File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed
Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -219,7 +219,7 @@ protected override bool OnClick(ClickEvent e)
219219 }
220220 }
221221
222- public partial class DependencyBorrowingContainer : Container
222+ private partial class DependencyBorrowingContainer : Container
223223 {
224224 protected override bool ShouldBeConsideredForInput ( Drawable child ) => false ;
225225
@@ -232,8 +232,19 @@ public DependencyBorrowingContainer(CompositeDrawable? donor)
232232 this . donor = donor ;
233233 }
234234
235- protected override IReadOnlyDependencyContainer CreateChildDependencies ( IReadOnlyDependencyContainer parent ) =>
236- new DependencyContainer ( donor ? . Dependencies ?? base . CreateChildDependencies ( parent ) ) ;
235+ protected override IReadOnlyDependencyContainer CreateChildDependencies ( IReadOnlyDependencyContainer parent )
236+ {
237+ var baseDependencies = base . CreateChildDependencies ( parent ) ;
238+ if ( donor == null )
239+ return baseDependencies ;
240+
241+ var dependencies = new DependencyContainer ( donor . Dependencies ) ;
242+ // inject `SkinEditor` again *on top* of the borrowed dependencies.
243+ // this is designed to let components know when they are being displayed in the context of the skin editor
244+ // via attempting to resolve `SkinEditor`.
245+ dependencies . CacheAs ( baseDependencies . Get < SkinEditor > ( ) ) ;
246+ return dependencies ;
247+ }
237248 }
238249 }
239250}
Original file line number Diff line number Diff line change 88using osu . Game . Audio ;
99using osu . Game . Configuration ;
1010using osu . Game . Online . Leaderboards ;
11+ using osu . Game . Overlays . SkinEditor ;
1112using osu . Game . Rulesets . Scoring ;
1213using osu . Game . Scoring ;
1314using osu . Game . Skinning ;
@@ -39,7 +40,7 @@ public DefaultRankDisplay()
3940 }
4041
4142 [ BackgroundDependencyLoader ]
42- private void load ( )
43+ private void load ( SkinEditor ? skinEditor )
4344 {
4445 InternalChildren = new Drawable [ ]
4546 {
@@ -50,6 +51,9 @@ private void load()
5051 RelativeSizeAxes = Axes . Both
5152 } ,
5253 } ;
54+
55+ if ( skinEditor != null )
56+ PlaySamples . Value = false ;
5357 }
5458
5559 protected override void LoadComplete ( )
You can’t perform that action at this time.
0 commit comments