mirror of
https://github.com/ppy/osu.git
synced 2026-05-25 09:50:13 +08:00
Remove HoldForMenuButton player dependency
This commit is contained in:
@@ -270,7 +270,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
AddStep("create overlay", () =>
|
||||
{
|
||||
hudOverlay = new HUDOverlay(null, Array.Empty<Mod>());
|
||||
hudOverlay = new HUDOverlay(null, Array.Empty<Mod>(), new PlayerConfiguration());
|
||||
|
||||
// Add any key just to display the key counter visually.
|
||||
hudOverlay.InputCountController.Add(new KeyCounterKeyboardTrigger(Key.Space));
|
||||
|
||||
@@ -119,7 +119,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
Children = new Drawable[]
|
||||
{
|
||||
drawableRuleset,
|
||||
new HUDOverlay(drawableRuleset, [])
|
||||
new HUDOverlay(drawableRuleset, [], new PlayerConfiguration())
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
var drawableRuleset = ruleset.CreateDrawableRulesetWith(beatmap, mods);
|
||||
|
||||
var hudOverlay = new HUDOverlay(drawableRuleset, mods)
|
||||
var hudOverlay = new HUDOverlay(drawableRuleset, mods, new PlayerConfiguration())
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
SetContents(_ =>
|
||||
{
|
||||
hudOverlay = new HUDOverlay(new DrawableOsuRuleset(new OsuRuleset(), new OsuBeatmap()), Array.Empty<Mod>());
|
||||
hudOverlay = new HUDOverlay(new DrawableOsuRuleset(new OsuRuleset(), new OsuBeatmap()), Array.Empty<Mod>(), new PlayerConfiguration());
|
||||
|
||||
action?.Invoke(hudOverlay);
|
||||
|
||||
|
||||
@@ -57,8 +57,8 @@ namespace osu.Game.Screens.Play.HUD
|
||||
AlwaysPresent = true;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(Player player, OsuConfigManager config)
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuConfigManager config)
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
@@ -68,7 +68,7 @@ namespace osu.Game.Screens.Play.HUD
|
||||
Anchor = Anchor.CentreLeft,
|
||||
Origin = Anchor.CentreLeft
|
||||
},
|
||||
button = new HoldButton(isDangerousAction || player?.Configuration.AllowRestart == false)
|
||||
button = new HoldButton(isDangerousAction)
|
||||
{
|
||||
HoverGained = () => text.FadeIn(500, Easing.OutQuint),
|
||||
HoverLost = () => text.FadeOut(500, Easing.OutQuint),
|
||||
|
||||
@@ -73,6 +73,7 @@ namespace osu.Game.Screens.Play
|
||||
private readonly DrawableRuleset drawableRuleset;
|
||||
|
||||
private readonly IReadOnlyList<Mod> mods;
|
||||
private readonly PlayerConfiguration configuration;
|
||||
|
||||
/// <summary>
|
||||
/// Whether the elements that can optionally be hidden should be visible.
|
||||
@@ -113,12 +114,13 @@ namespace osu.Game.Screens.Play
|
||||
/// </summary>
|
||||
internal readonly Drawable PlayfieldSkinLayer;
|
||||
|
||||
public HUDOverlay([CanBeNull] DrawableRuleset drawableRuleset, IReadOnlyList<Mod> mods)
|
||||
public HUDOverlay([CanBeNull] DrawableRuleset drawableRuleset, IReadOnlyList<Mod> mods, PlayerConfiguration configuration)
|
||||
{
|
||||
Container rightSettings;
|
||||
|
||||
this.drawableRuleset = drawableRuleset;
|
||||
this.mods = mods;
|
||||
this.configuration = configuration;
|
||||
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
|
||||
@@ -391,7 +393,7 @@ namespace osu.Game.Screens.Play
|
||||
ShowHealth = { BindTarget = ShowHealthBar }
|
||||
};
|
||||
|
||||
protected HoldForMenuButton CreateHoldForMenuButton() => new HoldForMenuButton
|
||||
protected HoldForMenuButton CreateHoldForMenuButton() => new HoldForMenuButton(!configuration.AllowRestart)
|
||||
{
|
||||
Anchor = Anchor.BottomRight,
|
||||
Origin = Anchor.BottomRight,
|
||||
|
||||
@@ -474,7 +474,7 @@ namespace osu.Game.Screens.Play
|
||||
Children = new[]
|
||||
{
|
||||
DimmableStoryboard.OverlayLayerContainer.CreateProxy(),
|
||||
HUDOverlay = new HUDOverlay(DrawableRuleset, GameplayState.Mods)
|
||||
HUDOverlay = new HUDOverlay(DrawableRuleset, GameplayState.Mods, Configuration)
|
||||
{
|
||||
HoldToQuit =
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user