From 94eb853d3d14d69155709f13c105adcf0fed669a Mon Sep 17 00:00:00 2001 From: FreezyLemon Date: Wed, 6 Dec 2017 16:41:57 +0100 Subject: [PATCH] Added centralised handling for some chat links --- .../Graphics/Sprites/OsuLinkSpriteText.cs | 5 ++-- osu.Game/OsuGame.cs | 28 +++++++++++++++++++ osu.Game/Overlays/ChatOverlay.cs | 5 +++- 3 files changed, 35 insertions(+), 3 deletions(-) diff --git a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs index da11bc5043..75b3f281d0 100644 --- a/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs +++ b/osu.Game/Graphics/Sprites/OsuLinkSpriteText.cs @@ -99,7 +99,7 @@ namespace osu.Game.Graphics.Sprites break; case "edit": - // TODO: Change screen to editor + chat.Game.LoadEditorTimestamp(); break; case "b": if (args.Length > 1 && int.TryParse(args[1], out int mapId)) @@ -126,6 +126,7 @@ namespace osu.Game.Graphics.Sprites }; // api.Queue(req); + chat.Game.LoadSpectatorScreen(); break; default: @@ -138,7 +139,7 @@ namespace osu.Game.Graphics.Sprites if (!int.TryParse(url.Split('/').ElementAtOrDefault(1), out int multiId)) return; - // TODO: Join the specified multiplayer lobby here with multiId + chat.Game.LoadMultiplayerLobby(); } else if (url.StartsWith("http://") || url.StartsWith("https://")) { diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 4745733bd9..900a55293d 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -115,6 +115,34 @@ namespace osu.Game private ScheduledDelegate scoreLoad; + // TODO: Implement this properly as soon as the Editor is done + internal void LoadEditorTimestamp() + { + notificationOverlay.Post(new SimpleNotification + { + Text = @"Sorry, but this is not fully implemented yet!", + Icon = FontAwesome.fa_life_saver, + }); + } + + internal void LoadSpectatorScreen() + { + notificationOverlay.Post(new SimpleNotification + { + Text = @"Sorry, but spectating is not implemented yet!", + Icon = FontAwesome.fa_life_saver, + }); + } + + internal void LoadMultiplayerLobby() + { + notificationOverlay.Post(new SimpleNotification + { + Text = @"Sorry, but the multiplayer lobby is not implemented yet!", + Icon = FontAwesome.fa_life_saver, + }); + } + protected void LoadScore(Score s) { scoreLoad?.Cancel(); diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index 9e3e60a988..eaf58cde5e 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -41,6 +41,8 @@ namespace osu.Game.Overlays private readonly FocusedTextBox textbox; + public OsuGame Game; + private APIAccess api; private const int transition_length = 500; @@ -271,8 +273,9 @@ namespace osu.Game.Overlays } [BackgroundDependencyLoader] - private void load(APIAccess api, OsuConfigManager config, OsuColour colours) + private void load(APIAccess api, OsuConfigManager config, OsuColour colours, OsuGame game) { + Game = game; this.api = api; api.Register(this);