mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 11:42:54 +08:00
add and handle OpenWiki link action
This commit is contained in:
parent
463774d4f2
commit
f2de28814a
@ -167,6 +167,9 @@ namespace osu.Game.Online.Chat
|
||||
case "u":
|
||||
case "users":
|
||||
return new LinkDetails(LinkAction.OpenUserProfile, mainArg);
|
||||
|
||||
case "wiki":
|
||||
return new LinkDetails(LinkAction.OpenWiki, string.Join('/', args.Skip(3)));
|
||||
}
|
||||
}
|
||||
|
||||
@ -311,7 +314,8 @@ namespace osu.Game.Online.Chat
|
||||
JoinMultiplayerMatch,
|
||||
Spectate,
|
||||
OpenUserProfile,
|
||||
Custom
|
||||
OpenWiki,
|
||||
Custom,
|
||||
}
|
||||
|
||||
public class Link : IComparable<Link>
|
||||
|
@ -309,6 +309,10 @@ namespace osu.Game
|
||||
ShowUser(userId);
|
||||
break;
|
||||
|
||||
case LinkAction.OpenWiki:
|
||||
ShowWiki(link.Argument);
|
||||
break;
|
||||
|
||||
default:
|
||||
throw new NotImplementedException($"This {nameof(LinkAction)} ({link.Action.ToString()}) is missing an associated action.");
|
||||
}
|
||||
@ -356,6 +360,12 @@ namespace osu.Game
|
||||
/// <param name="beatmapId">The beatmap to show.</param>
|
||||
public void ShowBeatmap(int beatmapId) => waitForReady(() => beatmapSetOverlay, _ => beatmapSetOverlay.FetchAndShowBeatmap(beatmapId));
|
||||
|
||||
/// <summary>
|
||||
/// Show a wiki's page as an overlay
|
||||
/// </summary>
|
||||
/// <param name="path">The wiki page to show</param>
|
||||
public void ShowWiki(string path) => waitForReady(() => wikiOverlay, _ => wikiOverlay.ShowPage(path));
|
||||
|
||||
/// <summary>
|
||||
/// Present a beatmap at song select immediately.
|
||||
/// The user should have already requested this interactively.
|
||||
|
Loading…
Reference in New Issue
Block a user