1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-28 03:22:54 +08:00

Reduce exposure of ChannelManager

This commit is contained in:
Dean Herbert 2022-01-13 17:10:48 +09:00
parent 7147799895
commit 2de0c34bc9

View File

@ -25,7 +25,7 @@ namespace osu.Game.Online.Chat
protected readonly ChatTextBox TextBox; protected readonly ChatTextBox TextBox;
protected ChannelManager ChannelManager; private ChannelManager channelManager;
private StandAloneDrawableChannel drawableChannel; private StandAloneDrawableChannel drawableChannel;
@ -80,7 +80,7 @@ namespace osu.Game.Online.Chat
[BackgroundDependencyLoader(true)] [BackgroundDependencyLoader(true)]
private void load(ChannelManager manager) private void load(ChannelManager manager)
{ {
ChannelManager ??= manager; channelManager ??= manager;
} }
protected virtual StandAloneDrawableChannel CreateDrawableChannel(Channel channel) => protected virtual StandAloneDrawableChannel CreateDrawableChannel(Channel channel) =>
@ -94,9 +94,9 @@ namespace osu.Game.Online.Chat
return; return;
if (text[0] == '/') if (text[0] == '/')
ChannelManager?.PostCommand(text.Substring(1), Channel.Value); channelManager?.PostCommand(text.Substring(1), Channel.Value);
else else
ChannelManager?.PostMessage(text, target: Channel.Value); channelManager?.PostMessage(text, target: Channel.Value);
TextBox.Text = string.Empty; TextBox.Text = string.Empty;
} }