From 096998d5f46809cc2ded83232d4f46067f5b7520 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 30 Oct 2017 19:08:15 +0900 Subject: [PATCH] Fix user bindable being assigned rather than bound --- .../Sections/Ranks/PaginatedScoreContainer.cs | 25 ++++++++++--------- 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs index a9f1226dbb..d1e920d49c 100644 --- a/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs +++ b/osu.Game/Overlays/Profile/Sections/Ranks/PaginatedScoreContainer.cs @@ -28,26 +28,18 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks private readonly bool includeWeight; private readonly ScoreType type; private int visiblePages; - private readonly Bindable user; + + private readonly Bindable user = new Bindable(); private RulesetStore rulesets; private APIAccess api; - private void setUser(User newUser) - { - visiblePages = 0; - scoreContainer.Clear(); - showMoreButton.Hide(); - missing.Show(); - showMore(); - } - public PaginatedScoreContainer(ScoreType type, Bindable user, string header, bool includeWeight = false) { this.type = type; this.includeWeight = includeWeight; - this.user = user; - user.ValueChanged += setUser; + this.user.BindTo(user); + this.user.ValueChanged += user_ValueChanged; RelativeSizeAxes = Axes.X; AutoSizeAxes = Axes.Y; @@ -95,6 +87,15 @@ namespace osu.Game.Overlays.Profile.Sections.Ranks }; } + private void user_ValueChanged(User newUser) + { + visiblePages = 0; + scoreContainer.Clear(); + showMoreButton.Hide(); + missing.Show(); + showMore(); + } + [BackgroundDependencyLoader] private void load(APIAccess api, RulesetStore rulesets) {