Skip to content

Commit

Permalink
Merge pull request #32 from ILW8/fix-lobby-link-wrapping
Browse files Browse the repository at this point in the history
fix incorrectly sized lobby mp link
  • Loading branch information
ILW8 authored Apr 13, 2024
2 parents 6153702 + 67d012f commit d457950
Showing 1 changed file with 13 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
using System.Diagnostics;
using System.Linq;
using JetBrains.Annotations;
using System.Threading.Tasks;
using Newtonsoft.Json;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
Expand Down Expand Up @@ -178,11 +177,6 @@ public partial class MultiplayerMatchSubScreen : RoomSubScreen, IHandlePresentBe
[Resolved]
private MultiplayerClient client { get; set; }

[Resolved]
private OngoingOperationTracker operationTracker { get; set; } = null!;

private IDisposable selectionOperation;

[Resolved(canBeNull: true)]
private OsuGame game { get; set; }

Expand Down Expand Up @@ -258,29 +252,6 @@ protected override void LoadComplete()

protected override bool IsConnected => base.IsConnected && client.IsConnected.Value;

private async Task replacePlaylistItems(IEnumerable<MultiplayerPlaylistItem> items)
{
// ensure user is host
if (!client.IsHost)
return;

selectionOperation = operationTracker.BeginOperation();

var itemsToRemove = Room.Playlist?.ToArray() ?? Array.Empty<PlaylistItem>();

foreach (var playlistItem in items)
{
await client.AddPlaylistItem(playlistItem).ConfigureAwait(true);
}

foreach (var playlistItem in itemsToRemove)
{
await client.RemovePlaylistItem(playlistItem.ID).ConfigureAwait(false);
}

selectionOperation?.Dispose();
}

private void processDownloadQueue()
{
lock (downloadQueue)
Expand Down Expand Up @@ -309,14 +280,14 @@ private void processDownloadQueue()
Child = new GridContainer
{
RelativeSizeAxes = Axes.Both,
ColumnDimensions = new[]
{
ColumnDimensions =
[
new Dimension(),
new Dimension(GridSizeMode.Absolute, 10),
new Dimension(),
new Dimension(GridSizeMode.Absolute, 10),
new Dimension(),
},
new Dimension()
],
Content = new[]
{
new Drawable[]
Expand All @@ -328,23 +299,22 @@ private void processDownloadQueue()
Content = new[]
{
new Drawable[] { new OverlinedHeader("Lobby ID") },
new Drawable[] { linkFlowContainer = new LinkFlowContainer { Height = 24 } },
new Drawable[] { new ParticipantsListHeader() },
new Drawable[]
{
[linkFlowContainer = new LinkFlowContainer { Height = 24, AutoSizeAxes = Axes.X }],
[new ParticipantsListHeader()],
[
new ParticipantsList
{
RelativeSizeAxes = Axes.Both
},
},
}
],
},
RowDimensions = new[]
{
RowDimensions =
[
new Dimension(GridSizeMode.AutoSize),
new Dimension(GridSizeMode.AutoSize),
new Dimension(GridSizeMode.AutoSize),
new Dimension(),
}
new Dimension()
]
},
// Spacer
null,
Expand Down

0 comments on commit d457950

Please sign in to comment.