mirror of https://github.com/ppy/osu
Move load procedure to async method and simplify code
This commit is contained in:
parent
ccbba8a00b
commit
42f64c2c44
|
@ -41,5 +41,7 @@ public PlayerSettingsOverlay()
|
|||
|
||||
protected override void PopIn() => this.FadeIn(fade_duration);
|
||||
protected override void PopOut() => this.FadeOut(fade_duration);
|
||||
|
||||
public void Insert(int i, PlayerSettingsGroup drawable) => content.Insert(i, drawable);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Bindables;
|
||||
using osu.Framework.Input.Bindings;
|
||||
using osu.Framework.Input.Events;
|
||||
|
@ -50,18 +51,19 @@ public ReplayPlayer(Func<IBeatmap, IReadOnlyList<Mod>, Score> createScore, Playe
|
|||
this.createScore = createScore;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
if (HUDOverlay != null)
|
||||
var playbackSettings = new PlaybackSettings
|
||||
{
|
||||
var playerSettingsOverlay = new PlaybackSettings { Expanded = { Value = false } };
|
||||
HUDOverlay.PlayerSettingsOverlay.Add(playerSettingsOverlay);
|
||||
Depth = float.MaxValue,
|
||||
Expanded = { Value = false }
|
||||
};
|
||||
|
||||
if (GameplayClockContainer is MasterGameplayClockContainer master)
|
||||
playerSettingsOverlay.UserPlaybackRate.BindTarget = master.UserPlaybackRate;
|
||||
}
|
||||
if (GameplayClockContainer is MasterGameplayClockContainer master)
|
||||
playbackSettings.UserPlaybackRate.BindTo(master.UserPlaybackRate);
|
||||
|
||||
HUDOverlay.PlayerSettingsOverlay.Insert(-1, playbackSettings);
|
||||
}
|
||||
|
||||
protected override void PrepareReplay()
|
||||
|
|
Loading…
Reference in New Issue