Enable NRT in user profile overlay

This commit is contained in:
Bartłomiej Dach
2022-12-30 13:17:59 +01:00
parent b97d4b571e
commit 88e90d5fa0
55 changed files with 172 additions and 279 deletions

View File

@ -1,8 +1,6 @@
// 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.
#nullable disable
using System;
using Humanizer;
using osu.Framework.Allocation;
@ -25,15 +23,15 @@ namespace osu.Game.Overlays.Profile.Header
{
public partial class BottomHeaderContainer : CompositeDrawable
{
public readonly Bindable<APIUser> User = new Bindable<APIUser>();
public readonly Bindable<APIUser?> User = new Bindable<APIUser?>();
private LinkFlowContainer topLinkContainer;
private LinkFlowContainer bottomLinkContainer;
private LinkFlowContainer topLinkContainer = null!;
private LinkFlowContainer bottomLinkContainer = null!;
private Color4 iconColour;
[Resolved]
private IAPIProvider api { get; set; }
private IAPIProvider api { get; set; } = null!;
public BottomHeaderContainer()
{
@ -78,7 +76,7 @@ namespace osu.Game.Overlays.Profile.Header
User.BindValueChanged(user => updateDisplay(user.NewValue));
}
private void updateDisplay(APIUser user)
private void updateDisplay(APIUser? user)
{
topLinkContainer.Clear();
bottomLinkContainer.Clear();
@ -164,7 +162,7 @@ namespace osu.Game.Overlays.Profile.Header
private void addSpacer(OsuTextFlowContainer textFlow) => textFlow.AddArbitraryDrawable(new Container { Width = 15 });
private bool tryAddInfo(IconUsage icon, string content, string link = null)
private bool tryAddInfo(IconUsage icon, string content, string? link = null)
{
if (string.IsNullOrEmpty(content)) return false;