mirror of
https://github.com/ppy/osu.git
synced 2025-01-18 10:53:21 +08:00
Bind to playing state via GameplayState
instead to fix more tests
This commit is contained in:
parent
1f1e940ada
commit
5c799d733f
@ -69,6 +69,11 @@ namespace osu.Game.Screens.Play
|
||||
|
||||
private readonly Bindable<JudgementResult> lastJudgementResult = new Bindable<JudgementResult>();
|
||||
|
||||
/// <summary>
|
||||
/// The local user's playing state (whether actively playing, paused, or not playing due to watching a replay or similar).
|
||||
/// </summary>
|
||||
public IBindable<LocalUserPlayingState> Playing { get; } = new Bindable<LocalUserPlayingState>();
|
||||
|
||||
public GameplayState(
|
||||
IBeatmap beatmap,
|
||||
Ruleset ruleset,
|
||||
@ -76,7 +81,8 @@ namespace osu.Game.Screens.Play
|
||||
Score? score = null,
|
||||
ScoreProcessor? scoreProcessor = null,
|
||||
HealthProcessor? healthProcessor = null,
|
||||
Storyboard? storyboard = null)
|
||||
Storyboard? storyboard = null,
|
||||
IBindable<LocalUserPlayingState>? localUserPlaying = null)
|
||||
{
|
||||
Beatmap = beatmap;
|
||||
Ruleset = ruleset;
|
||||
@ -92,6 +98,9 @@ namespace osu.Game.Screens.Play
|
||||
ScoreProcessor = scoreProcessor ?? ruleset.CreateScoreProcessor();
|
||||
HealthProcessor = healthProcessor ?? ruleset.CreateHealthProcessor(beatmap.HitObjects[0].StartTime);
|
||||
Storyboard = storyboard ?? new Storyboard();
|
||||
|
||||
if (localUserPlaying != null)
|
||||
Playing.BindTo(localUserPlaying);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -242,10 +242,10 @@ namespace osu.Game.Screens.Play.HUD
|
||||
public bool UsesFixedAnchor { get; set; }
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(SpectatorClient client, Player player)
|
||||
private void load(SpectatorClient client, GameplayState gameplayState)
|
||||
{
|
||||
((IBindableList<SpectatorUser>)Spectators).BindTo(client.WatchingUsers);
|
||||
((IBindable<LocalUserPlayingState>)UserPlayingState).BindTo(player.PlayingState);
|
||||
((IBindable<LocalUserPlayingState>)UserPlayingState).BindTo(gameplayState.Playing);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ namespace osu.Game.Screens.Play
|
||||
Score.ScoreInfo.Ruleset = ruleset.RulesetInfo;
|
||||
Score.ScoreInfo.Mods = gameplayMods;
|
||||
|
||||
dependencies.CacheAs(GameplayState = new GameplayState(playableBeatmap, ruleset, gameplayMods, Score, ScoreProcessor, HealthProcessor, Beatmap.Value.Storyboard));
|
||||
dependencies.CacheAs(GameplayState = new GameplayState(playableBeatmap, ruleset, gameplayMods, Score, ScoreProcessor, HealthProcessor, Beatmap.Value.Storyboard, PlayingState));
|
||||
|
||||
var rulesetSkinProvider = new RulesetSkinProvidingContainer(ruleset, playableBeatmap, Beatmap.Value.Skin);
|
||||
GameplayClockContainer.Add(new GameplayScrollWheelHandling());
|
||||
|
Loading…
Reference in New Issue
Block a user