diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneGameplayLeaderboard.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneGameplayLeaderboard.cs index 147df55393..1219522bfb 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneGameplayLeaderboard.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneGameplayLeaderboard.cs @@ -45,7 +45,7 @@ namespace osu.Game.Tests.Visual.Gameplay User = new APIUser { Username = "You", Id = 3 } }; - gameplayState = TestGameplayState.Create(new OsuRuleset(), null, new Score { ScoreInfo = localScore }); + gameplayState = TestGameplayState.Create(new OsuRuleset(), null, new Score { ScoreInfo = localScore }, new Bindable(LocalUserPlayingState.Playing)); } [BackgroundDependencyLoader] @@ -61,7 +61,7 @@ namespace osu.Game.Tests.Visual.Gameplay AddStep("toggle collapsed", () => { if (leaderboard.IsNotNull()) - ((BindableBool)leaderboard.Expanded).Value = !leaderboard.Expanded.Value; + leaderboard.CollapseDuringGameplay.Value = !leaderboard.CollapseDuringGameplay.Value; }); AddStep("toggle black background", () => blackBackground?.FadeTo(1 - blackBackground.Alpha, 300, Easing.OutQuint)); @@ -208,6 +208,7 @@ namespace osu.Game.Tests.Visual.Gameplay }, leaderboard = new DrawableGameplayLeaderboard { + CollapseDuringGameplay = { Value = false }, Anchor = Anchor.Centre, Origin = Anchor.Centre, } diff --git a/osu.Game/Screens/Play/HUD/DrawableGameplayLeaderboard.cs b/osu.Game/Screens/Play/HUD/DrawableGameplayLeaderboard.cs index 05ccba4561..fc37e4f712 100644 --- a/osu.Game/Screens/Play/HUD/DrawableGameplayLeaderboard.cs +++ b/osu.Game/Screens/Play/HUD/DrawableGameplayLeaderboard.cs @@ -33,11 +33,6 @@ namespace osu.Game.Screens.Play.HUD [SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.CollapseDuringGameplay), nameof(SkinnableComponentStrings.CollapseDuringGameplayDescription))] public Bindable CollapseDuringGameplay { get; } = new BindableBool(true); - /// - /// Whether the leaderboard is currently in expanded state. - /// - public IBindable Expanded => expanded; - private readonly Bindable expanded = new BindableBool(); [Resolved] diff --git a/osu.Game/Tests/Gameplay/TestGameplayState.cs b/osu.Game/Tests/Gameplay/TestGameplayState.cs index 8fad6d1e23..2f1439f129 100644 --- a/osu.Game/Tests/Gameplay/TestGameplayState.cs +++ b/osu.Game/Tests/Gameplay/TestGameplayState.cs @@ -2,6 +2,7 @@ // See the LICENCE file in the repository root for full licence text. using System.Collections.Generic; +using osu.Framework.Bindables; using osu.Game.Rulesets; using osu.Game.Rulesets.Mods; using osu.Game.Scoring; @@ -18,7 +19,7 @@ namespace osu.Game.Tests.Gameplay /// /// Creates a correctly-initialised instance for use in testing. /// - public static GameplayState Create(Ruleset ruleset, IReadOnlyList? mods = null, Score? score = null) + public static GameplayState Create(Ruleset ruleset, IReadOnlyList? mods = null, Score? score = null, IBindable? playState = null) { var beatmap = new TestBeatmap(ruleset.RulesetInfo); var workingBeatmap = new TestWorkingBeatmap(beatmap); @@ -29,7 +30,7 @@ namespace osu.Game.Tests.Gameplay var healthProcessor = ruleset.CreateHealthProcessor(beatmap.HitObjects[0].StartTime); - return new GameplayState(playableBeatmap, ruleset, mods, score, scoreProcessor, healthProcessor); + return new GameplayState(playableBeatmap, ruleset, mods, score, scoreProcessor, healthProcessor, localUserPlayingState: playState); } } }