mirror of
https://github.com/ppy/osu
synced 2024-12-13 02:17:32 +00:00
Enter animation, remove testing mod icons
This commit is contained in:
parent
d6f53c8b77
commit
d1bad34434
@ -36,12 +36,12 @@ namespace osu.Desktop.VisualTests
|
||||
{
|
||||
scores.Add(new LeaderboardScore
|
||||
{
|
||||
Name = @"ultralaserxx",
|
||||
Avatar = ts.Get(@"Online/avatar-guest"),
|
||||
Flag = ts.Get(@"Flags/__"),
|
||||
Name = @"ultralaserxx",
|
||||
MaxCombo = RNG.Next(0, 3000),
|
||||
Accuracy = Math.Round(RNG.NextDouble(0, 100), 2),
|
||||
Score = RNG.Next(0, 1000000),
|
||||
Accuracy = Math.Round(RNG.NextDouble(0, 100), 2),
|
||||
MaxCombo = RNG.Next(0, 3000),
|
||||
Mods = new Mod[] { },
|
||||
});
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
get { return scores; }
|
||||
set
|
||||
{
|
||||
if (value == scores) return;
|
||||
scores = value;
|
||||
|
||||
var scoreDisplays = new List<LeaderboardScoreDisplay>();
|
||||
@ -56,13 +57,13 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
|
||||
public class LeaderboardScore
|
||||
{
|
||||
public string Name;
|
||||
public Texture Avatar;
|
||||
public Texture Flag;
|
||||
public Texture Badge;
|
||||
public string Name;
|
||||
public int MaxCombo;
|
||||
public double Accuracy;
|
||||
public int Score;
|
||||
public double Accuracy;
|
||||
public int MaxCombo;
|
||||
public IEnumerable<Mod> Mods;
|
||||
}
|
||||
}
|
||||
|
@ -10,6 +10,7 @@ using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Transforms;
|
||||
using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Modes;
|
||||
|
||||
namespace osu.Game.Screens.Select.Leaderboards
|
||||
{
|
||||
@ -22,7 +23,10 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
private const float score_letter_size = 20f;
|
||||
|
||||
private Box background;
|
||||
private Container content;
|
||||
private FillFlowContainer<ScoreModIcon> modsContainer;
|
||||
|
||||
private readonly int index;
|
||||
public readonly LeaderboardScore Score;
|
||||
|
||||
protected override bool OnHover(Framework.Input.InputState state)
|
||||
@ -37,9 +41,24 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
base.OnHoverLost(state);
|
||||
}
|
||||
|
||||
public LeaderboardScoreDisplay(LeaderboardScore score, int index)
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
FadeTo(0.01f); // TODO: This is hacky, find a better way
|
||||
Delay(index * 50);
|
||||
Schedule(() =>
|
||||
{
|
||||
FadeInFromZero(200);
|
||||
content.MoveToX(DrawSize.X);
|
||||
content.MoveToX(0, 500, EasingTypes.OutQuint);
|
||||
});
|
||||
}
|
||||
|
||||
public LeaderboardScoreDisplay(LeaderboardScore score, int i)
|
||||
{
|
||||
Score = score;
|
||||
index = i;
|
||||
|
||||
RelativeSizeAxes = Axes.X;
|
||||
Height = height;
|
||||
@ -62,7 +81,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
},
|
||||
},
|
||||
},
|
||||
new Container
|
||||
content = new Container
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Padding = new MarginPadding { Left = 40, },
|
||||
@ -180,7 +199,7 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
Text = Score.Score.ToString(),
|
||||
TextSize = 23,
|
||||
},
|
||||
new FillFlowContainer
|
||||
modsContainer = new FillFlowContainer<ScoreModIcon>
|
||||
{
|
||||
Anchor = Anchor.BottomRight,
|
||||
Origin = Anchor.BottomRight,
|
||||
@ -188,19 +207,18 @@ namespace osu.Game.Screens.Select.Leaderboards
|
||||
// TODO: Probably remove? Seems like others don't like this kind of thing
|
||||
Position = new Vector2(0f, 4f), //properly align the mod icons
|
||||
Direction = FillDirection.Left,
|
||||
Children = new[]
|
||||
{
|
||||
new ScoreModIcon(FontAwesome.fa_osu_mod_doubletime, OsuColour.FromHex(@"ffcc22")),
|
||||
new ScoreModIcon(FontAwesome.fa_osu_mod_flashlight, OsuColour.FromHex(@"ffcc22")),
|
||||
new ScoreModIcon(FontAwesome.fa_osu_mod_hidden, OsuColour.FromHex(@"ffcc22")),
|
||||
new ScoreModIcon(FontAwesome.fa_osu_mod_hardrock, OsuColour.FromHex(@"ffcc22")),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
foreach (Mod mod in Score.Mods)
|
||||
{
|
||||
// TODO: Get actual mod colours
|
||||
modsContainer.Add(new ScoreModIcon(mod.Icon, OsuColour.FromHex(@"ffcc22")));
|
||||
}
|
||||
}
|
||||
|
||||
class ScoreModIcon : Container
|
||||
|
Loading…
Reference in New Issue
Block a user