1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 04: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(),
});
AddStep("Show peppy", () => section.UserProfileData.Value = new UserProfileData(new APIUser { Id = 2 }));
AddStep("Show WubWoofWolf", () => section.UserProfileData.Value = new UserProfileData(new APIUser { Id = 39828 }));
AddStep("Show peppy", () => section.User.Value = new UserProfileData(new APIUser { Id = 2 }));
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]
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;
public TestScenePlayHistorySubsection()
@ -33,7 +33,7 @@ namespace osu.Game.Tests.Visual.Online
RelativeSizeAxes = Axes.Both,
Colour = colourProvider.Background4
},
section = new PlayHistorySubsection(userProfileData)
section = new PlayHistorySubsection(user)
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre
@ -44,49 +44,49 @@ namespace osu.Game.Tests.Visual.Online
[Test]
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);
}
[Test]
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);
}
[Test]
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);
}
[Test]
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);
}
[Test]
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);
}
[Test]
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);
}
[Test]
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("Array length is the same", () => user_with_filled_values.MonthlyPlayCounts.Length == getChartValuesLength());
}
@ -94,7 +94,7 @@ namespace osu.Game.Tests.Visual.Online
[Test]
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("Array length is 7", () => getChartValuesLength() == 7);
}

View File

@ -29,13 +29,13 @@ namespace osu.Game.Tests.Visual.Online
[Test]
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]
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,
Username = "IAmOnline",
@ -43,7 +43,7 @@ namespace osu.Game.Tests.Visual.Online
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,
Username = "IAmOffline",
@ -55,7 +55,7 @@ namespace osu.Game.Tests.Visual.Online
[Test]
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,
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,
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 readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>();
public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
private LinkFlowContainer topLinkContainer = 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)

View File

@ -18,7 +18,7 @@ namespace osu.Game.Overlays.Profile.Header
public partial class CentreHeaderContainer : CompositeDrawable
{
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 hiddenDetailCountry = null!;
@ -53,15 +53,15 @@ namespace osu.Game.Overlays.Profile.Header
{
new FollowersButton
{
UserProfileData = { BindTarget = UserProfileData }
User = { BindTarget = User }
},
new MappingSubscribersButton
{
UserProfileData = { BindTarget = UserProfileData }
User = { BindTarget = User }
},
new MessageUserButton
{
UserProfileData = { BindTarget = UserProfileData }
User = { BindTarget = User }
},
}
},
@ -92,7 +92,7 @@ namespace osu.Game.Overlays.Profile.Header
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
Size = new Vector2(40),
UserProfileData = { BindTarget = UserProfileData }
User = { BindTarget = User }
},
expandedDetailContainer = new Container
{
@ -104,7 +104,7 @@ namespace osu.Game.Overlays.Profile.Header
Child = new LevelProgressBar
{
RelativeSizeAxes = Axes.Both,
UserProfileData = { BindTarget = UserProfileData }
User = { BindTarget = User }
}
},
hiddenDetailContainer = new FillFlowContainer
@ -141,7 +141,7 @@ namespace osu.Game.Overlays.Profile.Header
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)

View File

@ -11,7 +11,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
{
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;
@ -21,7 +21,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
private void load()
{
// 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 readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>();
public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
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)

View File

@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
{
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; }
@ -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)

View File

@ -11,7 +11,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
{
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;
@ -20,7 +20,7 @@ namespace osu.Game.Overlays.Profile.Header.Components
[BackgroundDependencyLoader]
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 readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>();
public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
public override LocalisableString TooltipText => UsersStrings.CardSendMessage;
@ -48,12 +48,12 @@ namespace osu.Game.Overlays.Profile.Header.Components
{
if (!Content.IsPresent) return;
channelManager?.OpenPrivateChannel(UserProfileData.Value?.User);
channelManager?.OpenPrivateChannel(User.Value?.User);
userOverlay?.Hide();
chatOverlay?.Show();
};
UserProfileData.ValueChanged += e =>
User.ValueChanged += e =>
{
var user = e.NewValue?.User;
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 readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>();
public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
public LocalisableString TooltipText { get; set; }
@ -35,12 +35,12 @@ namespace osu.Game.Overlays.Profile.Header.Components
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";
info.Content = formatTime(playTime);
}

View File

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

View File

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

View File

@ -26,7 +26,7 @@ namespace osu.Game.Overlays.Profile.Header
{
private const float avatar_size = 110;
public readonly Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>();
public readonly Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
[Resolved]
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)

View File

@ -19,7 +19,7 @@ namespace osu.Game.Overlays.Profile
{
private UserCoverBackground coverContainer = null!;
public Bindable<UserProfileData?> UserProfileData = new Bindable<UserProfileData?>();
public Bindable<UserProfileData?> User = new Bindable<UserProfileData?>();
private CentreHeaderContainer centreHeaderContainer;
private DetailHeaderContainer detailHeaderContainer;
@ -28,7 +28,7 @@ namespace osu.Game.Overlays.Profile
{
ContentSidePadding = UserProfileOverlay.CONTENT_X_MARGIN;
UserProfileData.ValueChanged += e => updateDisplay(e.NewValue);
User.ValueChanged += e => updateDisplay(e.NewValue);
TabControl.AddItem(LayoutStrings.HeaderUsersShow);
@ -72,34 +72,34 @@ namespace osu.Game.Overlays.Profile
new TopHeaderContainer
{
RelativeSizeAxes = Axes.X,
UserProfileData = { BindTarget = UserProfileData },
User = { BindTarget = User },
},
centreHeaderContainer = new CentreHeaderContainer
{
RelativeSizeAxes = Axes.X,
UserProfileData = { BindTarget = UserProfileData },
User = { BindTarget = User },
},
detailHeaderContainer = new DetailHeaderContainer
{
RelativeSizeAxes = Axes.X,
UserProfileData = { BindTarget = UserProfileData },
User = { BindTarget = User },
},
new MedalHeaderContainer
{
RelativeSizeAxes = Axes.X,
UserProfileData = { BindTarget = UserProfileData },
User = { BindTarget = User },
},
new BottomHeaderContainer
{
RelativeSizeAxes = Axes.X,
UserProfileData = { BindTarget = UserProfileData },
User = { BindTarget = User },
},
}
};
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
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -19,11 +19,11 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
{
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;
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Profile.Sections.Kudosu
CornerRadius = 3;
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;

View File

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

View File

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

View File

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

View File

@ -11,18 +11,18 @@ namespace osu.Game.Overlays.Profile.Sections
{
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 CounterVisibilityState counterVisibilityState;
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.counterVisibilityState = counterVisibilityState;
UserProfileData.BindTo(userProfileData);
User.BindTo(user);
}
[BackgroundDependencyLoader]

View File

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

View File

@ -18,9 +18,9 @@ namespace osu.Game.Overlays.Profile.Sections
{
Children = new[]
{
new PaginatedScoreContainer(ScoreType.Pinned, UserProfileData, UsersStrings.ShowExtraTopRanksPinnedTitle),
new PaginatedScoreContainer(ScoreType.Best, UserProfileData, UsersStrings.ShowExtraTopRanksBestTitle),
new PaginatedScoreContainer(ScoreType.Firsts, UserProfileData, UsersStrings.ShowExtraTopRanksFirstTitle)
new PaginatedScoreContainer(ScoreType.Pinned, User, UsersStrings.ShowExtraTopRanksPinnedTitle),
new PaginatedScoreContainer(ScoreType.Best, User, UsersStrings.ShowExtraTopRanksBestTitle),
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 PaginatedRecentActivityContainer(Bindable<UserProfileData?> userProfileData)
: base(userProfileData, missingText: EventsStrings.Empty)
public PaginatedRecentActivityContainer(Bindable<UserProfileData?> user)
: base(user, missingText: EventsStrings.Empty)
{
}

View File

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

View File

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