mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 22:33:05 +08:00
Avoid showing the external link warning
This commit is contained in:
parent
31abb372e5
commit
465e7d29fe
@ -157,7 +157,7 @@ namespace osu.Game.Database
|
|||||||
Text = "IMPORTANT: During data migration, some of your data could not be successfully migrated. The previous version has been backed up.\n\nFor further assistance, please open a discussion on github and attach your backup files (click to get started).",
|
Text = "IMPORTANT: During data migration, some of your data could not be successfully migrated. The previous version has been backed up.\n\nFor further assistance, please open a discussion on github and attach your backup files (click to get started).",
|
||||||
Activated = () =>
|
Activated = () =>
|
||||||
{
|
{
|
||||||
game.OpenUrlExternally(@"https://github.com/ppy/osu/discussions/new?title=Realm%20migration%20issue&body=Please%20drag%20the%20""attach_me.zip""%20file%20here!&category=q-a");
|
game.OpenUrlExternally(@"https://github.com/ppy/osu/discussions/new?title=Realm%20migration%20issue&body=Please%20drag%20the%20""attach_me.zip""%20file%20here!&category=q-a", true);
|
||||||
|
|
||||||
const string attachment_filename = "attach_me.zip";
|
const string attachment_filename = "attach_me.zip";
|
||||||
const string backup_folder = "backups";
|
const string backup_folder = "backups";
|
||||||
|
@ -27,9 +27,9 @@ namespace osu.Game.Online.Chat
|
|||||||
externalLinkWarning = config.GetBindable<bool>(OsuSetting.ExternalLinkWarning);
|
externalLinkWarning = config.GetBindable<bool>(OsuSetting.ExternalLinkWarning);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OpenUrlExternally(string url)
|
public void OpenUrlExternally(string url, bool bypassWarning = false)
|
||||||
{
|
{
|
||||||
if (externalLinkWarning.Value)
|
if (!bypassWarning && externalLinkWarning.Value)
|
||||||
dialogOverlay.Push(new ExternalLinkDialog(url, () => host.OpenUrlExternally(url)));
|
dialogOverlay.Push(new ExternalLinkDialog(url, () => host.OpenUrlExternally(url)));
|
||||||
else
|
else
|
||||||
host.OpenUrlExternally(url);
|
host.OpenUrlExternally(url);
|
||||||
|
@ -357,12 +357,12 @@ namespace osu.Game
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
public void OpenUrlExternally(string url) => waitForReady(() => externalLinkOpener, _ =>
|
public void OpenUrlExternally(string url, bool bypassExternalUrlWarning = false) => waitForReady(() => externalLinkOpener, _ =>
|
||||||
{
|
{
|
||||||
if (url.StartsWith('/'))
|
if (url.StartsWith('/'))
|
||||||
url = $"{API.APIEndpointUrl}{url}";
|
url = $"{API.APIEndpointUrl}{url}";
|
||||||
|
|
||||||
externalLinkOpener.OpenUrlExternally(url);
|
externalLinkOpener.OpenUrlExternally(url, bypassExternalUrlWarning);
|
||||||
});
|
});
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user