88using osu . Framework . Bindables ;
99using osu . Framework . Graphics ;
1010using osu . Framework . Graphics . Containers ;
11+ using osu . Framework . Graphics . Shapes ;
1112using osu . Framework . Graphics . Sprites ;
1213using osu . Framework . Localisation ;
1314using osu . Game . Beatmaps ;
1920using osu . Game . Rulesets . Mods ;
2021using osu . Game . Screens . Play . HUD ;
2122using osuTK ;
23+ using osuTK . Graphics ;
2224using CommonStrings = osu . Game . Localisation . CommonStrings ;
2325
2426namespace osu . Game . Screens . Play
@@ -32,6 +34,7 @@ public partial class BeatmapMetadataDisplay : Container
3234 private readonly Bindable < IReadOnlyList < Mod > > mods ;
3335 private readonly Drawable logoFacade ;
3436 private LoadingSpinner loading ;
37+ private Drawable blockingLoadLayer ;
3538
3639 public IBindable < IReadOnlyList < Mod > > Mods => mods ;
3740
@@ -46,6 +49,30 @@ public bool Loading
4649 }
4750 }
4851
52+ private bool userBlocked ;
53+
54+ public bool UserBlocked
55+ {
56+ set
57+ {
58+ if ( value == userBlocked )
59+ return ;
60+
61+ userBlocked = value ;
62+
63+ if ( userBlocked )
64+ {
65+ blockingLoadLayer
66+ . FadeIn ( 300 , Easing . Out )
67+ . Then ( )
68+ . FadeTo ( 0.5f , 1000 , Easing . In )
69+ . Loop ( ) ;
70+ }
71+ else
72+ blockingLoadLayer . FadeOut ( 500 , Easing . OutQuint ) ;
73+ }
74+ }
75+
4976 public BeatmapMetadataDisplay ( IWorkingBeatmap beatmap , Bindable < IReadOnlyList < Mod > > mods , Drawable logoFacade )
5077 {
5178 this . beatmap = beatmap ;
@@ -61,7 +88,7 @@ public BeatmapMetadataDisplay(IWorkingBeatmap beatmap, Bindable<IReadOnlyList<Mo
6188 private StarRatingDisplay starRatingDisplay ;
6289
6390 [ BackgroundDependencyLoader ]
64- private void load ( BeatmapDifficultyCache difficultyCache )
91+ private void load ( BeatmapDifficultyCache difficultyCache , OsuColour colours )
6592 {
6693 var metadata = beatmap . BeatmapInfo . Metadata ;
6794
@@ -117,7 +144,28 @@ private void load(BeatmapDifficultyCache difficultyCache)
117144 loading = new LoadingLayer ( dimBackground : true )
118145 {
119146 BlockPositionalInput = false ,
120- }
147+ } ,
148+ blockingLoadLayer = new Container
149+ {
150+ RelativeSizeAxes = Axes . Both ,
151+ Alpha = 0 ,
152+ Children = new Drawable [ ]
153+ {
154+ new Box
155+ {
156+ Colour = colours . PinkDarker ,
157+ Alpha = 0.5f ,
158+ RelativeSizeAxes = Axes . Both ,
159+ } ,
160+ new OsuSpriteText
161+ {
162+ Anchor = Anchor . Centre ,
163+ Origin = Anchor . Centre ,
164+ Font = OsuFont . Style . Heading2 ,
165+ Text = "Loading paused.."
166+ }
167+ }
168+ } ,
121169 }
122170 } ,
123171 versionFlow = new FillFlowContainer
0 commit comments