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
46 changes: 46 additions & 0 deletions osu.Game.Tests/Visual/Matchmaking/TestScenePlayerPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,51 @@ public void TestDownloadProgress()
AddStep("set download progress 90%", () => MultiplayerClient.ChangeUserBeatmapAvailability(2, BeatmapAvailability.Downloading(0.9f)));
AddStep("set locally available", () => MultiplayerClient.ChangeUserBeatmapAvailability(2, BeatmapAvailability.LocallyAvailable()));
}

[Test]
public void TestLongUsername()
{
AddStep("set long username", () =>
{
MultiplayerClient.ChangeMatchRoomState(new MatchmakingRoomState
{
Users =
{
UserDictionary =
{
{
2, new MatchmakingUser
{
UserId = 2,
Placement = 1
}
}
}
}
}).WaitSafely();

Child = panel = new PlayerPanel(new MultiplayerRoomUser(2)
{
User = new APIUser
{
Username = @"ThisIsALongUsername",
Id = 2,
Colour = "99EB47",
CountryCode = CountryCode.AU,
CoverUrl = @"https://assets.ppy.sh/user-profile-covers/2/baba245ef60834b769694178f8f6d4f6166c5188c740de084656ad2b80f1eea7.jpeg",
Statistics = new UserStatistics { GlobalRank = null, CountryRank = null }
}
})
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre
};
});

foreach (var layout in Enum.GetValues<PlayerPanelDisplayMode>())
{
AddStep($"set layout to {layout}", () => panel.DisplayMode = layout);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public SubScreenBeatmapSelect()
new Container
{
RelativeSizeAxes = Axes.Both,
Padding = new MarginPadding { Horizontal = 200 },
Padding = new MarginPadding { Horizontal = 250 },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is required because the new size of panels would otherwise push them on top of the scroll bar in the beatmap selection screen.

Children = new Drawable[]
{
beatmapSelectGrid = new BeatmapSelectGrid
Expand Down
5 changes: 3 additions & 2 deletions osu.Game/Screens/OnlinePlay/Matchmaking/Match/PlayerPanel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace osu.Game.Screens.OnlinePlay.Matchmaking.Match
/// </summary>
public partial class PlayerPanel : OsuClickableContainer, IHasContextMenu
{
private static readonly Vector2 size_horizontal = new Vector2(250, 100);
private static readonly Vector2 size_horizontal = new Vector2(300, 100);
private static readonly Vector2 size_vertical = new Vector2(150, 200);
private static readonly Vector2 avatar_size = new Vector2(80);

Expand Down Expand Up @@ -236,13 +236,14 @@ private void load(AudioManager audio)
Text = "-",
Font = OsuFont.Style.Title.With(size: 55),
},
username = new OsuSpriteText
username = new TruncatingSpriteText
{
Alpha = 0,
Anchor = Anchor.BottomCentre,
Origin = Anchor.BottomCentre,
Text = User.Username,
Font = OsuFont.Style.Heading1,
MaxWidth = 120
},
scoreText = new OsuSpriteText
{
Expand Down
Loading