From 77dbbe6f342e0dcce5b2991773b5cf1b8752afce Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 14:00:21 +0900 Subject: [PATCH 01/20] Add a placeholder cover URL for users. --- osu.Game/Users/User.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game/Users/User.cs b/osu.Game/Users/User.cs index 6e1de7e3ac..e00d36ccb5 100644 --- a/osu.Game/Users/User.cs +++ b/osu.Game/Users/User.cs @@ -19,5 +19,7 @@ namespace osu.Game.Users [JsonProperty(@"colour")] public string Colour; + + public string CoverUrl = @"https://assets.ppy.sh/user-profile-covers/2/08cad88747c235a64fca5f1b770e100f120827ded1ffe3b66bfcd19c940afa65.jpeg"; } } From d51b37cb440c4165e9f10739ad2cee7b75f65654 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 14:01:13 +0900 Subject: [PATCH 02/20] Add a basic implementation of the new design results screen. --- .../Tests/TestCaseResults.cs | 55 +++++ .../osu.Desktop.VisualTests.csproj | 1 + osu.Game/Screens/Play/Player.cs | 7 +- osu.Game/Screens/Ranking/AspectContainer.cs | 17 ++ osu.Game/Screens/Ranking/ResultMode.cs | 9 + osu.Game/Screens/Ranking/ResultModeButton.cs | 105 +++++++++ .../Screens/Ranking/ResultModeTabControl.cs | 28 +++ osu.Game/Screens/Ranking/Results.cs | 219 ++++++++++++++---- osu.Game/Screens/Ranking/ResultsPage.cs | 89 +++++++ .../Screens/Ranking/ResultsRankingPage.cs | 45 ++++ osu.Game/Screens/Ranking/ResultsScorePage.cs | 132 +++++++++++ osu.Game/osu.Game.csproj | 7 + 12 files changed, 662 insertions(+), 52 deletions(-) create mode 100644 osu.Desktop.VisualTests/Tests/TestCaseResults.cs create mode 100644 osu.Game/Screens/Ranking/AspectContainer.cs create mode 100644 osu.Game/Screens/Ranking/ResultMode.cs create mode 100644 osu.Game/Screens/Ranking/ResultModeButton.cs create mode 100644 osu.Game/Screens/Ranking/ResultModeTabControl.cs create mode 100644 osu.Game/Screens/Ranking/ResultsPage.cs create mode 100644 osu.Game/Screens/Ranking/ResultsRankingPage.cs create mode 100644 osu.Game/Screens/Ranking/ResultsScorePage.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs new file mode 100644 index 0000000000..18e678e38d --- /dev/null +++ b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs @@ -0,0 +1,55 @@ +using System.Linq; +using osu.Framework.Allocation; +using osu.Framework.Testing; +using osu.Game.Beatmaps; +using osu.Game.Database; +using osu.Game.Modes; +using osu.Game.Modes.Scoring; +using osu.Game.Screens.Ranking; +using osu.Game.Users; + +namespace osu.Desktop.VisualTests.Tests +{ + internal class TestCaseResults : TestCase + { + private BeatmapDatabase db; + + public override string Description => @"Results after playing."; + + [BackgroundDependencyLoader] + private void load(BeatmapDatabase db) + { + this.db = db; + } + + private WorkingBeatmap beatmap; + + public override void Reset() + { + base.Reset(); + + if (beatmap == null) + { + var beatmapInfo = db.Query().FirstOrDefault(b => b.Mode == PlayMode.Osu); + if (beatmapInfo != null) + beatmap = db.GetWorkingBeatmap(beatmapInfo); + } + + base.Reset(); + + Add(new Results(new Score() + { + TotalScore = 2845370, + Accuracy = 0.98, + Rank = ScoreRank.A, + User = new User + { + Username = "peppy", + } + }) + { + Beatmap = beatmap + }); + } + } + } diff --git a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj index 80b18c4a9b..10b0d4c491 100644 --- a/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj +++ b/osu.Desktop.VisualTests/osu.Desktop.VisualTests.csproj @@ -198,6 +198,7 @@ + diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index f831387626..f1b1f7f2fe 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -17,11 +17,11 @@ using osu.Game.Database; using osu.Game.Rulesets; using osu.Game.Rulesets.UI; using osu.Game.Screens.Backgrounds; -using osu.Game.Screens.Ranking; using System; using System.Linq; using osu.Framework.Threading; using osu.Game.Rulesets.Scoring; +using osu.Game.Screens.Ranking; namespace osu.Game.Screens.Play { @@ -266,10 +266,7 @@ namespace osu.Game.Screens.Play Delay(1000); onCompletionEvent = Schedule(delegate { - Push(new Results - { - Score = scoreProcessor.CreateScore() - }); + Push(new Results(scoreProcessor.CreateScore())); }); } diff --git a/osu.Game/Screens/Ranking/AspectContainer.cs b/osu.Game/Screens/Ranking/AspectContainer.cs new file mode 100644 index 0000000000..42e20adeb9 --- /dev/null +++ b/osu.Game/Screens/Ranking/AspectContainer.cs @@ -0,0 +1,17 @@ +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; + +namespace osu.Game.Screens.Ranking +{ + public class AspectContainer : Container + { + protected override void Update() + { + base.Update(); + if (RelativeSizeAxes == Axes.X) + Height = DrawWidth; + else + Width = DrawHeight; + } + } +} \ No newline at end of file diff --git a/osu.Game/Screens/Ranking/ResultMode.cs b/osu.Game/Screens/Ranking/ResultMode.cs new file mode 100644 index 0000000000..b7f030f338 --- /dev/null +++ b/osu.Game/Screens/Ranking/ResultMode.cs @@ -0,0 +1,9 @@ +namespace osu.Game.Screens.Ranking +{ + public enum ResultMode + { + Summary, + Ranking, + Share + } +} \ No newline at end of file diff --git a/osu.Game/Screens/Ranking/ResultModeButton.cs b/osu.Game/Screens/Ranking/ResultModeButton.cs new file mode 100644 index 0000000000..5849cd4e14 --- /dev/null +++ b/osu.Game/Screens/Ranking/ResultModeButton.cs @@ -0,0 +1,105 @@ +using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.UserInterface; +using osu.Game.Graphics; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Screens.Ranking +{ + public class ResultModeButton : TabItem + { + private readonly FontAwesome icon; + private Color4 activeColour; + private Color4 inactiveColour; + private CircularContainer colouredPart; + + public ResultModeButton(ResultMode mode) : base(mode) + { + switch (mode) + { + case ResultMode.Summary: + icon = FontAwesome.fa_asterisk; + break; + case ResultMode.Ranking: + icon = FontAwesome.fa_list; + break; + case ResultMode.Share: + icon = FontAwesome.fa_camera; + break; + } + } + + public override bool Active + { + get + { + return base.Active; + } + set + { + base.Active = value; + colouredPart.FadeColour(Active ? activeColour : inactiveColour, 200, EasingTypes.OutQuint); + } + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + Size = new Vector2(50); + + Masking = true; + CornerRadius = 25; + + activeColour = colours.PinkDarker; + inactiveColour = OsuColour.Gray(0.8f); + + EdgeEffect = new EdgeEffect + { + Colour = Color4.Black.Opacity(0.4f), + Type = EdgeEffectType.Shadow, + Radius = 5, + }; + + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White, + }, + colouredPart = new CircularContainer + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Size = new Vector2(0.8f), + BorderThickness = 4, + BorderColour = Color4.White, + Colour = inactiveColour, + Children = new Drawable[] + { + new Box + { + AlwaysPresent = true, //for border rendering + RelativeSizeAxes = Axes.Both, + Colour = Color4.Transparent, + }, + new TextAwesome + { + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Shadow = false, + Colour = OsuColour.Gray(0.95f), + Icon = icon, + TextSize = 20, + } + } + } + }; + } + } +} diff --git a/osu.Game/Screens/Ranking/ResultModeTabControl.cs b/osu.Game/Screens/Ranking/ResultModeTabControl.cs new file mode 100644 index 0000000000..9335f1daef --- /dev/null +++ b/osu.Game/Screens/Ranking/ResultModeTabControl.cs @@ -0,0 +1,28 @@ +using osu.Framework.Graphics; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.UserInterface; +using OpenTK; + +namespace osu.Game.Screens.Ranking +{ + public class ResultModeTabControl : TabControl + { + public ResultModeTabControl() + { + TabContainer.Anchor = Anchor.BottomCentre; + TabContainer.Origin = Anchor.BottomCentre; + TabContainer.Spacing = new Vector2(15); + + TabContainer.Masking = false; + TabContainer.Padding = new MarginPadding(5); + } + + protected override Dropdown CreateDropdown() => null; + + protected override TabItem CreateTabItem(ResultMode value) => new ResultModeButton(value) + { + Anchor = TabContainer.Anchor, + Origin = TabContainer.Origin + }; + } +} \ No newline at end of file diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 3db070d33c..3c78efe30b 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -1,93 +1,218 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE -using osu.Framework.Screens; +using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; -using osu.Game.Graphics.Sprites; +using osu.Framework.Graphics.Primitives; using osu.Game.Rulesets.Scoring; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Screens; +using osu.Game.Graphics.Containers; using osu.Game.Screens.Backgrounds; using OpenTK; using OpenTK.Graphics; namespace osu.Game.Screens.Ranking { - internal class Results : OsuScreen + public class Results : OsuScreen { - protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); + private readonly Score score; + private Container circleOuterBackground; + private Container circleOuter; + private Container circleInner; + + private ParallaxContainer backgroundParallax; + + private ResultModeTabControl modeChangeButtons; + + private Container currentPage; private static readonly Vector2 background_blur = new Vector2(20); - private ScoreDisplay scoreDisplay; + protected override BackgroundScreen CreateBackground() => new BackgroundScreenBeatmap(Beatmap); + + private const float overscan = 1.3f; + + private const float circle_outer_scale = 0.96f; + + public Results(Score score) + { + this.score = score; + } protected override void OnEntering(Screen last) { base.OnEntering(last); - Background.Schedule(() => (Background as BackgroundScreenBeatmap)?.BlurTo(background_blur, 1000)); - } + (Background as BackgroundScreenBeatmap)?.BlurTo(background_blur, 2500, EasingTypes.OutQuint); - protected override bool OnExiting(Screen next) - { - Background.Schedule(() => Background.FadeColour(Color4.White, 500)); - return base.OnExiting(next); - } + var allCircles = new[] { circleOuterBackground, circleInner, circleOuter }; - public Score Score - { - set + allCircles.ForEach(c => { - scoreDisplay?.FadeOut(500); - scoreDisplay?.Expire(); + c.FadeOut(); + c.ScaleTo(0); + }); - scoreDisplay = new ScoreDisplay(value) - { - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - }; + backgroundParallax.FadeOut(); + modeChangeButtons.FadeOut(); + currentPage.FadeOut(); - Add(scoreDisplay); + const float appear_time = 800; - scoreDisplay.FadeIn(500); - scoreDisplay.ScaleTo(0.1f); - scoreDisplay.ScaleTo(1, 1000, EasingTypes.OutElastic); - scoreDisplay.RotateTo(360 * 5, 1000, EasingTypes.OutElastic); + circleOuterBackground.ScaleTo(1, appear_time, EasingTypes.OutQuint); + circleOuterBackground.FadeTo(1, appear_time, EasingTypes.OutQuint); - } + Content.Delay(appear_time * 0.25f, true); + + circleOuter.ScaleTo(1, appear_time, EasingTypes.OutQuint); + circleOuter.FadeTo(1, appear_time, EasingTypes.OutQuint); + + Content.Delay(appear_time * 0.3f, true); + + backgroundParallax.FadeIn(appear_time, EasingTypes.OutQuint); + + circleInner.ScaleTo(1, appear_time, EasingTypes.OutQuint); + circleInner.FadeTo(1, appear_time, EasingTypes.OutQuint); + + Content.Delay(appear_time * 0.4f, true); + + modeChangeButtons.FadeIn(appear_time, EasingTypes.OutQuint); + currentPage.FadeIn(appear_time, EasingTypes.OutQuint); + + Content.DelayReset(); } - } - internal class ScoreDisplay : Container - { - public ScoreDisplay(Score s) + [BackgroundDependencyLoader] + private void load() { - AutoSizeAxes = Axes.Both; - Children = new Drawable[] { - new FillFlowContainer + new AspectContainer { - AutoSizeAxes = Axes.Both, - Direction = FillDirection.Vertical, + RelativeSizeAxes = Axes.Y, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Height = overscan, Children = new Drawable[] { - new OsuSpriteText + circleOuterBackground = new CircularContainer { - TextSize = 40, - Text = $@"Accuracy: {s.Accuracy:#0.00%}", + RelativeSizeAxes = Axes.Both, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Masking = true, + Children = new Drawable[] + { + new Box + { + Alpha = 0.2f, + RelativeSizeAxes = Axes.Both, + Colour = Color4.Black, + } + } }, - new OsuSpriteText + circleOuter = new CircularContainer { - TextSize = 40, - Text = $@"Score: {s.TotalScore}", + Size = new Vector2(circle_outer_scale), + EdgeEffect = new EdgeEffect + { + Colour = Color4.Black.Opacity(0.4f), + Type = EdgeEffectType.Shadow, + Radius = 15, + }, + RelativeSizeAxes = Axes.Both, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Masking = true, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White, + }, + backgroundParallax = new ParallaxContainer + { + RelativeSizeAxes = Axes.Both, + ParallaxAmount = 0.01f, + Scale = new Vector2(1 / circle_outer_scale / overscan), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Children = new Drawable[] + { + new Sprite + { + Alpha = 0.5f, + Texture = Beatmap?.Background, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + FillMode = FillMode.Fill + } + } + }, + modeChangeButtons = new ResultModeTabControl + { + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + RelativeSizeAxes = Axes.X, + Height = 50, + Margin = new MarginPadding { Bottom = 110 }, + } + } }, - new OsuSpriteText + circleInner = new CircularContainer { - TextSize = 40, - Text = $@"MaxCombo: {s.MaxCombo}", + Size = new Vector2(0.6f), + EdgeEffect = new EdgeEffect + { + Colour = Color4.Black.Opacity(0.4f), + Type = EdgeEffectType.Shadow, + Radius = 15, + }, + RelativeSizeAxes = Axes.Both, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Masking = true, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White, + }, + } } } } }; + + modeChangeButtons.AddItem(ResultMode.Summary); + modeChangeButtons.AddItem(ResultMode.Ranking); + modeChangeButtons.AddItem(ResultMode.Share); + + modeChangeButtons.Current.ValueChanged += mode => + { + currentPage?.FadeOut(); + currentPage?.Expire(); + + switch (mode) + { + case ResultMode.Summary: + currentPage = new ResultsScorePage(score); + break; + case ResultMode.Ranking: + currentPage = new ResultsRankingPage(score, Beatmap.BeatmapInfo); + break; + } + + if (currentPage != null) + circleInner.Add(currentPage); + }; + + modeChangeButtons.Current.TriggerChange(); } } -} +} \ No newline at end of file diff --git a/osu.Game/Screens/Ranking/ResultsPage.cs b/osu.Game/Screens/Ranking/ResultsPage.cs new file mode 100644 index 0000000000..514b1616ec --- /dev/null +++ b/osu.Game/Screens/Ranking/ResultsPage.cs @@ -0,0 +1,89 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Extensions.Color4Extensions; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Sprites; +using osu.Game.Graphics; +using osu.Game.Modes.Scoring; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Screens.Ranking +{ + internal class ResultsPage : Container + { + protected Score Score; + private CircularContainer content; + private Box fill; + + protected override Container Content => content; + + public ResultsPage(Score score) + { + Score = score; + RelativeSizeAxes = Axes.Both; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + fill.Delay(400); + fill.FadeInFromZero(600); + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + AddInternal(new Drawable[] + { + fill = new Box + { + Alpha = 0, + RelativeSizeAxes = Axes.Both, + Colour = colours.Gray6 + }, + new CircularContainer + { + EdgeEffect = new EdgeEffect + { + Colour = Color4.Black.Opacity(1), + Type = EdgeEffectType.Shadow, + Radius = 15, + }, + RelativeSizeAxes = Axes.Both, + Masking = true, + BorderThickness = 20, + BorderColour = Color4.White, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + Children = new Drawable[] + { + new Box{ + RelativeSizeAxes = Axes.Both, + Alpha = 0, + AlwaysPresent = true + }, + } + }, + content = new CircularContainer + { + EdgeEffect = new EdgeEffect + { + Colour = Color4.Black.Opacity(0.4f), + Type = EdgeEffectType.Shadow, + Radius = 15, + }, + RelativeSizeAxes = Axes.Both, + Masking = true, + Size = new Vector2(0.88f), + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + } + }); + } + + } +} \ No newline at end of file diff --git a/osu.Game/Screens/Ranking/ResultsRankingPage.cs b/osu.Game/Screens/Ranking/ResultsRankingPage.cs new file mode 100644 index 0000000000..c7a36a6382 --- /dev/null +++ b/osu.Game/Screens/Ranking/ResultsRankingPage.cs @@ -0,0 +1,45 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Sprites; +using osu.Game.Database; +using osu.Game.Graphics; +using osu.Game.Modes.Scoring; +using osu.Game.Screens.Select.Leaderboards; +using OpenTK; + +namespace osu.Game.Screens.Ranking +{ + internal class ResultsRankingPage : ResultsPage + { + private readonly BeatmapInfo beatmap; + + public ResultsRankingPage(Score score, BeatmapInfo beatmap = null) : base(score) + { + this.beatmap = beatmap; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + Children = new Drawable[] + { + new Box + { + Colour = colours.GrayE, + RelativeSizeAxes = Axes.Both, + }, + new Leaderboard + { + Origin = Anchor.Centre, + Anchor = Anchor.Centre, + RelativeSizeAxes = Axes.Both, + Beatmap = beatmap ?? Score.Beatmap, + Scale = new Vector2(0.7f) + } + }; + } + } +} \ No newline at end of file diff --git a/osu.Game/Screens/Ranking/ResultsScorePage.cs b/osu.Game/Screens/Ranking/ResultsScorePage.cs new file mode 100644 index 0000000000..e8d6ac36bf --- /dev/null +++ b/osu.Game/Screens/Ranking/ResultsScorePage.cs @@ -0,0 +1,132 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using osu.Game.Modes.Scoring; +using osu.Game.Screens.Select.Leaderboards; +using osu.Game.Users; +using OpenTK; +using OpenTK.Graphics; + +namespace osu.Game.Screens.Ranking +{ + internal class ResultsScorePage : ResultsPage + { + private ScoreCounter scoreCounter; + + public ResultsScorePage(Score score) : base(score) { } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + const float user_header_height = 150; + + Children = new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Top = user_header_height }, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White, + }, + } + }, + new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new UserHeader(Score.User) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.X, + Height = user_header_height, + }, + new DrawableRank(Score.Rank) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Size = new Vector2(150, 80), + }, + scoreCounter = new SlowScoreCounter(6) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Colour = colours.PinkDarker, + TextSize = 60, + }, + } + } + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + Schedule(() => scoreCounter.Increment(Score.TotalScore)); + } + + private class UserHeader : Container + { + private readonly User user; + private readonly Sprite cover; + + public UserHeader(User user) + { + this.user = user; + Children = new Drawable[] + { + cover = new Sprite + { + FillMode = FillMode.Fill, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }, + new OsuSpriteText + { + Font = @"Exo2.0-RegularItalic", + Text = user.Username, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + TextSize = 30, + Padding = new MarginPadding { Bottom = 10 }, + } + }; + } + + [BackgroundDependencyLoader] + private void load(TextureStore textures) + { + cover.Texture = textures.Get(user.CoverUrl); + } + } + + private class SlowScoreCounter : ScoreCounter + { + protected override double RollingDuration => 3000; + + protected override EasingTypes RollingEasing => EasingTypes.OutPow10; + + public SlowScoreCounter(uint leading = 0) : base(leading) + { + DisplayedCountSpriteText.Shadow = false; + } + } + } +} \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 8421f89058..887c37e20a 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -202,6 +202,9 @@ + + + @@ -225,6 +228,10 @@ + + + + From 7d32cc85c8e97b1315241d098b48b32aa55401d0 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 14:01:47 +0900 Subject: [PATCH 03/20] Make leaderboard scores clickable. --- osu.Game/Screens/Select/Leaderboards/Leaderboard.cs | 3 +++ osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs | 2 +- osu.Game/Screens/Select/PlaySongSelect.cs | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs index 2abf3c3175..2c51429d4c 100644 --- a/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs +++ b/osu.Game/Screens/Select/Leaderboards/Leaderboard.cs @@ -23,6 +23,8 @@ namespace osu.Game.Screens.Select.Leaderboards private readonly ScrollContainer scrollContainer; private readonly FillFlowContainer scrollFlow; + public Action ScoreSelected; + private IEnumerable scores; public IEnumerable Scores { @@ -52,6 +54,7 @@ namespace osu.Game.Screens.Select.Leaderboards var ls = new LeaderboardScore(s, 1 + i) { AlwaysPresent = true, + Action = () => ScoreSelected?.Invoke(s), State = Visibility.Hidden, }; scrollFlow.Add(ls); diff --git a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs index 321067d18e..b574294587 100644 --- a/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs +++ b/osu.Game/Screens/Select/Leaderboards/LeaderboardScore.cs @@ -17,7 +17,7 @@ using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Select.Leaderboards { - public class LeaderboardScore : Container, IStateful + public class LeaderboardScore : ClickableContainer, IStateful { public static readonly float HEIGHT = 60; diff --git a/osu.Game/Screens/Select/PlaySongSelect.cs b/osu.Game/Screens/Select/PlaySongSelect.cs index 78a8e4c177..c15900eb6d 100644 --- a/osu.Game/Screens/Select/PlaySongSelect.cs +++ b/osu.Game/Screens/Select/PlaySongSelect.cs @@ -12,6 +12,7 @@ using osu.Game.Graphics; using osu.Game.Overlays.Mods; using osu.Game.Screens.Edit; using osu.Game.Screens.Play; +using osu.Game.Screens.Ranking; namespace osu.Game.Screens.Select { @@ -35,6 +36,8 @@ namespace osu.Game.Screens.Select RelativeSizeAxes = Axes.Both, Padding = new MarginPadding { Top = 10, Right = 5 }, }); + + beatmapDetails.Leaderboard.ScoreSelected += s => Push(new Results(s)); } [BackgroundDependencyLoader] From 72fcc09a989dd35e85a27afdbfeb1ce751befc4e Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 15:56:52 +0900 Subject: [PATCH 04/20] Add beatmap info and score date. Also adjusts design metrics. --- .../Tests/TestCaseResults.cs | 2 +- osu.Game/Screens/Ranking/Results.cs | 4 +- osu.Game/Screens/Ranking/ResultsPage.cs | 7 +- ...tsRankingPage.cs => ResultsPageRanking.cs} | 9 +- osu.Game/Screens/Ranking/ResultsPageScore.cs | 286 ++++++++++++++++++ osu.Game/Screens/Ranking/ResultsScorePage.cs | 132 -------- osu.Game/osu.Game.csproj | 4 +- 7 files changed, 299 insertions(+), 145 deletions(-) rename osu.Game/Screens/Ranking/{ResultsRankingPage.cs => ResultsPageRanking.cs} (76%) create mode 100644 osu.Game/Screens/Ranking/ResultsPageScore.cs delete mode 100644 osu.Game/Screens/Ranking/ResultsScorePage.cs diff --git a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs index 18e678e38d..afb8f73853 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs @@ -37,7 +37,7 @@ namespace osu.Desktop.VisualTests.Tests base.Reset(); - Add(new Results(new Score() + Add(new Results(new Score { TotalScore = 2845370, Accuracy = 0.98, diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 3c78efe30b..e440799e25 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -201,10 +201,10 @@ namespace osu.Game.Screens.Ranking switch (mode) { case ResultMode.Summary: - currentPage = new ResultsScorePage(score); + currentPage = new ResultsPageScore(score, Beatmap.BeatmapInfo); break; case ResultMode.Ranking: - currentPage = new ResultsRankingPage(score, Beatmap.BeatmapInfo); + currentPage = new ResultsPageRanking(score, Beatmap.BeatmapInfo); break; } diff --git a/osu.Game/Screens/Ranking/ResultsPage.cs b/osu.Game/Screens/Ranking/ResultsPage.cs index 514b1616ec..5cafaf5e44 100644 --- a/osu.Game/Screens/Ranking/ResultsPage.cs +++ b/osu.Game/Screens/Ranking/ResultsPage.cs @@ -6,6 +6,7 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; +using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Modes.Scoring; using OpenTK; @@ -15,15 +16,17 @@ namespace osu.Game.Screens.Ranking { internal class ResultsPage : Container { - protected Score Score; + protected readonly Score Score; + protected readonly BeatmapInfo Beatmap; private CircularContainer content; private Box fill; protected override Container Content => content; - public ResultsPage(Score score) + public ResultsPage(Score score, BeatmapInfo beatmap) { Score = score; + Beatmap = beatmap; RelativeSizeAxes = Axes.Both; } diff --git a/osu.Game/Screens/Ranking/ResultsRankingPage.cs b/osu.Game/Screens/Ranking/ResultsPageRanking.cs similarity index 76% rename from osu.Game/Screens/Ranking/ResultsRankingPage.cs rename to osu.Game/Screens/Ranking/ResultsPageRanking.cs index c7a36a6382..07e9233aba 100644 --- a/osu.Game/Screens/Ranking/ResultsRankingPage.cs +++ b/osu.Game/Screens/Ranking/ResultsPageRanking.cs @@ -12,13 +12,10 @@ using OpenTK; namespace osu.Game.Screens.Ranking { - internal class ResultsRankingPage : ResultsPage + internal class ResultsPageRanking : ResultsPage { - private readonly BeatmapInfo beatmap; - - public ResultsRankingPage(Score score, BeatmapInfo beatmap = null) : base(score) + public ResultsPageRanking(Score score, BeatmapInfo beatmap = null) : base(score, beatmap) { - this.beatmap = beatmap; } [BackgroundDependencyLoader] @@ -36,7 +33,7 @@ namespace osu.Game.Screens.Ranking Origin = Anchor.Centre, Anchor = Anchor.Centre, RelativeSizeAxes = Axes.Both, - Beatmap = beatmap ?? Score.Beatmap, + Beatmap = Beatmap ?? Score.Beatmap, Scale = new Vector2(0.7f) } }; diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs new file mode 100644 index 0000000000..74063203c5 --- /dev/null +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -0,0 +1,286 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using osu.Framework.Allocation; +using osu.Framework.Configuration; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Framework.Graphics.Primitives; +using osu.Framework.Graphics.Sprites; +using osu.Framework.Graphics.Textures; +using osu.Game.Configuration; +using osu.Game.Database; +using osu.Game.Graphics; +using osu.Game.Graphics.Sprites; +using osu.Game.Graphics.UserInterface; +using osu.Game.Modes.Scoring; +using osu.Game.Screens.Select.Leaderboards; +using osu.Game.Users; +using OpenTK; +using OpenTK.Graphics; +using System; + +namespace osu.Game.Screens.Ranking +{ + internal class ResultsPageScore : ResultsPage + { + private ScoreCounter scoreCounter; + + public ResultsPageScore(Score score, BeatmapInfo beatmap) : base(score, beatmap) { } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + const float user_header_height = 120; + + Children = new Drawable[] + { + new Container + { + RelativeSizeAxes = Axes.Both, + Padding = new MarginPadding { Top = user_header_height }, + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = Color4.White, + }, + } + }, + new FillFlowContainer + { + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Direction = FillDirection.Vertical, + Children = new Drawable[] + { + new UserHeader(Score.User) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + RelativeSizeAxes = Axes.X, + Height = user_header_height, + }, + new DrawableRank(Score.Rank) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Size = new Vector2(150, 60), + Margin = new MarginPadding(20), + }, + scoreCounter = new SlowScoreCounter(6) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Colour = colours.PinkDarker, + TextSize = 50, + }, + new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Colour = colours.PinkDarker, + Shadow = false, + Font = @"Exo2.0-Bold", + TextSize = 16, + Text = "total score", + Margin = new MarginPadding { Bottom = 20 }, + }, + new BeatmapDetails(Beatmap) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Margin = new MarginPadding { Bottom = 10 }, + }, + new DateDisplay(Score.Date) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + }, + new Box + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Margin = new MarginPadding { Top = 10, Bottom = 10 }, + Colour = colours.GrayC, + RelativeSizeAxes = Axes.X, + Size = new Vector2(0.75f, 1), + } + } + } + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + Schedule(() => scoreCounter.Increment(Score.TotalScore)); + } + + private class DateDisplay : Container + { + private DateTime date; + + public DateDisplay(DateTime date) + { + this.date = date; + + AutoSizeAxes = Axes.Y; + + Width = 140; + + Masking = true; + CornerRadius = 5; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours) + { + Children = new Drawable[] + { + new Box + { + RelativeSizeAxes = Axes.Both, + Colour = colours.Gray6, + }, + new OsuSpriteText + { + Origin = Anchor.CentreLeft, + Anchor = Anchor.CentreLeft, + Text = date.ToString("HH:mm"), + Padding = new MarginPadding { Left = 10, Right = 10, Top = 5, Bottom = 5 }, + Colour = Color4.White, + }, + new OsuSpriteText + { + Origin = Anchor.CentreRight, + Anchor = Anchor.CentreRight, + Text = date.ToString("yyyy/MM/dd"), + Padding = new MarginPadding { Left = 10, Right = 10, Top = 5, Bottom = 5 }, + Colour = Color4.White, + } + }; + } + } + + private class BeatmapDetails : Container + { + private readonly BeatmapInfo beatmap; + + private Bindable preferUnicode; + + private readonly OsuSpriteText title; + private readonly OsuSpriteText artist; + private readonly OsuSpriteText versionMapper; + + public BeatmapDetails(BeatmapInfo beatmap) + { + this.beatmap = beatmap; + + AutoSizeAxes = Axes.Both; + + Children = new Drawable[] + { + new FillFlowContainer + { + Direction = FillDirection.Vertical, + RelativeSizeAxes = Axes.X, + AutoSizeAxes = Axes.Y, + Children = new Drawable[] + { + title = new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Shadow = false, + TextSize = 24, + Font = @"Exo2.0-BoldItalic", + }, + artist = new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Shadow = false, + TextSize = 20, + Font = @"Exo2.0-BoldItalic", + }, + versionMapper = new OsuSpriteText + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Shadow = false, + TextSize = 16, + Font = @"Exo2.0-Bold", + }, + } + } + }; + } + + [BackgroundDependencyLoader] + private void load(OsuColour colours, OsuConfigManager config) + { + title.Colour = artist.Colour = colours.BlueDarker; + versionMapper.Colour = colours.Gray8; + + versionMapper.Text = $"{beatmap.Version} - mapped by {beatmap.Metadata.Author}"; + + preferUnicode = config.GetBindable(OsuConfig.ShowUnicode); + preferUnicode.ValueChanged += unicode => + { + title.Text = unicode ? beatmap.Metadata.TitleUnicode : beatmap.Metadata.Title; + artist.Text = unicode ? beatmap.Metadata.ArtistUnicode : beatmap.Metadata.Artist; + }; + preferUnicode.TriggerChange(); + } + } + + private class UserHeader : Container + { + private readonly User user; + private readonly Sprite cover; + + public UserHeader(User user) + { + this.user = user; + Children = new Drawable[] + { + cover = new Sprite + { + FillMode = FillMode.Fill, + Anchor = Anchor.Centre, + Origin = Anchor.Centre, + }, + new OsuSpriteText + { + Font = @"Exo2.0-RegularItalic", + Text = user.Username, + Anchor = Anchor.BottomCentre, + Origin = Anchor.BottomCentre, + TextSize = 30, + Padding = new MarginPadding { Bottom = 10 }, + } + }; + } + + [BackgroundDependencyLoader] + private void load(TextureStore textures) + { + cover.Texture = textures.Get(user.CoverUrl); + } + } + + private class SlowScoreCounter : ScoreCounter + { + protected override double RollingDuration => 3000; + + protected override EasingTypes RollingEasing => EasingTypes.OutPow10; + + public SlowScoreCounter(uint leading = 0) : base(leading) + { + DisplayedCountSpriteText.Shadow = false; + } + } + } +} \ No newline at end of file diff --git a/osu.Game/Screens/Ranking/ResultsScorePage.cs b/osu.Game/Screens/Ranking/ResultsScorePage.cs deleted file mode 100644 index e8d6ac36bf..0000000000 --- a/osu.Game/Screens/Ranking/ResultsScorePage.cs +++ /dev/null @@ -1,132 +0,0 @@ -// Copyright (c) 2007-2017 ppy Pty Ltd . -// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE - -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Framework.Graphics.Primitives; -using osu.Framework.Graphics.Sprites; -using osu.Framework.Graphics.Textures; -using osu.Game.Graphics; -using osu.Game.Graphics.Sprites; -using osu.Game.Graphics.UserInterface; -using osu.Game.Modes.Scoring; -using osu.Game.Screens.Select.Leaderboards; -using osu.Game.Users; -using OpenTK; -using OpenTK.Graphics; - -namespace osu.Game.Screens.Ranking -{ - internal class ResultsScorePage : ResultsPage - { - private ScoreCounter scoreCounter; - - public ResultsScorePage(Score score) : base(score) { } - - [BackgroundDependencyLoader] - private void load(OsuColour colours) - { - const float user_header_height = 150; - - Children = new Drawable[] - { - new Container - { - RelativeSizeAxes = Axes.Both, - Padding = new MarginPadding { Top = user_header_height }, - Children = new Drawable[] - { - new Box - { - RelativeSizeAxes = Axes.Both, - Colour = Color4.White, - }, - } - }, - new FillFlowContainer - { - RelativeSizeAxes = Axes.X, - AutoSizeAxes = Axes.Y, - Direction = FillDirection.Vertical, - Children = new Drawable[] - { - new UserHeader(Score.User) - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - RelativeSizeAxes = Axes.X, - Height = user_header_height, - }, - new DrawableRank(Score.Rank) - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - Size = new Vector2(150, 80), - }, - scoreCounter = new SlowScoreCounter(6) - { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, - Colour = colours.PinkDarker, - TextSize = 60, - }, - } - } - }; - } - - protected override void LoadComplete() - { - base.LoadComplete(); - Schedule(() => scoreCounter.Increment(Score.TotalScore)); - } - - private class UserHeader : Container - { - private readonly User user; - private readonly Sprite cover; - - public UserHeader(User user) - { - this.user = user; - Children = new Drawable[] - { - cover = new Sprite - { - FillMode = FillMode.Fill, - Anchor = Anchor.Centre, - Origin = Anchor.Centre, - }, - new OsuSpriteText - { - Font = @"Exo2.0-RegularItalic", - Text = user.Username, - Anchor = Anchor.BottomCentre, - Origin = Anchor.BottomCentre, - TextSize = 30, - Padding = new MarginPadding { Bottom = 10 }, - } - }; - } - - [BackgroundDependencyLoader] - private void load(TextureStore textures) - { - cover.Texture = textures.Get(user.CoverUrl); - } - } - - private class SlowScoreCounter : ScoreCounter - { - protected override double RollingDuration => 3000; - - protected override EasingTypes RollingEasing => EasingTypes.OutPow10; - - public SlowScoreCounter(uint leading = 0) : base(leading) - { - DisplayedCountSpriteText.Shadow = false; - } - } - } -} \ No newline at end of file diff --git a/osu.Game/osu.Game.csproj b/osu.Game/osu.Game.csproj index 887c37e20a..fe331c6356 100644 --- a/osu.Game/osu.Game.csproj +++ b/osu.Game/osu.Game.csproj @@ -203,8 +203,8 @@ - - + + From 49fc91cf375678bd3aece6f13169282ae6da77bf Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 16:28:11 +0900 Subject: [PATCH 05/20] Add an exit transition. --- osu.Game/Screens/Ranking/Results.cs | 45 +++++++++++++++++++---------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index e440799e25..9536f862b0 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -1,6 +1,7 @@ // Copyright (c) 2007-2017 ppy Pty Ltd . // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE +using System.Collections.Generic; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.IEnumerableExtensions; @@ -43,13 +44,15 @@ namespace osu.Game.Screens.Ranking this.score = score; } + private const float transition_time = 800; + + private IEnumerable allCircles => new Drawable[] { circleOuterBackground, circleInner, circleOuter }; + protected override void OnEntering(Screen last) { base.OnEntering(last); (Background as BackgroundScreenBeatmap)?.BlurTo(background_blur, 2500, EasingTypes.OutQuint); - var allCircles = new[] { circleOuterBackground, circleInner, circleOuter }; - allCircles.ForEach(c => { c.FadeOut(); @@ -60,31 +63,43 @@ namespace osu.Game.Screens.Ranking modeChangeButtons.FadeOut(); currentPage.FadeOut(); - const float appear_time = 800; + - circleOuterBackground.ScaleTo(1, appear_time, EasingTypes.OutQuint); - circleOuterBackground.FadeTo(1, appear_time, EasingTypes.OutQuint); + circleOuterBackground.ScaleTo(1, transition_time, EasingTypes.OutQuint); + circleOuterBackground.FadeTo(1, transition_time, EasingTypes.OutQuint); - Content.Delay(appear_time * 0.25f, true); + Content.Delay(transition_time * 0.25f, true); - circleOuter.ScaleTo(1, appear_time, EasingTypes.OutQuint); - circleOuter.FadeTo(1, appear_time, EasingTypes.OutQuint); + circleOuter.ScaleTo(1, transition_time, EasingTypes.OutQuint); + circleOuter.FadeTo(1, transition_time, EasingTypes.OutQuint); - Content.Delay(appear_time * 0.3f, true); + Content.Delay(transition_time * 0.3f, true); - backgroundParallax.FadeIn(appear_time, EasingTypes.OutQuint); + backgroundParallax.FadeIn(transition_time, EasingTypes.OutQuint); - circleInner.ScaleTo(1, appear_time, EasingTypes.OutQuint); - circleInner.FadeTo(1, appear_time, EasingTypes.OutQuint); + circleInner.ScaleTo(1, transition_time, EasingTypes.OutQuint); + circleInner.FadeTo(1, transition_time, EasingTypes.OutQuint); - Content.Delay(appear_time * 0.4f, true); + Content.Delay(transition_time * 0.4f, true); - modeChangeButtons.FadeIn(appear_time, EasingTypes.OutQuint); - currentPage.FadeIn(appear_time, EasingTypes.OutQuint); + modeChangeButtons.FadeIn(transition_time, EasingTypes.OutQuint); + currentPage.FadeIn(transition_time, EasingTypes.OutQuint); Content.DelayReset(); } + protected override bool OnExiting(Screen next) + { + allCircles.ForEach(c => + { + c.ScaleTo(0, transition_time, EasingTypes.OutSine); + }); + + Content.FadeOut(transition_time / 4); + + return base.OnExiting(next); + } + [BackgroundDependencyLoader] private void load() { From 968d46a10f7e80f7228e818c791c23ac461921d9 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 11 Apr 2017 16:35:00 +0900 Subject: [PATCH 06/20] whitespace. --- osu.Game/Screens/Ranking/Results.cs | 2 -- 1 file changed, 2 deletions(-) diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 9536f862b0..ef455c3944 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -63,8 +63,6 @@ namespace osu.Game.Screens.Ranking modeChangeButtons.FadeOut(); currentPage.FadeOut(); - - circleOuterBackground.ScaleTo(1, transition_time, EasingTypes.OutQuint); circleOuterBackground.FadeTo(1, transition_time, EasingTypes.OutQuint); From 886ac1fb4033f2bab07bdb22ae2ccd7943029c45 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 15:16:50 +0900 Subject: [PATCH 07/20] Add progress graph background and update ruleset references. --- .../Tests/TestCaseResults.cs | 5 ++- osu.Game/Screens/Ranking/Results.cs | 4 +-- osu.Game/Screens/Ranking/ResultsPage.cs | 8 ++--- .../Screens/Ranking/ResultsPageRanking.cs | 8 ++--- osu.Game/Screens/Ranking/ResultsPageScore.cs | 33 +++++++++++++++---- 5 files changed, 38 insertions(+), 20 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs index afb8f73853..0bac4b6484 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs @@ -3,8 +3,7 @@ using osu.Framework.Allocation; using osu.Framework.Testing; using osu.Game.Beatmaps; using osu.Game.Database; -using osu.Game.Modes; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Ranking; using osu.Game.Users; @@ -30,7 +29,7 @@ namespace osu.Desktop.VisualTests.Tests if (beatmap == null) { - var beatmapInfo = db.Query().FirstOrDefault(b => b.Mode == PlayMode.Osu); + var beatmapInfo = db.Query().FirstOrDefault(b => b.RulesetID == 0); if (beatmapInfo != null) beatmap = db.GetWorkingBeatmap(beatmapInfo); } diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index ef455c3944..7fb0f628b9 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -214,10 +214,10 @@ namespace osu.Game.Screens.Ranking switch (mode) { case ResultMode.Summary: - currentPage = new ResultsPageScore(score, Beatmap.BeatmapInfo); + currentPage = new ResultsPageScore(score, Beatmap); break; case ResultMode.Ranking: - currentPage = new ResultsPageRanking(score, Beatmap.BeatmapInfo); + currentPage = new ResultsPageRanking(score, Beatmap); break; } diff --git a/osu.Game/Screens/Ranking/ResultsPage.cs b/osu.Game/Screens/Ranking/ResultsPage.cs index 5cafaf5e44..55d1745c93 100644 --- a/osu.Game/Screens/Ranking/ResultsPage.cs +++ b/osu.Game/Screens/Ranking/ResultsPage.cs @@ -6,9 +6,9 @@ using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Sprites; -using osu.Game.Database; +using osu.Game.Beatmaps; using osu.Game.Graphics; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; using OpenTK; using OpenTK.Graphics; @@ -17,13 +17,13 @@ namespace osu.Game.Screens.Ranking internal class ResultsPage : Container { protected readonly Score Score; - protected readonly BeatmapInfo Beatmap; + protected readonly WorkingBeatmap Beatmap; private CircularContainer content; private Box fill; protected override Container Content => content; - public ResultsPage(Score score, BeatmapInfo beatmap) + public ResultsPage(Score score, WorkingBeatmap beatmap) { Score = score; Beatmap = beatmap; diff --git a/osu.Game/Screens/Ranking/ResultsPageRanking.cs b/osu.Game/Screens/Ranking/ResultsPageRanking.cs index 07e9233aba..827abd556e 100644 --- a/osu.Game/Screens/Ranking/ResultsPageRanking.cs +++ b/osu.Game/Screens/Ranking/ResultsPageRanking.cs @@ -4,9 +4,9 @@ using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; -using osu.Game.Database; +using osu.Game.Beatmaps; using osu.Game.Graphics; -using osu.Game.Modes.Scoring; +using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Select.Leaderboards; using OpenTK; @@ -14,7 +14,7 @@ namespace osu.Game.Screens.Ranking { internal class ResultsPageRanking : ResultsPage { - public ResultsPageRanking(Score score, BeatmapInfo beatmap = null) : base(score, beatmap) + public ResultsPageRanking(Score score, WorkingBeatmap beatmap = null) : base(score, beatmap) { } @@ -33,7 +33,7 @@ namespace osu.Game.Screens.Ranking Origin = Anchor.Centre, Anchor = Anchor.Centre, RelativeSizeAxes = Axes.Both, - Beatmap = Beatmap ?? Score.Beatmap, + Beatmap = Beatmap.BeatmapInfo ?? Score.Beatmap, Scale = new Vector2(0.7f) } }; diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index 74063203c5..32da5ee841 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -13,12 +13,14 @@ using osu.Game.Database; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; -using osu.Game.Modes.Scoring; using osu.Game.Screens.Select.Leaderboards; using osu.Game.Users; using OpenTK; using OpenTK.Graphics; using System; +using osu.Game.Beatmaps; +using osu.Game.Screens.Play; +using osu.Game.Rulesets.Scoring; namespace osu.Game.Screens.Ranking { @@ -26,7 +28,7 @@ namespace osu.Game.Screens.Ranking { private ScoreCounter scoreCounter; - public ResultsPageScore(Score score, BeatmapInfo beatmap) : base(score, beatmap) { } + public ResultsPageScore(Score score, WorkingBeatmap beatmap) : base(score, beatmap) { } [BackgroundDependencyLoader] private void load(OsuColour colours) @@ -69,12 +71,29 @@ namespace osu.Game.Screens.Ranking Size = new Vector2(150, 60), Margin = new MarginPadding(20), }, - scoreCounter = new SlowScoreCounter(6) + new Container { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, - Colour = colours.PinkDarker, - TextSize = 50, + RelativeSizeAxes = Axes.X, + Height = 60, + Children = new Drawable[] + { + new SongProgressGraph + { + RelativeSizeAxes = Axes.Both, + Alpha = 0.5f, + Objects = Beatmap.Beatmap.HitObjects, + }, + scoreCounter = new SlowScoreCounter(6) + { + Anchor = Anchor.TopCentre, + Origin = Anchor.TopCentre, + Colour = colours.PinkDarker, + Y = 10, + TextSize = 50, + }, + } }, new OsuSpriteText { @@ -87,7 +106,7 @@ namespace osu.Game.Screens.Ranking Text = "total score", Margin = new MarginPadding { Bottom = 20 }, }, - new BeatmapDetails(Beatmap) + new BeatmapDetails(Beatmap.BeatmapInfo) { Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, @@ -283,4 +302,4 @@ namespace osu.Game.Screens.Ranking } } } -} \ No newline at end of file +} From 782019e0c7e418c0b275c205d8cc231ae001b5b7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 21:04:59 +0900 Subject: [PATCH 08/20] Make line gradient correct. --- osu.Game/Screens/Ranking/ResultsPageScore.cs | 32 +++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index 32da5ee841..01dde17c51 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -18,9 +18,11 @@ using osu.Game.Users; using OpenTK; using OpenTK.Graphics; using System; +using osu.Framework.Extensions.Color4Extensions; using osu.Game.Beatmaps; using osu.Game.Screens.Play; using osu.Game.Rulesets.Scoring; +using osu.Framework.Graphics.Colour; namespace osu.Game.Screens.Ranking { @@ -117,15 +119,35 @@ namespace osu.Game.Screens.Ranking Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, }, - new Box + new Container { + RelativeSizeAxes = Axes.X, + Size = new Vector2(0.75f, 1), Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Margin = new MarginPadding { Top = 10, Bottom = 10 }, - Colour = colours.GrayC, - RelativeSizeAxes = Axes.X, - Size = new Vector2(0.75f, 1), - } + Children = new Drawable[] + { + new Box + { + ColourInfo = ColourInfo.GradientHorizontal( + colours.GrayC.Opacity(0), + colours.GrayC.Opacity(0.9f)), + RelativeSizeAxes = Axes.Both, + Size = new Vector2(0.5f, 1), + }, + new Box + { + Anchor = Anchor.TopRight, + Origin = Anchor.TopRight, + ColourInfo = ColourInfo.GradientHorizontal( + colours.GrayC.Opacity(0.9f), + colours.GrayC.Opacity(0)), + RelativeSizeAxes = Axes.Both, + Size = new Vector2(0.5f, 1), + }, + } + }, } } }; From 28835bd5bd52daf5ee85ee77a7ffb366e44b0601 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 21:24:18 +0900 Subject: [PATCH 09/20] Add back comma separator to score display. --- osu.Game/Screens/Ranking/ResultsPageScore.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index 01dde17c51..5d9437a832 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -321,6 +321,7 @@ namespace osu.Game.Screens.Ranking public SlowScoreCounter(uint leading = 0) : base(leading) { DisplayedCountSpriteText.Shadow = false; + UseCommaSeparator = true; } } } From 32df625d82c31061903cd5709b71a5d38771ac21 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 21:25:33 +0900 Subject: [PATCH 10/20] Adjust text size and padding. --- osu.Game/Screens/Ranking/ResultsPageScore.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index 5d9437a832..0874767f05 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -92,8 +92,8 @@ namespace osu.Game.Screens.Ranking Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = colours.PinkDarker, - Y = 10, - TextSize = 50, + Y = 5, + TextSize = 60, }, } }, @@ -106,7 +106,7 @@ namespace osu.Game.Screens.Ranking Font = @"Exo2.0-Bold", TextSize = 16, Text = "total score", - Margin = new MarginPadding { Bottom = 20 }, + Margin = new MarginPadding { Bottom = 15 }, }, new BeatmapDetails(Beatmap.BeatmapInfo) { From f1bd64a74d50fe583095b6deeeed717c438f5302 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 21:35:11 +0900 Subject: [PATCH 11/20] Adjust colour metrics. --- osu.Game/Screens/Ranking/Results.cs | 2 +- osu.Game/Screens/Ranking/ResultsPage.cs | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 7fb0f628b9..fde1850b71 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -158,7 +158,7 @@ namespace osu.Game.Screens.Ranking { new Sprite { - Alpha = 0.5f, + Alpha = 0.2f, Texture = Beatmap?.Background, Anchor = Anchor.Centre, Origin = Anchor.Centre, diff --git a/osu.Game/Screens/Ranking/ResultsPage.cs b/osu.Game/Screens/Ranking/ResultsPage.cs index 55d1745c93..02eae3643b 100644 --- a/osu.Game/Screens/Ranking/ResultsPage.cs +++ b/osu.Game/Screens/Ranking/ResultsPage.cs @@ -52,9 +52,9 @@ namespace osu.Game.Screens.Ranking { EdgeEffect = new EdgeEffect { - Colour = Color4.Black.Opacity(1), + Colour = colours.GrayF.Opacity(0.8f), Type = EdgeEffectType.Shadow, - Radius = 15, + Radius = 1, }, RelativeSizeAxes = Axes.Both, Masking = true, @@ -75,7 +75,7 @@ namespace osu.Game.Screens.Ranking { EdgeEffect = new EdgeEffect { - Colour = Color4.Black.Opacity(0.4f), + Colour = Color4.Black.Opacity(0.2f), Type = EdgeEffectType.Shadow, Radius = 15, }, @@ -89,4 +89,4 @@ namespace osu.Game.Screens.Ranking } } -} \ No newline at end of file +} From 4a3fc710c47b490806865731734ed3d94730ef43 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 21:35:41 +0900 Subject: [PATCH 12/20] Add temporary combo/accuracy display. --- .../Tests/TestCaseResults.cs | 1 + osu.Game/Screens/Ranking/Results.cs | 49 +++++++++++++++++-- 2 files changed, 47 insertions(+), 3 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs index 0bac4b6484..389d32f540 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs @@ -40,6 +40,7 @@ namespace osu.Desktop.VisualTests.Tests { TotalScore = 2845370, Accuracy = 0.98, + MaxCombo = 123, Rank = ScoreRank.A, User = new User { diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index fde1850b71..019ad21bdb 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -15,6 +15,7 @@ using osu.Game.Graphics.Containers; using osu.Game.Screens.Backgrounds; using OpenTK; using OpenTK.Graphics; +using osu.Game.Graphics; namespace osu.Game.Screens.Ranking { @@ -99,7 +100,7 @@ namespace osu.Game.Screens.Ranking } [BackgroundDependencyLoader] - private void load() + private void load(OsuColour colours) { Children = new Drawable[] { @@ -173,7 +174,49 @@ namespace osu.Game.Screens.Ranking RelativeSizeAxes = Axes.X, Height = 50, Margin = new MarginPadding { Bottom = 110 }, - } + }, + new SpriteText + { + Text = $"{score.MaxCombo}x", + TextSize = 40, + RelativePositionAxes = Axes.X, + Font = @"Exo2.0-Bold", + X = 0.1f, + Colour = colours.BlueDarker, + Anchor = Anchor.CentreLeft, + Origin = Anchor.BottomCentre, + }, + new SpriteText + { + Text = $"max combo", + TextSize = 20, + RelativePositionAxes = Axes.X, + X = 0.1f, + Colour = colours.Gray6, + Anchor = Anchor.CentreLeft, + Origin = Anchor.TopCentre, + }, + new SpriteText + { + Text = $"{score.Accuracy:P2}", + TextSize = 40, + RelativePositionAxes = Axes.X, + Font = @"Exo2.0-Bold", + X = 0.9f, + Colour = colours.BlueDarker, + Anchor = Anchor.CentreLeft, + Origin = Anchor.BottomCentre, + }, + new SpriteText + { + Text = $"accuracy", + TextSize = 20, + RelativePositionAxes = Axes.X, + X = 0.9f, + Colour = colours.Gray6, + Anchor = Anchor.CentreLeft, + Origin = Anchor.TopCentre, + }, } }, circleInner = new CircularContainer @@ -228,4 +271,4 @@ namespace osu.Game.Screens.Ranking modeChangeButtons.Current.TriggerChange(); } } -} \ No newline at end of file +} From dc13d4d4ab193ce3a12c677252724000cba5385d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 21:36:34 +0900 Subject: [PATCH 13/20] Display an actual date/time. --- osu.Desktop.VisualTests/Tests/TestCaseResults.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs index 389d32f540..41e9d5adb0 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs @@ -1,4 +1,5 @@ -using System.Linq; +using System; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Testing; using osu.Game.Beatmaps; @@ -42,6 +43,7 @@ namespace osu.Desktop.VisualTests.Tests Accuracy = 0.98, MaxCombo = 123, Rank = ScoreRank.A, + Date = DateTime.Now, User = new User { Username = "peppy", From e8d55b5bb5772d8cb025afed421434418ca0388f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 21:38:05 +0900 Subject: [PATCH 14/20] Add back button. --- osu.Game/Screens/Ranking/Results.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 019ad21bdb..1aa8c5f4cf 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -16,6 +16,7 @@ using osu.Game.Screens.Backgrounds; using OpenTK; using OpenTK.Graphics; using osu.Game.Graphics; +using osu.Game.Graphics.UserInterface; namespace osu.Game.Screens.Ranking { @@ -242,7 +243,13 @@ namespace osu.Game.Screens.Ranking } } } - } + }, + new BackButton + { + Anchor = Anchor.BottomLeft, + Origin = Anchor.BottomLeft, + Action = Exit + }, }; modeChangeButtons.AddItem(ResultMode.Summary); From 2bf560a3710263e134e27038cc7e593c65ca177a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 21:38:29 +0900 Subject: [PATCH 15/20] Disable page three for now. --- osu.Game/Screens/Ranking/Results.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 1aa8c5f4cf..494755c7dc 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -254,7 +254,7 @@ namespace osu.Game.Screens.Ranking modeChangeButtons.AddItem(ResultMode.Summary); modeChangeButtons.AddItem(ResultMode.Ranking); - modeChangeButtons.AddItem(ResultMode.Share); + //modeChangeButtons.AddItem(ResultMode.Share); modeChangeButtons.Current.ValueChanged += mode => { From 15d62a0c76cf410b4b717f9487f90613dcb4baec Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 21:46:52 +0900 Subject: [PATCH 16/20] Add temporary ScoreRank assignment. --- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index b2c5d8319e..39008c5889 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -71,9 +71,26 @@ namespace osu.Game.Rulesets.Scoring Combo = Combo, MaxCombo = HighestCombo, Accuracy = Accuracy, + Rank = rankFrom(Accuracy), + Date = DateTime.Now, Health = Health, }; + private ScoreRank rankFrom(double acc) + { + if (acc == 1) + return ScoreRank.X; + if (acc > 0.95) + return ScoreRank.S; + if (acc > 0.9) + return ScoreRank.A; + if (acc > 0.8) + return ScoreRank.B; + if (acc > 0.7) + return ScoreRank.C; + return ScoreRank.D; + } + /// /// Resets this ScoreProcessor to a default state. /// From a0d9c14526739cba313d4f05012a5319ef9d1ce4 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 21:55:44 +0900 Subject: [PATCH 17/20] Add temporary means of getting the user which is responsible for a resulting play. --- osu.Game.Rulesets.Osu/OsuAutoReplay.cs | 6 ++++++ osu.Game/Rulesets/Replays/Replay.cs | 3 +++ osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 1 + osu.Game/Rulesets/UI/HitRenderer.cs | 8 +++++++- osu.Game/Screens/Play/Player.cs | 5 ++++- 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/osu.Game.Rulesets.Osu/OsuAutoReplay.cs b/osu.Game.Rulesets.Osu/OsuAutoReplay.cs index 6fc005fb6a..ee27a37e76 100644 --- a/osu.Game.Rulesets.Osu/OsuAutoReplay.cs +++ b/osu.Game.Rulesets.Osu/OsuAutoReplay.cs @@ -12,6 +12,7 @@ using System.Diagnostics; using osu.Framework.Graphics; using osu.Game.Rulesets.Objects.Types; using osu.Game.Rulesets.Replays; +using osu.Game.Users; namespace osu.Game.Rulesets.Osu { @@ -27,6 +28,11 @@ namespace osu.Game.Rulesets.Osu { this.beatmap = beatmap; + User = new User + { + Username = @"Autoplay", + }; + createAutoReplay(); } diff --git a/osu.Game/Rulesets/Replays/Replay.cs b/osu.Game/Rulesets/Replays/Replay.cs index 8e9d7cdaad..17e6324d9d 100644 --- a/osu.Game/Rulesets/Replays/Replay.cs +++ b/osu.Game/Rulesets/Replays/Replay.cs @@ -2,11 +2,14 @@ // Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE using System.Collections.Generic; +using osu.Game.Users; namespace osu.Game.Rulesets.Replays { public class Replay { + public User User; + public List Frames = new List(); } } \ No newline at end of file diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 39008c5889..294412e7c0 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -9,6 +9,7 @@ using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.UI; using osu.Game.Rulesets.Objects.Drawables; +using osu.Game.Users; namespace osu.Game.Rulesets.Scoring { diff --git a/osu.Game/Rulesets/UI/HitRenderer.cs b/osu.Game/Rulesets/UI/HitRenderer.cs index 098a4d5f03..021de37aae 100644 --- a/osu.Game/Rulesets/UI/HitRenderer.cs +++ b/osu.Game/Rulesets/UI/HitRenderer.cs @@ -91,11 +91,17 @@ namespace osu.Game.Rulesets.UI protected virtual FramedReplayInputHandler CreateReplayInputHandler(Replay replay) => new FramedReplayInputHandler(replay); + public Replay Replay { get; private set; } + /// /// Sets a replay to be used, overriding local input. /// /// The replay, null for local input. - public void SetReplay(Replay replay) => InputManager.ReplayInputHandler = replay != null ? CreateReplayInputHandler(replay) : null; + public void SetReplay(Replay replay) + { + Replay = replay; + InputManager.ReplayInputHandler = replay != null ? CreateReplayInputHandler(replay) : null; + } } /// diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index f1b1f7f2fe..6a7a69c47e 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -22,6 +22,7 @@ using System.Linq; using osu.Framework.Threading; using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Ranking; +using osu.Game.Users; namespace osu.Game.Screens.Play { @@ -266,7 +267,9 @@ namespace osu.Game.Screens.Play Delay(1000); onCompletionEvent = Schedule(delegate { - Push(new Results(scoreProcessor.CreateScore())); + var score = scoreProcessor.CreateScore(); + score.User = HitRenderer.Replay?.User ?? (Game as OsuGame)?.API?.LocalUser?.Value; + Push(new Results(score)); }); } From 49f4981f1ccd904de06da55e84931a0aa8a72686 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 22:07:47 +0900 Subject: [PATCH 18/20] Fix CI issues. --- osu.Game/Rulesets/Scoring/ScoreProcessor.cs | 1 - osu.Game/Screens/Play/Player.cs | 1 - osu.Game/Screens/Ranking/Results.cs | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs index 294412e7c0..39008c5889 100644 --- a/osu.Game/Rulesets/Scoring/ScoreProcessor.cs +++ b/osu.Game/Rulesets/Scoring/ScoreProcessor.cs @@ -9,7 +9,6 @@ using osu.Game.Rulesets.Judgements; using osu.Game.Rulesets.Objects; using osu.Game.Rulesets.UI; using osu.Game.Rulesets.Objects.Drawables; -using osu.Game.Users; namespace osu.Game.Rulesets.Scoring { diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index 6a7a69c47e..52518180d9 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -22,7 +22,6 @@ using System.Linq; using osu.Framework.Threading; using osu.Game.Rulesets.Scoring; using osu.Game.Screens.Ranking; -using osu.Game.Users; namespace osu.Game.Screens.Play { diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 494755c7dc..f4edc11436 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -189,7 +189,7 @@ namespace osu.Game.Screens.Ranking }, new SpriteText { - Text = $"max combo", + Text = "max combo", TextSize = 20, RelativePositionAxes = Axes.X, X = 0.1f, @@ -210,7 +210,7 @@ namespace osu.Game.Screens.Ranking }, new SpriteText { - Text = $"accuracy", + Text = "accuracy", TextSize = 20, RelativePositionAxes = Axes.X, X = 0.9f, From 2f53f2e248a6a39feb2d91298b1131293b41f07c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 18 Apr 2017 22:35:21 +0900 Subject: [PATCH 19/20] Add license headers. --- osu.Desktop.VisualTests/Tests/TestCaseResults.cs | 5 ++++- osu.Game/Screens/Ranking/AspectContainer.cs | 3 +++ osu.Game/Screens/Ranking/ResultMode.cs | 3 +++ osu.Game/Screens/Ranking/ResultModeButton.cs | 3 +++ osu.Game/Screens/Ranking/ResultModeTabControl.cs | 3 +++ 5 files changed, 16 insertions(+), 1 deletion(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs index 41e9d5adb0..93e0646255 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseResults.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseResults.cs @@ -1,4 +1,7 @@ -using System; +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Testing; diff --git a/osu.Game/Screens/Ranking/AspectContainer.cs b/osu.Game/Screens/Ranking/AspectContainer.cs index 42e20adeb9..4699b4ab92 100644 --- a/osu.Game/Screens/Ranking/AspectContainer.cs +++ b/osu.Game/Screens/Ranking/AspectContainer.cs @@ -1,3 +1,6 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; diff --git a/osu.Game/Screens/Ranking/ResultMode.cs b/osu.Game/Screens/Ranking/ResultMode.cs index b7f030f338..eeb04033ea 100644 --- a/osu.Game/Screens/Ranking/ResultMode.cs +++ b/osu.Game/Screens/Ranking/ResultMode.cs @@ -1,3 +1,6 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + namespace osu.Game.Screens.Ranking { public enum ResultMode diff --git a/osu.Game/Screens/Ranking/ResultModeButton.cs b/osu.Game/Screens/Ranking/ResultModeButton.cs index 5849cd4e14..fc62342860 100644 --- a/osu.Game/Screens/Ranking/ResultModeButton.cs +++ b/osu.Game/Screens/Ranking/ResultModeButton.cs @@ -1,3 +1,6 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; diff --git a/osu.Game/Screens/Ranking/ResultModeTabControl.cs b/osu.Game/Screens/Ranking/ResultModeTabControl.cs index 9335f1daef..346bff5720 100644 --- a/osu.Game/Screens/Ranking/ResultModeTabControl.cs +++ b/osu.Game/Screens/Ranking/ResultModeTabControl.cs @@ -1,3 +1,6 @@ +// Copyright (c) 2007-2017 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + using osu.Framework.Graphics; using osu.Framework.Graphics.Primitives; using osu.Framework.Graphics.UserInterface; From 1f7ed72dc6697d8f04813dda30ce1ac535497f0b Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 19 Apr 2017 17:32:18 +0900 Subject: [PATCH 20/20] Update font/size. --- osu-resources | 2 +- osu.Game/OsuGameBase.cs | 1 + osu.Game/Screens/Ranking/ResultsPageScore.cs | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/osu-resources b/osu-resources index ce76f812d3..b90c4ed490 160000 --- a/osu-resources +++ b/osu-resources @@ -1 +1 @@ -Subproject commit ce76f812d3e059233e1dea395b125352f638b2da +Subproject commit b90c4ed490f76f2995662b3a8af3a32b8756a012 diff --git a/osu.Game/OsuGameBase.cs b/osu.Game/OsuGameBase.cs index 371699eab3..efda7ff7a0 100644 --- a/osu.Game/OsuGameBase.cs +++ b/osu.Game/OsuGameBase.cs @@ -116,6 +116,7 @@ namespace osu.Game Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Exo2.0-BlackItalic")); Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Venera")); + Fonts.AddStore(new GlyphStore(Resources, @"Fonts/Venera-Light")); OszArchiveReader.Register(); diff --git a/osu.Game/Screens/Ranking/ResultsPageScore.cs b/osu.Game/Screens/Ranking/ResultsPageScore.cs index 0874767f05..5a6d492778 100644 --- a/osu.Game/Screens/Ranking/ResultsPageScore.cs +++ b/osu.Game/Screens/Ranking/ResultsPageScore.cs @@ -92,8 +92,8 @@ namespace osu.Game.Screens.Ranking Anchor = Anchor.TopCentre, Origin = Anchor.TopCentre, Colour = colours.PinkDarker, - Y = 5, - TextSize = 60, + Y = 10, + TextSize = 56, }, } }, @@ -321,6 +321,7 @@ namespace osu.Game.Screens.Ranking public SlowScoreCounter(uint leading = 0) : base(leading) { DisplayedCountSpriteText.Shadow = false; + DisplayedCountSpriteText.Font = @"Venera-Light"; UseCommaSeparator = true; } }