From b5ff2dab432f7d32200e5f8c53e6d970fcd63e9a Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Sat, 27 Jul 2024 17:26:31 -0700 Subject: [PATCH] Move some properties/bindables around --- osu.Game/Screens/Ranking/CollectionPopover.cs | 6 +++--- osu.Game/Screens/Ranking/FavouriteButton.cs | 9 +++++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Ranking/CollectionPopover.cs b/osu.Game/Screens/Ranking/CollectionPopover.cs index 2411ab99d8..214b8fa8a9 100644 --- a/osu.Game/Screens/Ranking/CollectionPopover.cs +++ b/osu.Game/Screens/Ranking/CollectionPopover.cs @@ -27,14 +27,14 @@ namespace osu.Game.Screens.Ranking : base(false) { this.beatmapInfo = beatmapInfo; + + Margin = new MarginPadding(5); + Body.CornerRadius = 4; } [BackgroundDependencyLoader] private void load() { - Margin = new MarginPadding(5); - Body.CornerRadius = 4; - Children = new[] { new OsuMenu(Direction.Vertical, true) diff --git a/osu.Game/Screens/Ranking/FavouriteButton.cs b/osu.Game/Screens/Ranking/FavouriteButton.cs index 5f21291854..09c41e4e23 100644 --- a/osu.Game/Screens/Ranking/FavouriteButton.cs +++ b/osu.Game/Screens/Ranking/FavouriteButton.cs @@ -41,8 +41,6 @@ namespace osu.Game.Screens.Ranking current = new BindableWithCurrent(new BeatmapSetFavouriteState(false, 0)); Size = new Vector2(50, 30); - - Action = toggleFavouriteStatus; } [BackgroundDependencyLoader] @@ -50,6 +48,13 @@ namespace osu.Game.Screens.Ranking { Add(loading = new LoadingLayer(true, false)); + Action = toggleFavouriteStatus; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + current.BindValueChanged(_ => updateState(), true); localUser.BindTo(api.LocalUser);