mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 10:17:19 +08:00
Mark user as quit visually on the leaderboard
This commit is contained in:
parent
116acc2b5e
commit
71dcbeaf7c
@ -34,6 +34,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
public BindableDouble TotalScore { get; } = new BindableDouble();
|
public BindableDouble TotalScore { get; } = new BindableDouble();
|
||||||
public BindableDouble Accuracy { get; } = new BindableDouble(1);
|
public BindableDouble Accuracy { get; } = new BindableDouble(1);
|
||||||
public BindableInt Combo { get; } = new BindableInt();
|
public BindableInt Combo { get; } = new BindableInt();
|
||||||
|
public BindableBool HasQuit { get; } = new BindableBool();
|
||||||
|
|
||||||
private int? scorePosition;
|
private int? scorePosition;
|
||||||
|
|
||||||
@ -230,6 +231,15 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
TotalScore.BindValueChanged(v => scoreText.Text = v.NewValue.ToString("N0"), true);
|
TotalScore.BindValueChanged(v => scoreText.Text = v.NewValue.ToString("N0"), true);
|
||||||
Accuracy.BindValueChanged(v => accuracyText.Text = v.NewValue.FormatAccuracy(), true);
|
Accuracy.BindValueChanged(v => accuracyText.Text = v.NewValue.FormatAccuracy(), true);
|
||||||
Combo.BindValueChanged(v => comboText.Text = $"{v.NewValue}x", true);
|
Combo.BindValueChanged(v => comboText.Text = $"{v.NewValue}x", true);
|
||||||
|
HasQuit.BindValueChanged(v =>
|
||||||
|
{
|
||||||
|
if (v.NewValue)
|
||||||
|
{
|
||||||
|
// we will probably want to display this in a better way once we have a design.
|
||||||
|
// and also show states other than quit.
|
||||||
|
panelColour = Color4.Gray;
|
||||||
|
}
|
||||||
|
}, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void LoadComplete()
|
protected override void LoadComplete()
|
||||||
@ -244,6 +254,9 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
private void updateColour()
|
private void updateColour()
|
||||||
{
|
{
|
||||||
|
if (HasQuit.Value)
|
||||||
|
return;
|
||||||
|
|
||||||
if (scorePosition == 1)
|
if (scorePosition == 1)
|
||||||
{
|
{
|
||||||
mainFillContainer.ResizeWidthTo(EXTENDED_WIDTH, panel_transition_duration, Easing.OutElastic);
|
mainFillContainer.ResizeWidthTo(EXTENDED_WIDTH, panel_transition_duration, Easing.OutElastic);
|
||||||
|
@ -10,5 +10,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
BindableDouble TotalScore { get; }
|
BindableDouble TotalScore { get; }
|
||||||
BindableDouble Accuracy { get; }
|
BindableDouble Accuracy { get; }
|
||||||
BindableInt Combo { get; }
|
BindableInt Combo { get; }
|
||||||
|
|
||||||
|
BindableBool HasQuit { get; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -71,6 +71,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
((IBindable<double>)leaderboardScore.Accuracy).BindTo(trackedUser.Accuracy);
|
((IBindable<double>)leaderboardScore.Accuracy).BindTo(trackedUser.Accuracy);
|
||||||
((IBindable<double>)leaderboardScore.TotalScore).BindTo(trackedUser.Score);
|
((IBindable<double>)leaderboardScore.TotalScore).BindTo(trackedUser.Score);
|
||||||
((IBindable<int>)leaderboardScore.Combo).BindTo(trackedUser.CurrentCombo);
|
((IBindable<int>)leaderboardScore.Combo).BindTo(trackedUser.CurrentCombo);
|
||||||
|
((IBindable<bool>)leaderboardScore.HasQuit).BindTo(trackedUser.UserQuit);
|
||||||
}
|
}
|
||||||
|
|
||||||
scoringMode = config.GetBindable<ScoringMode>(OsuSetting.ScoreDisplayMode);
|
scoringMode = config.GetBindable<ScoringMode>(OsuSetting.ScoreDisplayMode);
|
||||||
@ -81,8 +82,15 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
{
|
{
|
||||||
base.LoadComplete();
|
base.LoadComplete();
|
||||||
|
|
||||||
playingUsers.BindCollectionChanged(usersChanged);
|
// BindableList handles binding in a really bad way (Clear then AddRange) so we need to do this manually..
|
||||||
|
foreach (int userId in playingUsers)
|
||||||
|
{
|
||||||
|
if (!multiplayerClient.PlayingUsers.Contains(userId))
|
||||||
|
usersChanged(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, new[] { userId }));
|
||||||
|
}
|
||||||
|
|
||||||
playingUsers.BindTo(multiplayerClient.PlayingUsers);
|
playingUsers.BindTo(multiplayerClient.PlayingUsers);
|
||||||
|
playingUsers.BindCollectionChanged(usersChanged);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void usersChanged(object sender, NotifyCollectionChangedEventArgs e)
|
private void usersChanged(object sender, NotifyCollectionChangedEventArgs e)
|
||||||
@ -157,7 +165,7 @@ namespace osu.Game.Screens.Play.HUD
|
|||||||
|
|
||||||
public void UpdateScore(ScoreProcessor processor, ScoringMode mode)
|
public void UpdateScore(ScoreProcessor processor, ScoringMode mode)
|
||||||
{
|
{
|
||||||
Debug.Assert(UserQuit.Value);
|
Debug.Assert(!UserQuit.Value);
|
||||||
|
|
||||||
if (LastHeader == null)
|
if (LastHeader == null)
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user