1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-13 05:22:54 +08:00

Use relative URL

This commit is contained in:
Dean Herbert 2018-12-06 12:17:08 +09:00
parent 966c2f6547
commit d3f5111fa1
3 changed files with 15 additions and 7 deletions

View File

@ -187,7 +187,13 @@ namespace osu.Game
}
private ExternalLinkOpener externalLinkOpener;
public void OpenUrlExternally(string url) => externalLinkOpener.OpenUrlExternally(url);
public void OpenUrlExternally(string url)
{
if (url.StartsWith("/"))
url = $"{API.Endpoint}{url}";
externalLinkOpener.OpenUrlExternally(url);
}
private ScheduledDelegate scoreLoad;

View File

@ -60,6 +60,8 @@ namespace osu.Game
protected RulesetConfigCache RulesetConfigCache;
protected APIAccess API;
protected MenuCursorContainer MenuCursorContainer;
private Container content;
@ -146,14 +148,14 @@ namespace osu.Game
dependencies.Cache(SkinManager = new SkinManager(Host.Storage, contextFactory, Host, Audio));
dependencies.CacheAs<ISkinSource>(SkinManager);
var api = new APIAccess(LocalConfig);
API = new APIAccess(LocalConfig);
dependencies.Cache(api);
dependencies.CacheAs<IAPIProvider>(api);
dependencies.Cache(API);
dependencies.CacheAs<IAPIProvider>(API);
dependencies.Cache(RulesetStore = new RulesetStore(contextFactory));
dependencies.Cache(FileStore = new FileStore(contextFactory, Host.Storage));
dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory, RulesetStore, api, Audio, Host));
dependencies.Cache(BeatmapManager = new BeatmapManager(Host.Storage, contextFactory, RulesetStore, API, Audio, Host));
dependencies.Cache(ScoreManager = new ScoreManager(RulesetStore, BeatmapManager, Host.Storage, contextFactory, Host));
dependencies.Cache(KeyBindingStore = new KeyBindingStore(contextFactory, RulesetStore));
dependencies.Cache(SettingsStore = new SettingsStore(contextFactory));
@ -177,7 +179,7 @@ namespace osu.Game
FileStore.Cleanup();
AddInternal(api);
AddInternal(API);
GlobalActionContainer globalBinding;

View File

@ -20,7 +20,7 @@ namespace osu.Game.Overlays.AccountCreation
private OsuTextFlowContainer multiAccountExplanationText;
private LinkFlowContainer furtherAssistance;
private const string help_centre_url = "https://osu.ppy.sh/help/wiki/Help_Centre#login";
private const string help_centre_url = "/help/wiki/Help_Centre#login";
[BackgroundDependencyLoader(true)]
private void load(OsuColour colours, APIAccess api, OsuGame game)