1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-23 06:59:53 +08:00

Fix stand alone chat display textbox not binding to local channel

This commit is contained in:
Joseph Madamba
2022-12-29 01:37:37 -08:00
Unverified
parent c326745f96
commit 70dbb8edac
@@ -87,14 +87,6 @@ namespace osu.Game.Online.Chat
channelManager ??= manager;
}
protected override void LoadComplete()
{
base.LoadComplete();
if (channelManager != null)
TextBox?.Current.BindTo(channelManager.CurrentChannel.Value.TextBoxMessage);
}
protected virtual StandAloneDrawableChannel CreateDrawableChannel(Channel channel) =>
new StandAloneDrawableChannel(channel);
@@ -119,8 +111,13 @@ namespace osu.Game.Online.Chat
{
drawableChannel?.Expire();
if (e.OldValue != null)
TextBox?.Current.UnbindFrom(e.OldValue.TextBoxMessage);
if (e.NewValue == null) return;
TextBox?.Current.BindTo(e.NewValue.TextBoxMessage);
drawableChannel = CreateDrawableChannel(e.NewValue);
drawableChannel.CreateChatLineAction = CreateMessage;
drawableChannel.Padding = new MarginPadding { Bottom = postingTextBox ? text_box_height : 0 };