From d4f5a8507c5dd4763161a0c9e83f8b22da8cefa8 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 25 Dec 2018 17:14:56 +0900 Subject: [PATCH] Exit from match screen on escape --- osu.Game/Online/Chat/StandAloneChatDisplay.cs | 8 ++++++-- osu.Game/Screens/Multi/Match/MatchScreen.cs | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/osu.Game/Online/Chat/StandAloneChatDisplay.cs b/osu.Game/Online/Chat/StandAloneChatDisplay.cs index 1ec138ab57..576a1d619a 100644 --- a/osu.Game/Online/Chat/StandAloneChatDisplay.cs +++ b/osu.Game/Online/Chat/StandAloneChatDisplay.cs @@ -19,10 +19,10 @@ namespace osu.Game.Online.Chat /// public class StandAloneChatDisplay : CompositeDrawable { - private readonly bool postingTextbox; - public readonly Bindable Channel = new Bindable(); + public Action Exit; + private readonly FocusedTextBox textbox; protected ChannelManager ChannelManager; @@ -31,6 +31,8 @@ namespace osu.Game.Online.Chat private DrawableChannel drawableChannel; + private readonly bool postingTextbox; + private const float textbox_height = 30; /// @@ -66,6 +68,8 @@ namespace osu.Game.Online.Chat Anchor = Anchor.BottomLeft, Origin = Anchor.BottomLeft, }); + + textbox.Exit += () => Exit?.Invoke(); } Channel.BindValueChanged(channelChanged); diff --git a/osu.Game/Screens/Multi/Match/MatchScreen.cs b/osu.Game/Screens/Multi/Match/MatchScreen.cs index dbbdbb8c54..9f1bbfdb4e 100644 --- a/osu.Game/Screens/Multi/Match/MatchScreen.cs +++ b/osu.Game/Screens/Multi/Match/MatchScreen.cs @@ -28,6 +28,7 @@ namespace osu.Game.Screens.Multi.Match private readonly RoomBindings bindings = new RoomBindings(); private readonly MatchLeaderboard leaderboard; + private readonly Action pushGameplayScreen; [Cached] @@ -49,6 +50,7 @@ namespace osu.Game.Screens.Multi.Match bindings.Room = room; + MatchChatDisplay chat; Components.Header header; RoomSettingsOverlay settings; @@ -71,7 +73,7 @@ namespace osu.Game.Screens.Multi.Match new Drawable[] { leaderboard = new MatchLeaderboard(room) { RelativeSizeAxes = Axes.Both }, - new MatchChatDisplay(room) { RelativeSizeAxes = Axes.Both } + chat = new MatchChatDisplay(room) { RelativeSizeAxes = Axes.Both } }, }, } @@ -100,6 +102,8 @@ namespace osu.Game.Screens.Multi.Match else settings.Hide(); }; + + chat.Exit += Exit; } protected override void LoadComplete()