1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 20:47:26 +08:00

Added centralised handling for some chat links

This commit is contained in:
FreezyLemon 2017-12-06 16:41:57 +01:00
parent b04ddba2a0
commit 94eb853d3d
3 changed files with 35 additions and 3 deletions

View File

@ -99,7 +99,7 @@ namespace osu.Game.Graphics.Sprites
break; break;
case "edit": case "edit":
// TODO: Change screen to editor chat.Game.LoadEditorTimestamp();
break; break;
case "b": case "b":
if (args.Length > 1 && int.TryParse(args[1], out int mapId)) if (args.Length > 1 && int.TryParse(args[1], out int mapId))
@ -126,6 +126,7 @@ namespace osu.Game.Graphics.Sprites
}; };
// api.Queue(req); // api.Queue(req);
chat.Game.LoadSpectatorScreen();
break; break;
default: default:
@ -138,7 +139,7 @@ namespace osu.Game.Graphics.Sprites
if (!int.TryParse(url.Split('/').ElementAtOrDefault(1), out int multiId)) if (!int.TryParse(url.Split('/').ElementAtOrDefault(1), out int multiId))
return; return;
// TODO: Join the specified multiplayer lobby here with multiId chat.Game.LoadMultiplayerLobby();
} }
else if (url.StartsWith("http://") || url.StartsWith("https://")) else if (url.StartsWith("http://") || url.StartsWith("https://"))
{ {

View File

@ -115,6 +115,34 @@ namespace osu.Game
private ScheduledDelegate scoreLoad; 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) protected void LoadScore(Score s)
{ {
scoreLoad?.Cancel(); scoreLoad?.Cancel();

View File

@ -41,6 +41,8 @@ namespace osu.Game.Overlays
private readonly FocusedTextBox textbox; private readonly FocusedTextBox textbox;
public OsuGame Game;
private APIAccess api; private APIAccess api;
private const int transition_length = 500; private const int transition_length = 500;
@ -271,8 +273,9 @@ namespace osu.Game.Overlays
} }
[BackgroundDependencyLoader] [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; this.api = api;
api.Register(this); api.Register(this);