From 38c5434b825724fbf3c7b6d6c92753fd0b1a60c3 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 17 Jan 2018 19:52:04 +0900 Subject: [PATCH] Remove placeholder methods in OsuGame Let's add these when they can actually be implemented. --- .../Graphics/Containers/LinkFlowContainer.cs | 21 +++++++++------ osu.Game/OsuGame.cs | 27 ------------------- 2 files changed, 13 insertions(+), 35 deletions(-) diff --git a/osu.Game/Graphics/Containers/LinkFlowContainer.cs b/osu.Game/Graphics/Containers/LinkFlowContainer.cs index ea11f065b4..f35282fc93 100644 --- a/osu.Game/Graphics/Containers/LinkFlowContainer.cs +++ b/osu.Game/Graphics/Containers/LinkFlowContainer.cs @@ -8,6 +8,8 @@ using System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics.Sprites; using System.Collections.Generic; +using osu.Game.Overlays; +using osu.Game.Overlays.Notifications; namespace osu.Game.Graphics.Containers { @@ -22,11 +24,19 @@ namespace osu.Game.Graphics.Containers private OsuGame game; + private Action showNotImplementedError; + [BackgroundDependencyLoader(true)] - private void load(OsuGame game) + private void load(OsuGame game, NotificationOverlay notifications) { // will be null in tests this.game = game; + + showNotImplementedError = () => notifications?.Post(new SimpleNotification + { + Text = @"This link type is not yet supported!", + Icon = FontAwesome.fa_life_saver, + }); } public void AddLinks(string text, List links) @@ -72,14 +82,9 @@ namespace osu.Game.Graphics.Containers game?.OpenChannel(linkArgument); break; case LinkAction.OpenEditorTimestamp: - game?.LoadEditorTimestamp(); - break; case LinkAction.JoinMultiplayerMatch: - if (int.TryParse(linkArgument, out int matchId)) - game?.JoinMultiplayerMatch(matchId); - break; case LinkAction.Spectate: - // todo: implement this when spectating exists + showNotImplementedError?.Invoke(); break; case LinkAction.External: Process.Start(url); @@ -87,7 +92,7 @@ namespace osu.Game.Graphics.Containers default: throw new NotImplementedException($"This {nameof(LinkAction)} ({linkType.ToString()}) is missing an associated action."); } - } + }, }); } } diff --git a/osu.Game/OsuGame.cs b/osu.Game/OsuGame.cs index 40848d2507..56fe436210 100644 --- a/osu.Game/OsuGame.cs +++ b/osu.Game/OsuGame.cs @@ -123,33 +123,6 @@ namespace osu.Game public void ShowBeatmapSet(int setId) => beatmapSetOverlay.ShowBeatmapSet(setId); - public void LoadEditorTimestamp() - { - notifications.Post(new SimpleNotification - { - Text = @"Sorry, but this is not fully implemented yet!", - Icon = FontAwesome.fa_life_saver, - }); - } - - public void LoadSpectatorScreen() - { - notifications.Post(new SimpleNotification - { - Text = @"Sorry, but spectating is not implemented yet!", - Icon = FontAwesome.fa_life_saver, - }); - } - - public void JoinMultiplayerMatch(int matchId) - { - notifications.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();