mirror of
https://github.com/osukey/osukey.git
synced 2025-07-03 01:09:57 +09:00
Fix ReplayLoader not being treated as having a replay loaded
Player checks for HasReplayLoaded in Player.load(), but the replay is attached in ReplayPlayer.LoadComplete(), which is too late.
This commit is contained in:
@ -9,9 +9,12 @@ using System.Collections.Generic;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using System.Linq;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.Objects.Types;
|
||||
using osu.Game.Rulesets.UI;
|
||||
|
||||
namespace osu.Game.Screens.Play
|
||||
{
|
||||
public class SongProgress : OverlayContainer
|
||||
@ -53,6 +56,8 @@ namespace osu.Game.Screens.Play
|
||||
}
|
||||
}
|
||||
|
||||
private readonly BindableBool replayLoaded = new BindableBool();
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
@ -92,6 +97,8 @@ namespace osu.Game.Screens.Play
|
||||
OnSeek = position => OnSeek?.Invoke(position),
|
||||
},
|
||||
};
|
||||
|
||||
replayLoaded.ValueChanged += v => AllowSeeking = v;
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -99,6 +106,12 @@ namespace osu.Game.Screens.Play
|
||||
State = Visibility.Visible;
|
||||
}
|
||||
|
||||
public void BindRulestContainer(RulesetContainer rulesetContainer)
|
||||
{
|
||||
replayLoaded.BindTo(rulesetContainer.HasReplayLoaded);
|
||||
replayLoaded.TriggerChange();
|
||||
}
|
||||
|
||||
private bool allowSeeking;
|
||||
|
||||
public bool AllowSeeking
|
||||
|
Reference in New Issue
Block a user