1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-13 20:07:25 +08:00

Rename things yet again

This commit is contained in:
Bartłomiej Dach 2023-01-10 19:24:54 +01:00
parent 502478614a
commit 62e12277d8
No known key found for this signature in database
34 changed files with 107 additions and 107 deletions

View File

@ -38,8 +38,8 @@ namespace osu.Game.Tests.Visual.Online
Child = section = new HistoricalSection(), Child = section = new HistoricalSection(),
}); });
AddStep("Show peppy", () => section.UserProfileData.Value = new UserProfileData(new APIUser { Id = 2 })); AddStep("Show peppy", () => section.User.Value = new UserProfileData(new APIUser { Id = 2 }));
AddStep("Show WubWoofWolf", () => section.UserProfileData.Value = new UserProfileData(new APIUser { Id = 39828 })); AddStep("Show WubWoofWolf", () => section.User.Value = new UserProfileData(new APIUser { Id = 39828 }));
} }
} }
} }

View File

@ -21,7 +21,7 @@ namespace osu.Game.Tests.Visual.Online
[Cached] [Cached]
private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Red); private readonly OverlayColourProvider colourProvider = new OverlayColourProvider(OverlayColourScheme.Red);
private readonly Bindable<UserProfileData?> userProfileData = new Bindable<UserProfileData?>(); private readonly Bindable<UserProfileData?> user = new Bindable<UserProfileData?>();
private readonly PlayHistorySubsection section; private readonly PlayHistorySubsection section;
public TestScenePlayHistorySubsection() public TestScenePlayHistorySubsection()
@ -33,7 +33,7 @@ namespace osu.Game.Tests.Visual.Online
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background4 Colour = colourProvider.Background4
}, },
section = new PlayHistorySubsection(userProfileData) section = new PlayHistorySubsection(user)
{ {
Anchor = Anchor.Centre, Anchor = Anchor.Centre,
Origin = Anchor.Centre Origin = Anchor.Centre
@ -44,49 +44,49 @@ namespace osu.Game.Tests.Visual.Online
[Test] [Test]
public void TestNullValues() public void TestNullValues()
{ {
AddStep("Load user", () => userProfileData.Value = new UserProfileData(user_with_null_values)); AddStep("Load user", () => user.Value = new UserProfileData(user_with_null_values));
AddAssert("Section is hidden", () => section.Alpha == 0); AddAssert("Section is hidden", () => section.Alpha == 0);
} }
[Test] [Test]
public void TestEmptyValues() public void TestEmptyValues()
{ {
AddStep("Load user", () => userProfileData.Value = new UserProfileData(user_with_empty_values)); AddStep("Load user", () => user.Value = new UserProfileData(user_with_empty_values));
AddAssert("Section is hidden", () => section.Alpha == 0); AddAssert("Section is hidden", () => section.Alpha == 0);
} }
[Test] [Test]
public void TestOneValue() public void TestOneValue()
{ {
AddStep("Load user", () => userProfileData.Value = new UserProfileData(user_with_one_value)); AddStep("Load user", () => user.Value = new UserProfileData(user_with_one_value));
AddAssert("Section is hidden", () => section.Alpha == 0); AddAssert("Section is hidden", () => section.Alpha == 0);
} }
[Test] [Test]
public void TestTwoValues() public void TestTwoValues()
{ {
AddStep("Load user", () => userProfileData.Value = new UserProfileData(user_with_two_values)); AddStep("Load user", () => user.Value = new UserProfileData(user_with_two_values));
AddAssert("Section is visible", () => section.Alpha == 1); AddAssert("Section is visible", () => section.Alpha == 1);
} }
[Test] [Test]
public void TestConstantValues() public void TestConstantValues()
{ {
AddStep("Load user", () => userProfileData.Value = new UserProfileData(user_with_constant_values)); AddStep("Load user", () => user.Value = new UserProfileData(user_with_constant_values));
AddAssert("Section is visible", () => section.Alpha == 1); AddAssert("Section is visible", () => section.Alpha == 1);
} }
[Test] [Test]
public void TestConstantZeroValues() public void TestConstantZeroValues()
{ {
AddStep("Load user", () => userProfileData.Value = new UserProfileData(user_with_zero_values)); AddStep("Load user", () => user.Value = new UserProfileData(user_with_zero_values));
AddAssert("Section is visible", () => section.Alpha == 1); AddAssert("Section is visible", () => section.Alpha == 1);
} }
[Test] [Test]
public void TestFilledValues() public void TestFilledValues()
{ {
AddStep("Load user", () => userProfileData.Value = new UserProfileData(user_with_filled_values)); AddStep("Load user", () => user.Value = new UserProfileData(user_with_filled_values));
AddAssert("Section is visible", () => section.Alpha == 1); AddAssert("Section is visible", () => section.Alpha == 1);
AddAssert("Array length is the same", () => user_with_filled_values.MonthlyPlayCounts.Length == getChartValuesLength()); AddAssert("Array length is the same", () => user_with_filled_values.MonthlyPlayCounts.Length == getChartValuesLength());
} }
@ -94,7 +94,7 @@ namespace osu.Game.Tests.Visual.Online
[Test] [Test]
public void TestMissingValues() public void TestMissingValues()
{ {
AddStep("Load user", () => userProfileData.Value = new UserProfileData(user_with_missing_values)); AddStep("Load user", () => user.Value = new UserProfileData(user_with_missing_values));
AddAssert("Section is visible", () => section.Alpha == 1); AddAssert("Section is visible", () => section.Alpha == 1);
AddAssert("Array length is 7", () => getChartValuesLength() == 7); AddAssert("Array length is 7", () => getChartValuesLength() == 7);
} }

View File

@ -29,13 +29,13 @@ namespace osu.Game.Tests.Visual.Online
[Test] [Test]
public void TestBasic() public void TestBasic()
{ {
AddStep("Show example user", () => header.UserProfileData.Value = new UserProfileData(TestSceneUserProfileOverlay.TEST_USER)); AddStep("Show example user", () => header.User.Value = new UserProfileData(TestSceneUserProfileOverlay.TEST_USER));
} }
[Test] [Test]
public void TestOnlineState() public void TestOnlineState()
{ {
AddStep("Show online user", () => header.UserProfileData.Value = new UserProfileData(new APIUser AddStep("Show online user", () => header.User.Value = new UserProfileData(new APIUser
{ {
Id = 1001, Id = 1001,
Username = "IAmOnline", Username = "IAmOnline",
@ -43,7 +43,7 @@ namespace osu.Game.Tests.Visual.Online
IsOnline = true, IsOnline = true,
})); }));
AddStep("Show offline user", () => header.UserProfileData.Value = new UserProfileData(new APIUser AddStep("Show offline user", () => header.User.Value = new UserProfileData(new APIUser
{ {
Id = 1002, Id = 1002,
Username = "IAmOffline", Username = "IAmOffline",
@ -55,7 +55,7 @@ namespace osu.Game.Tests.Visual.Online
[Test] [Test]
public void TestRankedState() public void TestRankedState()
{ {
AddStep("Show ranked user", () => header.UserProfileData.Value = new UserProfileData(new APIUser AddStep("Show ranked user", () => header.User.Value = new UserProfileData(new APIUser
{ {
Id = 2001, Id = 2001,
Username = "RankedUser", Username = "RankedUser",
@ -72,7 +72,7 @@ namespace osu.Game.Tests.Visual.Online
} }
})); }));
AddStep("Show unranked user", () => header.UserProfileData.Value = new UserProfileData(new APIUser AddStep("Show unranked user", () => header.User.Value = new UserProfileData(new APIUser
{ {
Id = 2002, Id = 2002,
Username = "UnrankedUser", Username = "UnrankedUser",

View File

@ -45,7 +45,7 @@ namespace osu.Game.Tests.Visual.Online
} }
}); });
AddStep("Show cookiezi", () => ranks.UserProfileData.Value = new UserProfileData(new APIUser { Id = 124493 })); AddStep("Show cookiezi", () => ranks.User.Value = new UserProfileData(new APIUser { Id = 124493 }));
} }
} }
} }

View File

@ -23,7 +23,7 @@ namespace osu.Game.Overlays.Profile.Header
{ {
public partial class BottomHeaderContainer : CompositeDrawable public partial class BottomHeaderContainer : CompositeDrawable
{ {
public readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
private LinkFlowContainer topLinkContainer = null!; private LinkFlowContainer topLinkContainer = null!;
private LinkFlowContainer bottomLinkContainer = null!; private LinkFlowContainer bottomLinkContainer = null!;
@ -73,7 +73,7 @@ namespace osu.Game.Overlays.Profile.Header
} }
}; };
UserProfileData.BindValueChanged(data => updateDisplay(data.NewValue?.User)); User.BindValueChanged(user => updateDisplay(user.NewValue?.User));
} }
private void updateDisplay(APIUser? user) private void updateDisplay(APIUser? user)

View File

@ -18,7 +18,7 @@ namespace osu.Game.Overlays.Profile.Header
public partial class CentreHeaderContainer : CompositeDrawable public partial class CentreHeaderContainer : CompositeDrawable
{ {
public readonly BindableBool DetailsVisible = new BindableBool(true); public readonly BindableBool DetailsVisible = new BindableBool(true);
public readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
private OverlinedInfoContainer hiddenDetailGlobal = null!; private OverlinedInfoContainer hiddenDetailGlobal = null!;
private OverlinedInfoContainer hiddenDetailCountry = null!; private OverlinedInfoContainer hiddenDetailCountry = null!;
@ -53,15 +53,15 @@ namespace osu.Game.Overlays.Profile.Header
{ {
new FollowersButton new FollowersButton
{ {
UserProfileData = { BindTarget = UserProfileData } User = { BindTarget = User }
}, },
new MappingSubscribersButton new MappingSubscribersButton
{ {
UserProfileData = { BindTarget = UserProfileData } User = { BindTarget = User }
}, },
new MessageUserButton new MessageUserButton
{ {
UserProfileData = { BindTarget = UserProfileData } User = { BindTarget = User }
}, },
} }
}, },
@ -92,7 +92,7 @@ namespace osu.Game.Overlays.Profile.Header
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
Size = new Vector2(40), Size = new Vector2(40),
UserProfileData = { BindTarget = UserProfileData } User = { BindTarget = User }
}, },
expandedDetailContainer = new Container expandedDetailContainer = new Container
{ {
@ -104,7 +104,7 @@ namespace osu.Game.Overlays.Profile.Header
Child = new LevelProgressBar Child = new LevelProgressBar
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
UserProfileData = { BindTarget = UserProfileData } User = { BindTarget = User }
} }
}, },
hiddenDetailContainer = new FillFlowContainer hiddenDetailContainer = new FillFlowContainer
@ -141,7 +141,7 @@ namespace osu.Game.Overlays.Profile.Header
expandedDetailContainer.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint); expandedDetailContainer.FadeTo(visible.NewValue ? 1 : 0, 200, Easing.OutQuint);
}); });
UserProfileData.BindValueChanged(data => updateDisplay(data.NewValue?.User)); User.BindValueChanged(user => updateDisplay(user.NewValue?.User));
} }
private void updateDisplay(APIUser? user) private void updateDisplay(APIUser? user)

View File

@ -11,7 +11,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
{ {
public partial class FollowersButton : ProfileHeaderStatisticsButton public partial class FollowersButton : ProfileHeaderStatisticsButton
{ {
public readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
public override LocalisableString TooltipText => FriendsStrings.ButtonsDisabled; public override LocalisableString TooltipText => FriendsStrings.ButtonsDisabled;
@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
private void load() private void load()
{ {
// todo: when friending/unfriending is implemented, the APIAccess.Friends list should be updated accordingly. // todo: when friending/unfriending is implemented, the APIAccess.Friends list should be updated accordingly.
UserProfileData.BindValueChanged(data => SetValue(data.NewValue?.User.FollowerCount ?? 0), true); User.BindValueChanged(user => SetValue(user.NewValue?.User.FollowerCount ?? 0), true);
} }
} }
} }

View File

@ -18,7 +18,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
{ {
public partial class LevelBadge : CompositeDrawable, IHasTooltip public partial class LevelBadge : CompositeDrawable, IHasTooltip
{ {
public readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
public LocalisableString TooltipText { get; private set; } public LocalisableString TooltipText { get; private set; }
@ -48,7 +48,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
} }
}; };
UserProfileData.BindValueChanged(data => updateLevel(data.NewValue?.User)); User.BindValueChanged(user => updateLevel(user.NewValue?.User));
} }
private void updateLevel(APIUser? user) private void updateLevel(APIUser? user)

View File

@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
{ {
public partial class LevelProgressBar : CompositeDrawable, IHasTooltip public partial class LevelProgressBar : CompositeDrawable, IHasTooltip
{ {
public readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
public LocalisableString TooltipText { get; } public LocalisableString TooltipText { get; }
@ -56,7 +56,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
} }
}; };
UserProfileData.BindValueChanged(data => updateProgress(data.NewValue?.User)); User.BindValueChanged(user => updateProgress(user.NewValue?.User));
} }
private void updateProgress(APIUser? user) private void updateProgress(APIUser? user)

View File

@ -11,7 +11,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
{ {
public partial class MappingSubscribersButton : ProfileHeaderStatisticsButton public partial class MappingSubscribersButton : ProfileHeaderStatisticsButton
{ {
public readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
public override LocalisableString TooltipText => FollowsStrings.MappingFollowers; public override LocalisableString TooltipText => FollowsStrings.MappingFollowers;
@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load() private void load()
{ {
UserProfileData.BindValueChanged(data => SetValue(data.NewValue?.User.MappingFollowerCount ?? 0), true); User.BindValueChanged(user => SetValue(user.NewValue?.User.MappingFollowerCount ?? 0), true);
} }
} }
} }

View File

@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
{ {
public partial class MessageUserButton : ProfileHeaderButton public partial class MessageUserButton : ProfileHeaderButton
{ {
public readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
public override LocalisableString TooltipText => UsersStrings.CardSendMessage; public override LocalisableString TooltipText => UsersStrings.CardSendMessage;
@ -48,12 +48,12 @@ namespace osu.Game.Overlays.Profile.Header.Components
{ {
if (!Content.IsPresent) return; if (!Content.IsPresent) return;
channelManager?.OpenPrivateChannel(UserProfileData.Value?.User); channelManager?.OpenPrivateChannel(User.Value?.User);
userOverlay?.Hide(); userOverlay?.Hide();
chatOverlay?.Show(); chatOverlay?.Show();
}; };
UserProfileData.ValueChanged += e => User.ValueChanged += e =>
{ {
var user = e.NewValue?.User; var user = e.NewValue?.User;
Content.Alpha = user != null && !user.PMFriendsOnly && apiProvider.LocalUser.Value.Id != user.Id ? 1 : 0; Content.Alpha = user != null && !user.PMFriendsOnly && apiProvider.LocalUser.Value.Id != user.Id ? 1 : 0;

View File

@ -13,7 +13,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
{ {
public partial class OverlinedTotalPlayTime : CompositeDrawable, IHasTooltip public partial class OverlinedTotalPlayTime : CompositeDrawable, IHasTooltip
{ {
public readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
public LocalisableString TooltipText { get; set; } public LocalisableString TooltipText { get; set; }
@ -35,12 +35,12 @@ namespace osu.Game.Overlays.Profile.Header.Components
LineColour = colourProvider.Highlight1, LineColour = colourProvider.Highlight1,
}; };
UserProfileData.BindValueChanged(updateTime, true); User.BindValueChanged(updateTime, true);
} }
private void updateTime(ValueChangedEvent<UserProfileData?> data) private void updateTime(ValueChangedEvent<UserProfileData?> user)
{ {
int? playTime = data.NewValue?.User.Statistics?.PlayTime; int? playTime = user.NewValue?.User.Statistics?.PlayTime;
TooltipText = (playTime ?? 0) / 3600 + " hours"; TooltipText = (playTime ?? 0) / 3600 + " hours";
info.Content = formatTime(playTime); info.Content = formatTime(playTime);
} }

View File

@ -29,7 +29,7 @@ namespace osu.Game.Overlays.Profile.Header
private FillFlowContainer? fillFlow; private FillFlowContainer? fillFlow;
private RankGraph rankGraph = null!; private RankGraph rankGraph = null!;
public readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
private bool expanded = true; private bool expanded = true;
@ -60,7 +60,7 @@ namespace osu.Game.Overlays.Profile.Header
{ {
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
UserProfileData.ValueChanged += e => updateDisplay(e.NewValue); User.ValueChanged += e => updateDisplay(e.NewValue);
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {
@ -98,7 +98,7 @@ namespace osu.Game.Overlays.Profile.Header
{ {
new OverlinedTotalPlayTime new OverlinedTotalPlayTime
{ {
UserProfileData = { BindTarget = UserProfileData } User = { BindTarget = User }
}, },
medalInfo = new OverlinedInfoContainer medalInfo = new OverlinedInfoContainer
{ {

View File

@ -20,14 +20,14 @@ namespace osu.Game.Overlays.Profile.Header
{ {
private FillFlowContainer badgeFlowContainer = null!; private FillFlowContainer badgeFlowContainer = null!;
public readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OverlayColourProvider colourProvider) private void load(OverlayColourProvider colourProvider)
{ {
Alpha = 0; Alpha = 0;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
UserProfileData.ValueChanged += e => updateDisplay(e.NewValue?.User); User.ValueChanged += e => updateDisplay(e.NewValue?.User);
InternalChildren = new Drawable[] InternalChildren = new Drawable[]
{ {

View File

@ -26,7 +26,7 @@ namespace osu.Game.Overlays.Profile.Header
{ {
private const float avatar_size = 110; private const float avatar_size = 110;
public readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
[Resolved] [Resolved]
private IAPIProvider api { get; set; } = null!; private IAPIProvider api { get; set; } = null!;
@ -170,7 +170,7 @@ namespace osu.Game.Overlays.Profile.Header
} }
}; };
UserProfileData.BindValueChanged(data => updateUser(data.NewValue)); User.BindValueChanged(user => updateUser(user.NewValue));
} }
private void updateUser(UserProfileData? data) private void updateUser(UserProfileData? data)

View File

@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Profile
{ {
private UserCoverBackground coverContainer = null!; private UserCoverBackground coverContainer = null!;
public Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); public Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
private CentreHeaderContainer centreHeaderContainer; private CentreHeaderContainer centreHeaderContainer;
private DetailHeaderContainer detailHeaderContainer; private DetailHeaderContainer detailHeaderContainer;
@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Profile
{ {
ContentSidePadding = UserProfileOverlay.CONTENT_X_MARGIN; ContentSidePadding = UserProfileOverlay.CONTENT_X_MARGIN;
UserProfileData.ValueChanged += e => updateDisplay(e.NewValue); User.ValueChanged += e => updateDisplay(e.NewValue);
TabControl.AddItem(LayoutStrings.HeaderUsersShow); TabControl.AddItem(LayoutStrings.HeaderUsersShow);
@ -72,34 +72,34 @@ namespace osu.Game.Overlays.Profile
new TopHeaderContainer new TopHeaderContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
UserProfileData = { BindTarget = UserProfileData }, User = { BindTarget = User },
}, },
centreHeaderContainer = new CentreHeaderContainer centreHeaderContainer = new CentreHeaderContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
UserProfileData = { BindTarget = UserProfileData }, User = { BindTarget = User },
}, },
detailHeaderContainer = new DetailHeaderContainer detailHeaderContainer = new DetailHeaderContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
UserProfileData = { BindTarget = UserProfileData }, User = { BindTarget = User },
}, },
new MedalHeaderContainer new MedalHeaderContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
UserProfileData = { BindTarget = UserProfileData }, User = { BindTarget = User },
}, },
new BottomHeaderContainer new BottomHeaderContainer
{ {
RelativeSizeAxes = Axes.X, RelativeSizeAxes = Axes.X,
UserProfileData = { BindTarget = UserProfileData }, User = { BindTarget = User },
}, },
} }
}; };
protected override OverlayTitle CreateTitle() => new ProfileHeaderTitle(); protected override OverlayTitle CreateTitle() => new ProfileHeaderTitle();
private void updateDisplay(UserProfileData? data) => coverContainer.User = data?.User; private void updateDisplay(UserProfileData? user) => coverContainer.User = user?.User;
private partial class ProfileHeaderTitle : OverlayTitle private partial class ProfileHeaderTitle : OverlayTitle
{ {

View File

@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Profile
protected override Container<Drawable> Content => content; protected override Container<Drawable> Content => content;
public readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
protected ProfileSection() protected ProfileSection()
{ {

View File

@ -22,8 +22,8 @@ namespace osu.Game.Overlays.Profile.Sections.Beatmaps
protected override int InitialItemsCount => type == BeatmapSetType.Graveyard ? 2 : 6; protected override int InitialItemsCount => type == BeatmapSetType.Graveyard ? 2 : 6;
public PaginatedBeatmapContainer(BeatmapSetType type, Bindable<UserProfileData?> userProfileData, LocalisableString headerText) public PaginatedBeatmapContainer(BeatmapSetType type, Bindable<UserProfileData?> user, LocalisableString headerText)
: base(userProfileData, headerText) : base(user, headerText)
{ {
this.type = type; this.type = type;
} }

View File

@ -18,13 +18,13 @@ namespace osu.Game.Overlays.Profile.Sections
{ {
Children = new[] Children = new[]
{ {
new PaginatedBeatmapContainer(BeatmapSetType.Favourite, UserProfileData, UsersStrings.ShowExtraBeatmapsFavouriteTitle), new PaginatedBeatmapContainer(BeatmapSetType.Favourite, User, UsersStrings.ShowExtraBeatmapsFavouriteTitle),
new PaginatedBeatmapContainer(BeatmapSetType.Ranked, UserProfileData, UsersStrings.ShowExtraBeatmapsRankedTitle), new PaginatedBeatmapContainer(BeatmapSetType.Ranked, User, UsersStrings.ShowExtraBeatmapsRankedTitle),
new PaginatedBeatmapContainer(BeatmapSetType.Loved, UserProfileData, UsersStrings.ShowExtraBeatmapsLovedTitle), new PaginatedBeatmapContainer(BeatmapSetType.Loved, User, UsersStrings.ShowExtraBeatmapsLovedTitle),
new PaginatedBeatmapContainer(BeatmapSetType.Guest, UserProfileData, UsersStrings.ShowExtraBeatmapsGuestTitle), new PaginatedBeatmapContainer(BeatmapSetType.Guest, User, UsersStrings.ShowExtraBeatmapsGuestTitle),
new PaginatedBeatmapContainer(BeatmapSetType.Pending, UserProfileData, UsersStrings.ShowExtraBeatmapsPendingTitle), new PaginatedBeatmapContainer(BeatmapSetType.Pending, User, UsersStrings.ShowExtraBeatmapsPendingTitle),
new PaginatedBeatmapContainer(BeatmapSetType.Graveyard, UserProfileData, UsersStrings.ShowExtraBeatmapsGraveyardTitle), new PaginatedBeatmapContainer(BeatmapSetType.Graveyard, User, UsersStrings.ShowExtraBeatmapsGraveyardTitle),
new PaginatedBeatmapContainer(BeatmapSetType.Nominated, UserProfileData, UsersStrings.ShowExtraBeatmapsNominatedTitle), new PaginatedBeatmapContainer(BeatmapSetType.Nominated, User, UsersStrings.ShowExtraBeatmapsNominatedTitle),
}; };
} }
} }

View File

@ -20,8 +20,8 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
/// </summary> /// </summary>
protected abstract LocalisableString GraphCounterName { get; } protected abstract LocalisableString GraphCounterName { get; }
protected ChartProfileSubsection(Bindable<UserProfileData?> userProfileData, LocalisableString headerText) protected ChartProfileSubsection(Bindable<UserProfileData?> user, LocalisableString headerText)
: base(userProfileData, headerText) : base(user, headerText)
{ {
} }
@ -41,7 +41,7 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
UserProfileData.BindValueChanged(onUserChanged, true); User.BindValueChanged(onUserChanged, true);
} }
private void onUserChanged(ValueChangedEvent<UserProfileData?> e) private void onUserChanged(ValueChangedEvent<UserProfileData?> e)

View File

@ -16,8 +16,8 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
{ {
public partial class PaginatedMostPlayedBeatmapContainer : PaginatedProfileSubsection<APIUserMostPlayedBeatmap> public partial class PaginatedMostPlayedBeatmapContainer : PaginatedProfileSubsection<APIUserMostPlayedBeatmap>
{ {
public PaginatedMostPlayedBeatmapContainer(Bindable<UserProfileData?> userProfileData) public PaginatedMostPlayedBeatmapContainer(Bindable<UserProfileData?> user)
: base(userProfileData, UsersStrings.ShowExtraHistoricalMostPlayedTitle) : base(user, UsersStrings.ShowExtraHistoricalMostPlayedTitle)
{ {
} }

View File

@ -12,8 +12,8 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
{ {
protected override LocalisableString GraphCounterName => UsersStrings.ShowExtraHistoricalMonthlyPlaycountsCountLabel; protected override LocalisableString GraphCounterName => UsersStrings.ShowExtraHistoricalMonthlyPlaycountsCountLabel;
public PlayHistorySubsection(Bindable<UserProfileData?> userProfileData) public PlayHistorySubsection(Bindable<UserProfileData?> user)
: base(userProfileData, UsersStrings.ShowExtraHistoricalMonthlyPlaycountsTitle) : base(user, UsersStrings.ShowExtraHistoricalMonthlyPlaycountsTitle)
{ {
} }

View File

@ -12,8 +12,8 @@ namespace osu.Game.Overlays.Profile.Sections.Historical
{ {
protected override LocalisableString GraphCounterName => UsersStrings.ShowExtraHistoricalReplaysWatchedCountsCountLabel; protected override LocalisableString GraphCounterName => UsersStrings.ShowExtraHistoricalReplaysWatchedCountsCountLabel;
public ReplaysSubsection(Bindable<UserProfileData?> userProfileData) public ReplaysSubsection(Bindable<UserProfileData?> user)
: base(userProfileData, UsersStrings.ShowExtraHistoricalReplaysWatchedCountsTitle) : base(user, UsersStrings.ShowExtraHistoricalReplaysWatchedCountsTitle)
{ {
} }

View File

@ -20,10 +20,10 @@ namespace osu.Game.Overlays.Profile.Sections
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new PlayHistorySubsection(UserProfileData), new PlayHistorySubsection(User),
new PaginatedMostPlayedBeatmapContainer(UserProfileData), new PaginatedMostPlayedBeatmapContainer(User),
new PaginatedScoreContainer(ScoreType.Recent, UserProfileData, UsersStrings.ShowExtraHistoricalRecentPlaysTitle), new PaginatedScoreContainer(ScoreType.Recent, User, UsersStrings.ShowExtraHistoricalRecentPlaysTitle),
new ReplaysSubsection(UserProfileData) new ReplaysSubsection(User)
}; };
} }
} }

View File

@ -19,11 +19,11 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
{ {
public partial class KudosuInfo : Container public partial class KudosuInfo : Container
{ {
private readonly Bindable<UserProfileData?> userProfileData = new Bindable<UserProfileData?>(); private readonly Bindable<UserProfileData?> user = new Bindable<UserProfileData?>();
public KudosuInfo(Bindable<UserProfileData?> userProfileData) public KudosuInfo(Bindable<UserProfileData?> user)
{ {
this.userProfileData.BindTo(userProfileData); this.user.BindTo(user);
CountSection total; CountSection total;
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y; AutoSizeAxes = Axes.Y;
@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
CornerRadius = 3; CornerRadius = 3;
Child = total = new CountTotal(); Child = total = new CountTotal();
this.userProfileData.ValueChanged += u => total.Count = u.NewValue?.User.Kudosu.Total ?? 0; this.user.ValueChanged += u => total.Count = u.NewValue?.User.Kudosu.Total ?? 0;
} }
protected override bool OnClick(ClickEvent e) => true; protected override bool OnClick(ClickEvent e) => true;

View File

@ -14,8 +14,8 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
{ {
public partial class PaginatedKudosuHistoryContainer : PaginatedProfileSubsection<APIKudosuHistory> public partial class PaginatedKudosuHistoryContainer : PaginatedProfileSubsection<APIKudosuHistory>
{ {
public PaginatedKudosuHistoryContainer(Bindable<UserProfileData?> userProfileData) public PaginatedKudosuHistoryContainer(Bindable<UserProfileData?> user)
: base(userProfileData, missingText: UsersStrings.ShowExtraKudosuEntryEmpty) : base(user, missingText: UsersStrings.ShowExtraKudosuEntryEmpty)
{ {
} }

View File

@ -18,8 +18,8 @@ namespace osu.Game.Overlays.Profile.Sections
{ {
Children = new Drawable[] Children = new Drawable[]
{ {
new KudosuInfo(UserProfileData), new KudosuInfo(User),
new PaginatedKudosuHistoryContainer(UserProfileData), new PaginatedKudosuHistoryContainer(User),
}; };
} }
} }

View File

@ -46,8 +46,8 @@ namespace osu.Game.Overlays.Profile.Sections
private OsuSpriteText missing = null!; private OsuSpriteText missing = null!;
private readonly LocalisableString? missingText; private readonly LocalisableString? missingText;
protected PaginatedProfileSubsection(Bindable<UserProfileData?> userProfileData, LocalisableString? headerText = null, LocalisableString? missingText = null) protected PaginatedProfileSubsection(Bindable<UserProfileData?> user, LocalisableString? headerText = null, LocalisableString? missingText = null)
: base(userProfileData, headerText, CounterVisibilityState.AlwaysVisible) : base(user, headerText, CounterVisibilityState.AlwaysVisible)
{ {
this.missingText = missingText; this.missingText = missingText;
} }
@ -89,7 +89,7 @@ namespace osu.Game.Overlays.Profile.Sections
protected override void LoadComplete() protected override void LoadComplete()
{ {
base.LoadComplete(); base.LoadComplete();
UserProfileData.BindValueChanged(onUserChanged, true); User.BindValueChanged(onUserChanged, true);
} }
private void onUserChanged(ValueChangedEvent<UserProfileData?> e) private void onUserChanged(ValueChangedEvent<UserProfileData?> e)
@ -109,14 +109,14 @@ namespace osu.Game.Overlays.Profile.Sections
private void showMore() private void showMore()
{ {
if (UserProfileData.Value?.User == null) if (User.Value?.User == null)
return; return;
loadCancellation = new CancellationTokenSource(); loadCancellation = new CancellationTokenSource();
CurrentPage = CurrentPage?.TakeNext(ItemsPerPage) ?? new PaginationParameters(InitialItemsCount); CurrentPage = CurrentPage?.TakeNext(ItemsPerPage) ?? new PaginationParameters(InitialItemsCount);
retrievalRequest = CreateRequest(UserProfileData.Value.User, CurrentPage.Value); retrievalRequest = CreateRequest(User.Value.User, CurrentPage.Value);
retrievalRequest.Success += items => UpdateItems(items, loadCancellation); retrievalRequest.Success += items => UpdateItems(items, loadCancellation);
api.Queue(retrievalRequest); api.Queue(retrievalRequest);

View File

@ -11,18 +11,18 @@ namespace osu.Game.Overlays.Profile.Sections
{ {
public abstract partial class ProfileSubsection : FillFlowContainer public abstract partial class ProfileSubsection : FillFlowContainer
{ {
protected readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>(); protected readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
private readonly LocalisableString headerText; private readonly LocalisableString headerText;
private readonly CounterVisibilityState counterVisibilityState; private readonly CounterVisibilityState counterVisibilityState;
private ProfileSubsectionHeader header = null!; private ProfileSubsectionHeader header = null!;
protected ProfileSubsection(Bindable<UserProfileData?> userProfileData, LocalisableString? headerText = null, CounterVisibilityState counterVisibilityState = CounterVisibilityState.AlwaysHidden) protected ProfileSubsection(Bindable<UserProfileData?> user, LocalisableString? headerText = null, CounterVisibilityState counterVisibilityState = CounterVisibilityState.AlwaysHidden)
{ {
this.headerText = headerText ?? string.Empty; this.headerText = headerText ?? string.Empty;
this.counterVisibilityState = counterVisibilityState; this.counterVisibilityState = counterVisibilityState;
UserProfileData.BindTo(userProfileData); User.BindTo(user);
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]

View File

@ -19,8 +19,8 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks
{ {
private readonly ScoreType type; private readonly ScoreType type;
public PaginatedScoreContainer(ScoreType type, Bindable<UserProfileData?> userProfileData, LocalisableString headerText) public PaginatedScoreContainer(ScoreType type, Bindable<UserProfileData?> user, LocalisableString headerText)
: base(userProfileData, headerText) : base(user, headerText)
{ {
this.type = type; this.type = type;
} }

View File

@ -18,9 +18,9 @@ namespace osu.Game.Overlays.Profile.Sections
{ {
Children = new[] Children = new[]
{ {
new PaginatedScoreContainer(ScoreType.Pinned, UserProfileData, UsersStrings.ShowExtraTopRanksPinnedTitle), new PaginatedScoreContainer(ScoreType.Pinned, User, UsersStrings.ShowExtraTopRanksPinnedTitle),
new PaginatedScoreContainer(ScoreType.Best, UserProfileData, UsersStrings.ShowExtraTopRanksBestTitle), new PaginatedScoreContainer(ScoreType.Best, User, UsersStrings.ShowExtraTopRanksBestTitle),
new PaginatedScoreContainer(ScoreType.Firsts, UserProfileData, UsersStrings.ShowExtraTopRanksFirstTitle) new PaginatedScoreContainer(ScoreType.Firsts, User, UsersStrings.ShowExtraTopRanksFirstTitle)
}; };
} }
} }

View File

@ -16,8 +16,8 @@ namespace osu.Game.Overlays.Profile.Sections.Recent
{ {
public partial class PaginatedRecentActivityContainer : PaginatedProfileSubsection<APIRecentActivity> public partial class PaginatedRecentActivityContainer : PaginatedProfileSubsection<APIRecentActivity>
{ {
public PaginatedRecentActivityContainer(Bindable<UserProfileData?> userProfileData) public PaginatedRecentActivityContainer(Bindable<UserProfileData?> user)
: base(userProfileData, missingText: EventsStrings.Empty) : base(user, missingText: EventsStrings.Empty)
{ {
} }

View File

@ -17,7 +17,7 @@ namespace osu.Game.Overlays.Profile.Sections
{ {
Children = new[] Children = new[]
{ {
new PaginatedRecentActivityContainer(UserProfileData), new PaginatedRecentActivityContainer(User),
}; };
} }
} }

View File

@ -47,7 +47,7 @@ namespace osu.Game.Overlays
Show(); Show();
if (user.OnlineID == Header?.UserProfileData.Value?.User.Id) if (user.OnlineID == Header?.User.Value?.User.Id)
return; return;
if (sectionsContainer != null) if (sectionsContainer != null)
@ -126,7 +126,7 @@ namespace osu.Game.Overlays
Debug.Assert(sections != null && sectionsContainer != null && tabs != null); Debug.Assert(sections != null && sectionsContainer != null && tabs != null);
var userProfile = new UserProfileData(user); var userProfile = new UserProfileData(user);
Header.UserProfileData.Value = userProfile; Header.User.Value = userProfile;
if (user.ProfileOrder != null) if (user.ProfileOrder != null)
{ {
@ -136,7 +136,7 @@ namespace osu.Game.Overlays
if (sec != null) if (sec != null)
{ {
sec.UserProfileData.Value = userProfile; sec.User.Value = userProfile;
sectionsContainer.Add(sec); sectionsContainer.Add(sec);
tabs.AddItem(sec); tabs.AddItem(sec);