1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-25 06:20:02 +08:00

Fix some weirdness around forced multiplayer elements

- Naming wasn't adjusted
- When the chat collapsed, the team score display broke due to zero
  width

Partial revert of
https://github.com/ppy/osu/commit/da1fc1013e07b8dafb0c409354f9d1cef971e449.
This commit is contained in:
Bartłomiej Dach
2025-04-25 10:41:27 +02:00
Unverified
parent ae8fb2ce08
commit 6d65b68100
3 changed files with 30 additions and 19 deletions
@@ -38,8 +38,8 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
public GameplayChatDisplay(Room room)
: base(room, leaveChannelOnDispose: false)
{
RelativeSizeAxes = Axes.X;
Background.Alpha = 0.2f;
Width = width;
}
[BackgroundDependencyLoader]
@@ -8,6 +8,8 @@ using System.Threading.Tasks;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Extensions.ObjectExtensions;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Logging;
using osu.Framework.Screens;
using osu.Game.Graphics.UserInterface;
@@ -18,6 +20,7 @@ using osu.Game.Screens.Play;
using osu.Game.Screens.Ranking;
using osu.Game.Screens.Select.Leaderboards;
using osu.Game.Users;
using osuTK;
namespace osu.Game.Screens.OnlinePlay.Multiplayer
{
@@ -70,13 +73,22 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
ScoreProcessor.ApplyNewJudgementsWhenFailed = true;
LoadComponentAsync(chat = new GameplayChatDisplay(Room), HUDOverlay.LeaderboardFlow.Add);
LoadComponentAsync(teamScoreDisplay = new GameplayMatchScoreDisplay
LoadComponentAsync(new FillFlowContainer
{
Expanded = { BindTarget = HUDOverlay.ShowHud },
Alpha = 0,
}, scoreDisplay => HUDOverlay.LeaderboardFlow.Insert(1, scoreDisplay));
Width = 260,
Direction = FillDirection.Vertical,
Spacing = new Vector2(5),
Children = new Drawable[]
{
chat = new GameplayChatDisplay(Room),
teamScoreDisplay = new GameplayMatchScoreDisplay
{
Expanded = { BindTarget = HUDOverlay.ShowHud },
Alpha = 0,
}
}
}, HUDOverlay.TopLeftElements.Add);
LoadComponentAsync(leaderboardProvider, loaded =>
{
AddInternal(loaded);
+11 -12
View File
@@ -86,9 +86,14 @@ namespace osu.Game.Screens.Play
private readonly BindableBool replayLoaded = new BindableBool();
private static bool hasShownNotificationOnce;
private readonly FillFlowContainer bottomRightElements;
// The following flows are used to attach fixed non-skinnable elements in particular implementations of the player
// (e.g. replay or multiplayer-specific controls).
// They will make a best-effort attempt to get out of the way of any other skinnable components.
public readonly FillFlowContainer TopLeftElements;
internal readonly FillFlowContainer TopRightElements;
private readonly FillFlowContainer bottomRightElements;
internal readonly IBindable<bool> IsPlaying = new Bindable<bool>();
@@ -101,12 +106,6 @@ namespace osu.Game.Screens.Play
[CanBeNull]
private readonly SkinnableContainer rulesetComponents;
/// <summary>
/// A flow which sits at the left side of the screen to house leaderboard (and related) components.
/// Will automatically be positioned to avoid colliding with top scoring elements.
/// </summary>
public readonly FillFlowContainer LeaderboardFlow;
private readonly List<Drawable> hideTargets;
/// <summary>
@@ -177,7 +176,7 @@ namespace osu.Game.Screens.Play
PlayerSettingsOverlay = new PlayerSettingsOverlay(),
}
},
LeaderboardFlow = new FillFlowContainer
TopLeftElements = new FillFlowContainer
{
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Vertical,
@@ -191,7 +190,7 @@ namespace osu.Game.Screens.Play
if (rulesetComponents != null)
hideTargets.Add(rulesetComponents);
hideTargets.Add(LeaderboardFlow);
hideTargets.Add(TopLeftElements);
}
[BackgroundDependencyLoader(true)]
@@ -285,10 +284,10 @@ namespace osu.Game.Screens.Play
else
TopRightElements.Y = 0;
if (lowestTopScreenSpaceLeft.HasValue && DrawHeight - LeaderboardFlow.DrawHeight > 0)
LeaderboardFlow.Y = Math.Clamp(ToLocalSpace(new Vector2(0, lowestTopScreenSpaceLeft.Value)).Y, 0, DrawHeight - LeaderboardFlow.DrawHeight);
if (lowestTopScreenSpaceLeft.HasValue && DrawHeight - TopLeftElements.DrawHeight > 0)
TopLeftElements.Y = Math.Clamp(ToLocalSpace(new Vector2(0, lowestTopScreenSpaceLeft.Value)).Y, 0, DrawHeight - TopLeftElements.DrawHeight);
else
LeaderboardFlow.Y = 0;
TopLeftElements.Y = 0;
if (highestBottomScreenSpace.HasValue && DrawHeight - bottomRightElements.DrawHeight > 0)
bottomRightElements.Y = BottomScoringElementsHeight = -Math.Clamp(DrawHeight - ToLocalSpace(highestBottomScreenSpace.Value).Y, 0, DrawHeight - bottomRightElements.DrawHeight);