Fix multiplayer channel being unintentionally left after gameplay session

This commit is contained in:
Dean Herbert 2021-08-18 18:24:19 +09:00
parent 2099298444
commit 365c1bccc6
2 changed files with 8 additions and 2 deletions

View File

@ -19,9 +19,12 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components
[Resolved(CanBeNull = true)]
private ChannelManager channelManager { get; set; }
public MatchChatDisplay()
private readonly bool leaveChannelOnDispose;
public MatchChatDisplay(bool leaveChannelOnDispose = true)
: base(true)
{
this.leaveChannelOnDispose = leaveChannelOnDispose;
}
protected override void LoadComplete()
@ -42,7 +45,9 @@ namespace osu.Game.Screens.OnlinePlay.Match.Components
protected override void Dispose(bool isDisposing)
{
base.Dispose(isDisposing);
channelManager?.LeaveChannel(Channel.Value);
if (leaveChannelOnDispose)
channelManager?.LeaveChannel(Channel.Value);
}
}
}

View File

@ -25,6 +25,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
private const float height = 100;
public GameplayChatDisplay()
: base(leaveChannelOnDispose: false)
{
RelativeSizeAxes = Axes.X;