Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide player settings overlay in skin editor #31104

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions osu.Game.Tests/Visual/Gameplay/TestSceneSkinEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public partial class TestSceneSkinEditor : PlayerTestScene

protected override bool Autoplay => true;

protected override bool ShowSettingsOverlay => false;

[Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Blue);

Expand Down
1 change: 1 addition & 0 deletions osu.Game/Overlays/SkinEditor/SkinEditorOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ public EndlessPlayer(Func<IBeatmap, IReadOnlyList<Mod>, Score> createScore)
{
ShowResults = false,
AutomaticallySkipIntro = true,
ShowSettingsOverlay = false,
})
{
}
Expand Down
10 changes: 8 additions & 2 deletions osu.Game/Screens/Play/HUDOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ protected override bool ShouldBeConsideredForInput(Drawable child)

private readonly BindableBool replayLoaded = new BindableBool();

private readonly bool showSettingsOverlay;

private static bool hasShownNotificationOnce;

private readonly FillFlowContainer bottomRightElements;
Expand Down Expand Up @@ -113,12 +115,13 @@ protected override bool ShouldBeConsideredForInput(Drawable child)
/// </summary>
internal readonly Drawable PlayfieldSkinLayer;

public HUDOverlay([CanBeNull] DrawableRuleset drawableRuleset, IReadOnlyList<Mod> mods, bool alwaysShowLeaderboard = true)
public HUDOverlay([CanBeNull] DrawableRuleset drawableRuleset, IReadOnlyList<Mod> mods, bool alwaysShowLeaderboard = true, bool showSettingsOverlay = true)
{
Container rightSettings;

this.drawableRuleset = drawableRuleset;
this.mods = mods;
this.showSettingsOverlay = showSettingsOverlay;

RelativeSizeAxes = Axes.Both;

Expand Down Expand Up @@ -189,6 +192,9 @@ public HUDOverlay([CanBeNull] DrawableRuleset drawableRuleset, IReadOnlyList<Mod

if (!alwaysShowLeaderboard)
hideTargets.Add(LeaderboardFlow);

if (!showSettingsOverlay)
hideTargets.Add(rightSettings);
}

[BackgroundDependencyLoader(true)]
Expand Down Expand Up @@ -348,7 +354,7 @@ private void updateVisibility()
return;
}

if (configSettingsOverlay.Value && replayLoaded.Value)
if (configSettingsOverlay.Value && replayLoaded.Value && showSettingsOverlay)
PlayerSettingsOverlay.Show();
else
PlayerSettingsOverlay.Hide();
Expand Down
2 changes: 1 addition & 1 deletion osu.Game/Screens/Play/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ private Drawable createOverlayComponents(IWorkingBeatmap working)
Children = new[]
{
DimmableStoryboard.OverlayLayerContainer.CreateProxy(),
HUDOverlay = new HUDOverlay(DrawableRuleset, GameplayState.Mods, Configuration.AlwaysShowLeaderboard)
HUDOverlay = new HUDOverlay(DrawableRuleset, GameplayState.Mods, Configuration.AlwaysShowLeaderboard, Configuration.ShowSettingsOverlay)
{
HoldToQuit =
{
Expand Down
5 changes: 5 additions & 0 deletions osu.Game/Screens/Play/PlayerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,5 +45,10 @@ public class PlayerConfiguration
/// Whether the gameplay leaderboard should always be shown (usually in a contracted state).
/// </summary>
public bool AlwaysShowLeaderboard { get; set; }

/// <summary>
/// Whether the right overlay containing settings should be shown or not.
/// </summary>
public bool ShowSettingsOverlay { get; set; } = true;
}
}
4 changes: 3 additions & 1 deletion osu.Game/Tests/Visual/PlayerTestScene.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ protected void CreateTest([CanBeNull] Action action = null)

protected virtual bool Autoplay => false;

protected virtual bool ShowSettingsOverlay => true;

protected void LoadPlayer() => LoadPlayer(Array.Empty<Mod>());

protected void LoadPlayer(Mod[] mods)
Expand Down Expand Up @@ -136,6 +138,6 @@ protected override void Dispose(bool isDisposing)

protected sealed override Ruleset CreateRuleset() => CreatePlayerRuleset();

protected virtual TestPlayer CreatePlayer(Ruleset ruleset) => new TestPlayer(false, false, AllowBackwardsSeeks);
protected virtual TestPlayer CreatePlayer(Ruleset ruleset) => new TestPlayer(false, false, AllowBackwardsSeeks, ShowSettingsOverlay);
}
}
5 changes: 3 additions & 2 deletions osu.Game/Tests/Visual/TestPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,12 @@ public partial class TestPlayer : SoloPlayer
[Resolved]
private SpectatorClient spectatorClient { get; set; }

public TestPlayer(bool allowPause = true, bool showResults = true, bool pauseOnFocusLost = false)
public TestPlayer(bool allowPause = true, bool showResults = true, bool pauseOnFocusLost = false, bool showSettingsOverlay = true)
: base(new PlayerConfiguration
{
AllowPause = allowPause,
ShowResults = showResults
ShowResults = showResults,
ShowSettingsOverlay = showSettingsOverlay
})
{
PauseOnFocusLost = pauseOnFocusLost;
Expand Down