mirror of https://github.com/ppy/osu
Fix stand alone chat display textbox not binding to local channel
This commit is contained in:
parent
c326745f96
commit
70dbb8edac
|
@ -87,14 +87,6 @@ private void load(ChannelManager manager)
|
||||||
channelManager ??= manager;
|
channelManager ??= manager;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
|
||||||
{
|
|
||||||
base.LoadComplete();
|
|
||||||
|
|
||||||
if (channelManager != null)
|
|
||||||
TextBox?.Current.BindTo(channelManager.CurrentChannel.Value.TextBoxMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual StandAloneDrawableChannel CreateDrawableChannel(Channel channel) =>
|
protected virtual StandAloneDrawableChannel CreateDrawableChannel(Channel channel) =>
|
||||||
new StandAloneDrawableChannel(channel);
|
new StandAloneDrawableChannel(channel);
|
||||||
|
|
||||||
|
@ -119,8 +111,13 @@ private void channelChanged(ValueChangedEvent<Channel> e)
|
||||||
{
|
{
|
||||||
drawableChannel?.Expire();
|
drawableChannel?.Expire();
|
||||||
|
|
||||||
|
if (e.OldValue != null)
|
||||||
|
TextBox?.Current.UnbindFrom(e.OldValue.TextBoxMessage);
|
||||||
|
|
||||||
if (e.NewValue == null) return;
|
if (e.NewValue == null) return;
|
||||||
|
|
||||||
|
TextBox?.Current.BindTo(e.NewValue.TextBoxMessage);
|
||||||
|
|
||||||
drawableChannel = CreateDrawableChannel(e.NewValue);
|
drawableChannel = CreateDrawableChannel(e.NewValue);
|
||||||
drawableChannel.CreateChatLineAction = CreateMessage;
|
drawableChannel.CreateChatLineAction = CreateMessage;
|
||||||
drawableChannel.Padding = new MarginPadding { Bottom = postingTextBox ? text_box_height : 0 };
|
drawableChannel.Padding = new MarginPadding { Bottom = postingTextBox ? text_box_height : 0 };
|
||||||
|
|
Loading…
Reference in New Issue