From 5e5fbc496ed25fd66029305c1665e0d23bb59759 Mon Sep 17 00:00:00 2001 From: hwabis Date: Fri, 18 Mar 2022 20:32:37 -0400 Subject: [PATCH] (still not working) try bindables instead of int --- .../Match/Playlist/MultiplayerPlaylist.cs | 2 +- .../Match/Playlist/MultiplayerPlaylistTabControl.cs | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/Match/Playlist/MultiplayerPlaylist.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/Match/Playlist/MultiplayerPlaylist.cs index c65ff1bd00..a1feda9000 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/Match/Playlist/MultiplayerPlaylist.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/Match/Playlist/MultiplayerPlaylist.cs @@ -73,7 +73,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist base.LoadComplete(); DisplayMode.BindValueChanged(onDisplayModeChanged, true); queueList.Items.BindCollectionChanged( - (_, __) => playlistTabControl.queueListCount = queueList.Items.Count, true); + (_, __) => playlistTabControl.queueListCount.Value = queueList.Items.Count, true); } private void onDisplayModeChanged(ValueChangedEvent mode) diff --git a/osu.Game/Screens/OnlinePlay/Multiplayer/Match/Playlist/MultiplayerPlaylistTabControl.cs b/osu.Game/Screens/OnlinePlay/Multiplayer/Match/Playlist/MultiplayerPlaylistTabControl.cs index f6a5bfed41..a459ec6f80 100644 --- a/osu.Game/Screens/OnlinePlay/Multiplayer/Match/Playlist/MultiplayerPlaylistTabControl.cs +++ b/osu.Game/Screens/OnlinePlay/Multiplayer/Match/Playlist/MultiplayerPlaylistTabControl.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using osu.Framework.Bindables; using osu.Framework.Graphics.UserInterface; using osu.Game.Graphics.UserInterface; @@ -8,11 +9,10 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist { public class MultiplayerPlaylistTabControl : OsuTabControl { - public int queueListCount; + public Bindable queueListCount = new Bindable(0); public MultiplayerPlaylistTabControl() { - queueListCount = 0; } protected override TabItem CreateTabItem(MultiplayerPlaylistDisplayMode value) @@ -24,10 +24,14 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer.Match.Playlist private class QueueTabItem : OsuTabItem { - public QueueTabItem(MultiplayerPlaylistDisplayMode value, int count) + private Bindable count; + + public QueueTabItem(MultiplayerPlaylistDisplayMode value, Bindable queueListCount) : base(value) { - Text.Text += " (" + count + ")"; + count = new Bindable(); + count.BindTo(queueListCount); + Text.Text += " (" + count.Value + ")"; } } }