From ae8f6967d7121a6cb00919d13ebdd067af7b3430 Mon Sep 17 00:00:00 2001 From: CloneWith Date: Wed, 1 Jan 2025 23:44:08 +0800 Subject: [PATCH] Restore to the last available wiki page after changing UI language --- osu.Game/Overlays/WikiOverlay.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/WikiOverlay.cs b/osu.Game/Overlays/WikiOverlay.cs index 5149792bbb..31485e56ac 100644 --- a/osu.Game/Overlays/WikiOverlay.cs +++ b/osu.Game/Overlays/WikiOverlay.cs @@ -38,6 +38,8 @@ namespace osu.Game.Overlays private bool displayUpdateRequired = true; + private string lastValidPath = INDEX_PATH; + public WikiOverlay() : base(OverlayColourScheme.Orange, false) { @@ -145,12 +147,13 @@ namespace osu.Game.Overlays private void onLangChanged(ValueChangedEvent e) { // Path unmodified, just reload the page with new language value. - loadPage(path.Value, e.NewValue); + loadPage(path.Value == "error" ? lastValidPath : path.Value, e.NewValue); } private void onSuccess(APIWikiPage response) { wikiData.Value = response; + lastValidPath = response.Path; path.Value = response.Path; if (response.Layout.Equals(INDEX_PATH, StringComparison.OrdinalIgnoreCase))