mirror of
https://github.com/ppy/osu
synced 2024-12-15 03:16:17 +00:00
Fix multiplayer channel being unintentionally left after gameplay session
This commit is contained in:
parent
2099298444
commit
365c1bccc6
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,6 +25,7 @@ namespace osu.Game.Screens.OnlinePlay.Multiplayer
|
||||
private const float height = 100;
|
||||
|
||||
public GameplayChatDisplay()
|
||||
: base(leaveChannelOnDispose: false)
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user