diff --git a/osu.Game/Online/Multiplayer/Room.cs b/osu.Game/Online/Multiplayer/Room.cs index 80a4be83eb..16b0c588fa 100644 --- a/osu.Game/Online/Multiplayer/Room.cs +++ b/osu.Game/Online/Multiplayer/Room.cs @@ -24,6 +24,9 @@ namespace osu.Game.Online.Multiplayer [JsonProperty("playlist")] public BindableCollection Playlist { get; set; } = new BindableCollection(); + [JsonProperty("channel_id")] + public Bindable ChannelId { get; private set; } = new Bindable(); + [JsonIgnore] public Bindable Duration { get; private set; } = new Bindable(TimeSpan.FromMinutes(30)); diff --git a/osu.Game/Screens/Multi/Match/Components/MatchChatDisplay.cs b/osu.Game/Screens/Multi/Match/Components/MatchChatDisplay.cs new file mode 100644 index 0000000000..9c02439f7c --- /dev/null +++ b/osu.Game/Screens/Multi/Match/Components/MatchChatDisplay.cs @@ -0,0 +1,30 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Game.Online.Chat; +using osu.Game.Online.Multiplayer; + +namespace osu.Game.Screens.Multi.Match.Components +{ + public class MatchChatDisplay : StandAloneChatDisplay + { + private readonly Room room; + + [Resolved] + private ChannelManager channelManager { get; set; } + + public MatchChatDisplay(Room room) + : base(true) + { + this.room = room; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + + Channel.Value = channelManager.JoinChannel(new Channel { Id = room.ChannelId, Type = ChannelType.Multiplayer, Name = $"#mp_{room.RoomID}" }); + } + } +} diff --git a/osu.Game/Screens/Multi/Match/MatchScreen.cs b/osu.Game/Screens/Multi/Match/MatchScreen.cs index b33c871fad..b865c07e31 100644 --- a/osu.Game/Screens/Multi/Match/MatchScreen.cs +++ b/osu.Game/Screens/Multi/Match/MatchScreen.cs @@ -21,8 +21,6 @@ namespace osu.Game.Screens.Multi.Match { public class MatchScreen : MultiplayerScreen { - private readonly Participants participants; - private readonly Bindable nameBind = new Bindable(); private readonly Bindable statusBind = new Bindable(); private readonly Bindable availabilityBind = new Bindable(); @@ -34,8 +32,6 @@ namespace osu.Game.Screens.Multi.Match public override bool AllowBeatmapRulesetChange => false; - protected override Drawable TransitionContent => participants; - public override string Title => room.Name.Value; public override string ShortTitle => "room"; @@ -90,15 +86,10 @@ namespace osu.Game.Screens.Multi.Match { new Drawable[] { - participants = new Participants { RelativeSizeAxes = Axes.Both }, - leaderboard = new MatchLeaderboard(room) { RelativeSizeAxes = Axes.Both } + leaderboard = new MatchLeaderboard(room) { RelativeSizeAxes = Axes.Both }, + new MatchChatDisplay(room) { RelativeSizeAxes = Axes.Both } }, }, - ColumnDimensions = new[] - { - new Dimension(GridSizeMode.Distributed), - new Dimension(GridSizeMode.Relative, 0.5f), - } } }, }, @@ -138,9 +129,6 @@ namespace osu.Game.Screens.Multi.Match header.Type.BindTo(typeBind); - participants.Users.BindTo(participantsBind); - participants.MaxParticipants.BindTo(maxParticipantsBind); - playlistBind.ItemsAdded += _ => setFromPlaylist(); playlistBind.ItemsRemoved += _ => setFromPlaylist(); }