Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
using System.Linq;
using osu.Framework.Allocation;
using osu.Framework.Audio;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Logging;
using osu.Game.Configuration;
using osu.Game.Graphics;
using osu.Game.Online.Multiplayer;
using osu.Game.Online.Rooms;
Expand Down Expand Up @@ -63,6 +65,9 @@ public partial class MultiSpectatorScreen : SpectatorScreen

private readonly Room room;

private PlayerSettingsOverlay playerSettingsOverlay = null!;
private Bindable<bool> configSettingsOverlay = null!;

/// <summary>
/// Creates a new <see cref="MultiSpectatorScreen"/>.
/// </summary>
Expand All @@ -78,8 +83,10 @@ public MultiSpectatorScreen(Room room, MultiplayerRoomUser[] users)
}

[BackgroundDependencyLoader]
private void load()
private void load(OsuConfigManager config)
{
configSettingsOverlay = config.GetBindable<bool>(OsuSetting.ReplaySettingsOverlay);

FillFlowContainer leaderboardFlow;
Container scoreDisplayContainer;

Expand Down Expand Up @@ -131,7 +138,10 @@ private void load()
{
ReadyToStart = performInitialSeek,
},
new PlayerSettingsOverlay()
playerSettingsOverlay = new PlayerSettingsOverlay
{
Alpha = 0,
}
};

for (int i = 0; i < Users.Count; i++)
Expand Down Expand Up @@ -172,6 +182,16 @@ protected override void LoadComplete()

// Start with adjustments from the first player to keep a sane state.
bindAudioAdjustments(instances.First());

configSettingsOverlay.BindValueChanged(_ => updateVisibility(), true);
}

private void updateVisibility()
{
if (configSettingsOverlay.Value)
playerSettingsOverlay.Show();
else
playerSettingsOverlay.Hide();
}

protected override void Update()
Expand Down
15 changes: 9 additions & 6 deletions osu.Game/Screens/Play/HUDOverlay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,10 @@ public HUDOverlay([CanBeNull] DrawableRuleset drawableRuleset, IReadOnlyList<Mod
RelativeSizeAxes = Axes.Both,
Children = new Drawable[]
{
PlayerSettingsOverlay = new PlayerSettingsOverlay(),
PlayerSettingsOverlay = new PlayerSettingsOverlay
{
Alpha = 0,
}
}
},
TopLeftElements = new FillFlowContainer
Expand Down Expand Up @@ -344,6 +347,11 @@ void processDrawable(ISerialisableDrawable element)

private void updateVisibility()
{
if (configSettingsOverlay.Value && replayLoaded.Value)
PlayerSettingsOverlay.Show();
else
PlayerSettingsOverlay.Hide();

if (ShowHud.Disabled)
return;

Expand All @@ -353,11 +361,6 @@ private void updateVisibility()
return;
}

if (configSettingsOverlay.Value && replayLoaded.Value)
PlayerSettingsOverlay.Show();
else
PlayerSettingsOverlay.Hide();

switch (configVisibilityMode.Value)
{
case HUDVisibilityMode.Never:
Expand Down