1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-14 16:37:26 +08:00

Enable NRT while we're here

This commit is contained in:
Dan Balasescu 2024-08-13 16:08:06 +09:00
parent ca91726190
commit 3f02869bcc
No known key found for this signature in database

View File

@ -1,8 +1,6 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
#nullable disable
using System; using System;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
@ -25,32 +23,35 @@ namespace osu.Game.Overlays
public string CurrentPath => path.Value; public string CurrentPath => path.Value;
private readonly Bindable<string> path = new Bindable<string>(INDEX_PATH); private readonly Bindable<string> path = new Bindable<string>(INDEX_PATH);
private readonly Bindable<APIWikiPage?> wikiData = new Bindable<APIWikiPage?>();
private readonly Bindable<APIWikiPage> wikiData = new Bindable<APIWikiPage>(); private readonly IBindable<Language> language = new Bindable<Language>();
[Resolved] [Resolved]
private IAPIProvider api { get; set; } private IAPIProvider api { get; set; } = null!;
private GetWikiRequest request; [Resolved]
private OsuGameBase game { get; set; } = null!;
private CancellationTokenSource cancellationToken; private GetWikiRequest? request;
private CancellationTokenSource? cancellationToken;
private WikiArticlePage? articlePage;
private bool displayUpdateRequired = true; private bool displayUpdateRequired = true;
private WikiArticlePage articlePage;
private Bindable<Language> language;
public WikiOverlay() public WikiOverlay()
: base(OverlayColourScheme.Orange, false) : base(OverlayColourScheme.Orange, false)
{ {
} }
[BackgroundDependencyLoader] protected override void LoadComplete()
private void load(OsuGameBase game)
{ {
// Fetch current language on load for translated pages (if possible) base.LoadComplete();
language = game.CurrentLanguage.GetBoundCopy();
path.BindValueChanged(onPathChanged);
wikiData.BindTo(Header.WikiPageData);
language.BindTo(game.CurrentLanguage);
language.BindValueChanged(onLangChanged);
} }
public void ShowPage(string pagePath = INDEX_PATH) public void ShowPage(string pagePath = INDEX_PATH)
@ -65,15 +66,6 @@ namespace osu.Game.Overlays
ShowParentPage = showParentPage, ShowParentPage = showParentPage,
}; };
protected override void LoadComplete()
{
base.LoadComplete();
path.BindValueChanged(onPathChanged);
language.BindValueChanged(onLangChanged);
wikiData.BindTo(Header.WikiPageData);
}
protected override void PopIn() protected override void PopIn()
{ {
base.PopIn(); base.PopIn();