1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-15 07:32:55 +08:00

+Score ranks

This commit is contained in:
DrabWeb 2017-03-13 18:34:43 -03:00
parent 74eddc768a
commit 6bd9e3cac1
3 changed files with 59 additions and 9 deletions

View File

@ -27,6 +27,7 @@ namespace osu.Desktop.VisualTests
{
new Score
{
Rank = ScoreRank.SSPlus,
Accuracy = 100,
MaxCombo = 244,
TotalScore = 1707827,
@ -44,6 +45,7 @@ namespace osu.Desktop.VisualTests
},
new Score
{
Rank = ScoreRank.SS,
Accuracy = 100,
MaxCombo = 244,
TotalScore = 1707827,
@ -61,6 +63,7 @@ namespace osu.Desktop.VisualTests
},
new Score
{
Rank = ScoreRank.SPlus,
Accuracy = 100,
MaxCombo = 244,
TotalScore = 1707827,
@ -78,6 +81,7 @@ namespace osu.Desktop.VisualTests
},
new Score
{
Rank = ScoreRank.S,
Accuracy = 100,
MaxCombo = 244,
TotalScore = 1707827,
@ -95,6 +99,7 @@ namespace osu.Desktop.VisualTests
},
new Score
{
Rank = ScoreRank.A,
Accuracy = 100,
MaxCombo = 244,
TotalScore = 1707827,
@ -112,6 +117,7 @@ namespace osu.Desktop.VisualTests
},
new Score
{
Rank = ScoreRank.B,
Accuracy = 100,
MaxCombo = 244,
TotalScore = 1707827,
@ -129,6 +135,7 @@ namespace osu.Desktop.VisualTests
},
new Score
{
Rank = ScoreRank.C,
Accuracy = 100,
MaxCombo = 244,
TotalScore = 1707827,
@ -146,6 +153,7 @@ namespace osu.Desktop.VisualTests
},
new Score
{
Rank = ScoreRank.D,
Accuracy = 100,
MaxCombo = 244,
TotalScore = 1707827,
@ -163,6 +171,7 @@ namespace osu.Desktop.VisualTests
},
new Score
{
Rank = ScoreRank.F,
Accuracy = 100,
MaxCombo = 244,
TotalScore = 1707827,
@ -180,6 +189,7 @@ namespace osu.Desktop.VisualTests
},
new Score
{
Rank = ScoreRank.F,
Accuracy = 100,
MaxCombo = 244,
TotalScore = 1707827,

View File

@ -3,20 +3,52 @@
using osu.Game.Users;
using osu.Game.Database;
using System.ComponentModel;
namespace osu.Game.Modes
{
public class Score
{
public ScoreRank Rank { get; set; }
public double TotalScore { get; set; }
public double Accuracy { get; set; }
public double Health { get; set; }
public Mod[] Mods { get; set; }
public User User { get; set; }
public int MaxCombo { get; set; }
public int Combo { get; set; }
public Mod[] Mods { get; set; }
public User User { get; set; }
public Replay Replay;
public BeatmapInfo Beatmap;
}
public enum ScoreRank
{
[Description(@"F")]
F,
[Description(@"F")]
D,
[Description(@"C")]
C,
[Description(@"B")]
B,
[Description(@"A")]
A,
[Description(@"S")]
S,
[Description(@"SPlus")]
SPlus,
[Description(@"SS")]
SS,
[Description(@"SSPlus")]
SSPlus,
}
}

View File

@ -15,6 +15,7 @@ using osu.Framework.Graphics.Textures;
using osu.Framework.Allocation;
using System.Linq;
using osu.Framework.Extensions.Color4Extensions;
using osu.Framework.Extensions;
namespace osu.Game.Screens.Select.Leaderboards
{
@ -24,7 +25,7 @@ namespace osu.Game.Screens.Select.Leaderboards
private const float corner_radius = 5;
private const float edge_margin = 10;
private const float background_alpha = 0.25f;
private const float score_letter_size = 20f;
private const float score_rank_size = 30f;
private readonly EdgeEffect imageShadow = new EdgeEffect
{
@ -35,7 +36,7 @@ namespace osu.Game.Screens.Select.Leaderboards
private Box background;
private Container content, avatarContainer;
private Sprite scoreLetter;
private Sprite scoreRank;
private OsuSpriteText nameLabel;
private GlowingSpriteText scoreLabel;
private ScoreComponentLabel maxCombo, accuracy;
@ -57,6 +58,12 @@ namespace osu.Game.Screens.Select.Leaderboards
base.OnHoverLost(state);
}
[BackgroundDependencyLoader]
private void load(TextureStore textures)
{
scoreRank.Texture = textures.Get($@"Badges/ScoreRanks/{Score.Rank.GetDescription()}");
}
protected override void LoadComplete()
{
base.LoadComplete();
@ -64,7 +71,7 @@ namespace osu.Game.Screens.Select.Leaderboards
// TODO: This fade to 0.01 is hacky, find a better way
FadeTo(0.01f);
foreach (Drawable d in new Drawable[] { avatarContainer, nameLabel, scoreLabel, scoreLetter, flagBadgeContainer, maxCombo, accuracy, modsContainer, })
foreach (Drawable d in new Drawable[] { avatarContainer, nameLabel, scoreLabel, scoreRank, flagBadgeContainer, maxCombo, accuracy, modsContainer, })
{
d.FadeOut();
}
@ -92,7 +99,7 @@ namespace osu.Game.Screens.Select.Leaderboards
Schedule(() =>
{
scoreLabel.FadeIn(200);
scoreLetter.FadeIn(200);
scoreRank.FadeIn(200);
Delay(50);
Schedule(() =>
@ -229,17 +236,18 @@ namespace osu.Game.Screens.Select.Leaderboards
},
},
},
scoreLetter = new Sprite
scoreRank = new Sprite
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Size = new Vector2(score_letter_size),
Size = new Vector2(score_rank_size),
Position = new Vector2(0f, -5f),
},
scoreLabel = new GlowingSpriteText(string.Format("{0:n0}", Score.TotalScore), @"Venera", 23, Color4.White, OsuColour.FromHex(@"83ccfa"))
{
Anchor = Anchor.TopRight,
Origin = Anchor.TopRight,
Position = new Vector2(-score_letter_size - 5f, 0f),
Position = new Vector2(-score_rank_size - 5f, 0f),
},
modsContainer = new FillFlowContainer<ScoreModIcon>
{