File tree Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Expand file tree Collapse file tree 2 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -219,21 +219,35 @@ protected override bool OnClick(ClickEvent e)
219
219
}
220
220
}
221
221
222
- public partial class DependencyBorrowingContainer : Container
222
+ private partial class DependencyBorrowingContainer : Container
223
223
{
224
224
protected override bool ShouldBeConsideredForInput ( Drawable child ) => false ;
225
225
226
226
public override bool PropagateNonPositionalInputSubTree => false ;
227
227
228
228
private readonly CompositeDrawable ? donor ;
229
229
230
+ [ Resolved ]
231
+ private SkinEditor skinEditor { get ; set ; } = null ! ;
232
+
230
233
public DependencyBorrowingContainer ( CompositeDrawable ? donor )
231
234
{
232
235
this . donor = donor ;
233
236
}
234
237
235
- protected override IReadOnlyDependencyContainer CreateChildDependencies ( IReadOnlyDependencyContainer parent ) =>
236
- new DependencyContainer ( donor ? . Dependencies ?? base . CreateChildDependencies ( parent ) ) ;
238
+ protected override IReadOnlyDependencyContainer CreateChildDependencies ( IReadOnlyDependencyContainer parent )
239
+ {
240
+ var baseDependencies = base . CreateChildDependencies ( parent ) ;
241
+ if ( donor == null )
242
+ return baseDependencies ;
243
+
244
+ var dependencies = new DependencyContainer ( donor . Dependencies ) ;
245
+ // inject `SkinEditor` again *on top* of the borrowed dependencies.
246
+ // this is designed to let components know when they are being displayed in the context of the skin editor
247
+ // via attempting to resolve `SkinEditor`.
248
+ dependencies . CacheAs ( baseDependencies . Get < SkinEditor > ( ) ) ;
249
+ return dependencies ;
250
+ }
237
251
}
238
252
}
239
253
}
Original file line number Diff line number Diff line change 8
8
using osu . Game . Audio ;
9
9
using osu . Game . Configuration ;
10
10
using osu . Game . Online . Leaderboards ;
11
+ using osu . Game . Overlays . SkinEditor ;
11
12
using osu . Game . Rulesets . Scoring ;
12
13
using osu . Game . Scoring ;
13
14
using osu . Game . Skinning ;
@@ -39,7 +40,7 @@ public DefaultRankDisplay()
39
40
}
40
41
41
42
[ BackgroundDependencyLoader ]
42
- private void load ( )
43
+ private void load ( SkinEditor ? skinEditor )
43
44
{
44
45
InternalChildren = new Drawable [ ]
45
46
{
@@ -50,6 +51,9 @@ private void load()
50
51
RelativeSizeAxes = Axes . Both
51
52
} ,
52
53
} ;
54
+
55
+ if ( skinEditor != null )
56
+ PlaySamples . Value = false ;
53
57
}
54
58
55
59
protected override void LoadComplete ( )
You can’t perform that action at this time.
0 commit comments