diff --git a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs b/osu.Game/Online/Chat/Drawables/DrawableChannel.cs index d2968a732b..07d5638766 100644 --- a/osu.Game/Online/Chat/Drawables/DrawableChannel.cs +++ b/osu.Game/Online/Chat/Drawables/DrawableChannel.cs @@ -21,8 +21,8 @@ namespace osu.Game.Online.Chat.Drawables public DrawableChannel(Channel channel) { this.channel = channel; - newMessages(channel.Messages); - channel.NewMessagesArrived += newMessages; + newMessagesArrived(channel.Messages); + channel.NewMessagesArrived += newMessagesArrived; RelativeSizeAxes = Axes.Both; @@ -56,16 +56,16 @@ namespace osu.Game.Online.Chat.Drawables protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); - channel.NewMessagesArrived -= newMessages; + channel.NewMessagesArrived -= newMessagesArrived; } [BackgroundDependencyLoader] private void load() { - newMessages(channel.Messages); + newMessagesArrived(channel.Messages); } - private void newMessages(IEnumerable newMessages) + private void newMessagesArrived(IEnumerable newMessages) { if (!IsLoaded) return; diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index b9ac55bff0..3088b5e7a1 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -19,6 +19,10 @@ using osu.Game.Online.API; using osu.Game.Online.API.Requests; using osu.Game.Online.Chat; using osu.Game.Online.Chat.Drawables; +using osu.Game.Graphics.UserInterface; +using osu.Game.Screens.Select; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.UserInterface; namespace osu.Game.Overlays { @@ -32,6 +36,8 @@ namespace osu.Game.Overlays protected override Container Content => content; + private FocusedTextBox inputTextBox; + private APIAccess api; public ChatOverlay() @@ -52,10 +58,38 @@ namespace osu.Game.Overlays content = new Container { RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Bottom = 50 }, + }, + new Container + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + RelativeSizeAxes = Axes.X, + Height = 50, + Padding = new MarginPadding(5), + Children = new Drawable[] + { + inputTextBox = new FocusedTextBox + { + RelativeSizeAxes = Axes.X, + PlaceholderText = "type your message", + Exit = () => State = Visibility.Hidden, + OnCommit = postMessage, + HoldFocus = true, + } + } } }); } + private void postMessage(TextBox sender, bool newText) + { + var postText = sender.Text; + //todo: do something with postText. + + sender.Text = string.Empty; + } + [BackgroundDependencyLoader] private void load(APIAccess api) {