mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 14:46:38 +09:00
Permitted nulls in ChatOverlay.load() so that in testing, no "OsuGame" instance is required. Also added null checks to the links' on click actions
This commit is contained in:
@ -99,7 +99,7 @@ namespace osu.Game.Graphics.Sprites
|
||||
|
||||
break;
|
||||
case "edit":
|
||||
chat.Game.LoadEditorTimestamp();
|
||||
chat.Game?.LoadEditorTimestamp();
|
||||
break;
|
||||
case "b":
|
||||
if (args.Length > 1 && int.TryParse(args[1], out int mapId))
|
||||
@ -122,16 +122,14 @@ namespace osu.Game.Graphics.Sprites
|
||||
|
||||
req.Success += user =>
|
||||
{
|
||||
// TODO: Open spectator screen and start spectating
|
||||
|
||||
chat.Game?.LoadSpectatorScreen();
|
||||
};
|
||||
// api.Queue(req);
|
||||
chat.Game.LoadSpectatorScreen();
|
||||
api.Queue(req);
|
||||
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentException($"Unknown osu:// link at {nameof(OsuLinkSpriteText)} (https://osu.ppy.sh/{args[0]}).");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (url.StartsWith("osump://"))
|
||||
{
|
||||
@ -139,7 +137,7 @@ namespace osu.Game.Graphics.Sprites
|
||||
if (!int.TryParse(url.Split('/').ElementAtOrDefault(1), out int multiId))
|
||||
return;
|
||||
|
||||
chat.Game.LoadMultiplayerLobby();
|
||||
chat.Game?.LoadMultiplayerLobby();
|
||||
}
|
||||
else if (url.StartsWith("http://") || url.StartsWith("https://"))
|
||||
{
|
||||
|
Reference in New Issue
Block a user