mirror of
https://github.com/ppy/osu.git
synced 2025-02-16 17:03:18 +08:00
Hook up the rest of the logic
This commit is contained in:
parent
aede1b183a
commit
2e161f7e99
@ -26,7 +26,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
|
|
||||||
public readonly Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
|
public readonly Bindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
|
||||||
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
private readonly Bindable<RulesetInfo> ruleset = new Bindable<RulesetInfo>();
|
||||||
private readonly Bindable<BeatmapLeaderboardScope> scope = new Bindable<BeatmapLeaderboardScope>();
|
private readonly Bindable<BeatmapLeaderboardScope> scope = new Bindable<BeatmapLeaderboardScope>(BeatmapLeaderboardScope.Global);
|
||||||
private readonly Bindable<User> user = new Bindable<User>();
|
private readonly Bindable<User> user = new Bindable<User>();
|
||||||
|
|
||||||
private readonly Box background;
|
private readonly Box background;
|
||||||
@ -107,12 +107,6 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
Origin = Anchor.TopCentre,
|
Origin = Anchor.TopCentre,
|
||||||
Current = { BindTarget = scope }
|
Current = { BindTarget = scope }
|
||||||
},
|
},
|
||||||
notSupporterPlaceholder = new NotSupporterPlaceholder
|
|
||||||
{
|
|
||||||
Anchor = Anchor.TopCentre,
|
|
||||||
Origin = Anchor.TopCentre,
|
|
||||||
Alpha = 0,
|
|
||||||
},
|
|
||||||
modSelector = new LeaderboardModSelector
|
modSelector = new LeaderboardModSelector
|
||||||
{
|
{
|
||||||
Anchor = Anchor.TopCentre,
|
Anchor = Anchor.TopCentre,
|
||||||
@ -136,6 +130,12 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
AlwaysPresent = true,
|
AlwaysPresent = true,
|
||||||
Margin = new MarginPadding { Vertical = 10 }
|
Margin = new MarginPadding { Vertical = 10 }
|
||||||
},
|
},
|
||||||
|
notSupporterPlaceholder = new NotSupporterPlaceholder
|
||||||
|
{
|
||||||
|
Anchor = Anchor.TopCentre,
|
||||||
|
Origin = Anchor.TopCentre,
|
||||||
|
Alpha = 0,
|
||||||
|
},
|
||||||
new FillFlowContainer
|
new FillFlowContainer
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
@ -213,9 +213,9 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
|
|
||||||
private void onUserChanged(ValueChangedEvent<User> user)
|
private void onUserChanged(ValueChangedEvent<User> user)
|
||||||
{
|
{
|
||||||
scope.Value = BeatmapLeaderboardScope.Global;
|
|
||||||
modSelector.DeselectAll();
|
modSelector.DeselectAll();
|
||||||
modSelector.FadeTo(api.IsLoggedIn && api.LocalUser.Value.IsSupporter ? 1 : 0);
|
modSelector.FadeTo(userIsSupporter ? 1 : 0);
|
||||||
|
getScores();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void getScores()
|
private void getScores()
|
||||||
@ -232,6 +232,18 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (scope.Value != BeatmapLeaderboardScope.Global && !userIsSupporter)
|
||||||
|
{
|
||||||
|
Scores = null;
|
||||||
|
notSupporterPlaceholder.Show();
|
||||||
|
loading.Hide();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
notSupporterPlaceholder.Hide();
|
||||||
|
}
|
||||||
|
|
||||||
content.Show();
|
content.Show();
|
||||||
loading.Show();
|
loading.Show();
|
||||||
|
|
||||||
@ -247,5 +259,7 @@ namespace osu.Game.Overlays.BeatmapSet.Scores
|
|||||||
|
|
||||||
api.Queue(getScoresRequest);
|
api.Queue(getScoresRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool userIsSupporter => api.IsLoggedIn && api.LocalUser.Value.IsSupporter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user