mirror of
https://github.com/ppy/osu.git
synced 2026-05-20 16:41:43 +08:00
Remove bindable added only for tests
This commit is contained in:
@@ -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>(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,
|
||||
}
|
||||
|
||||
@@ -33,11 +33,6 @@ namespace osu.Game.Screens.Play.HUD
|
||||
[SettingSource(typeof(SkinnableComponentStrings), nameof(SkinnableComponentStrings.CollapseDuringGameplay), nameof(SkinnableComponentStrings.CollapseDuringGameplayDescription))]
|
||||
public Bindable<bool> CollapseDuringGameplay { get; } = new BindableBool(true);
|
||||
|
||||
/// <summary>
|
||||
/// Whether the leaderboard is currently in expanded state.
|
||||
/// </summary>
|
||||
public IBindable<bool> Expanded => expanded;
|
||||
|
||||
private readonly Bindable<bool> expanded = new BindableBool();
|
||||
|
||||
[Resolved]
|
||||
|
||||
@@ -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
|
||||
/// <summary>
|
||||
/// Creates a correctly-initialised <see cref="GameplayState"/> instance for use in testing.
|
||||
/// </summary>
|
||||
public static GameplayState Create(Ruleset ruleset, IReadOnlyList<Mod>? mods = null, Score? score = null)
|
||||
public static GameplayState Create(Ruleset ruleset, IReadOnlyList<Mod>? mods = null, Score? score = null, IBindable<LocalUserPlayingState>? 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user