From 7fed8d64de9ce135ccc6fd40115d321f72af4e4c Mon Sep 17 00:00:00 2001 From: Ali Rizvi Date: Sat, 31 Mar 2018 04:59:08 +0900 Subject: [PATCH 1/6] Implement Judgement Colours --- .../Rulesets/Judgements/DrawableJudgement.cs | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index ca203e1cdb..4b01cc5ccd 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -23,6 +23,8 @@ namespace osu.Game.Rulesets.Judgements { private const float judgement_size = 80; + private OsuColour colours; + protected readonly Judgement Judgement; public readonly DrawableHitObject JudgedObject; @@ -45,11 +47,12 @@ namespace osu.Game.Rulesets.Judgements [BackgroundDependencyLoader] private void load(OsuColour colours) { + this.colours = colours; Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText { Text = Judgement.Result.GetDescription().ToUpper(), Font = @"Venera", - Colour = Judgement.Result == HitResult.Miss ? colours.Red : Color4.White, + Colour = judgementColour(Judgement.Result), Scale = new Vector2(0.85f, 1), TextSize = 12 }, restrictSize: false); @@ -84,5 +87,27 @@ namespace osu.Game.Rulesets.Judgements Expire(true); } + + private Color4 judgementColour(HitResult judgement) + { + switch (judgement) + { + case HitResult.Perfect: + case HitResult.Great: + return colours.Blue; + + case HitResult.Ok: + case HitResult.Good: + return colours.Green; + + case HitResult.Meh: + return colours.Yellow; + + case HitResult.Miss: + return colours.Red; + } + + return Color4.White; + } } } From 9df525a38d86d18b8048131ce796301556394730 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Wed, 4 Apr 2018 15:11:16 +0900 Subject: [PATCH 2/6] Remove extra whitespace In general we don't really do this elsewhere in the codebase. --- osu.Game/Rulesets/Judgements/DrawableJudgement.cs | 3 --- 1 file changed, 3 deletions(-) diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index 4b01cc5ccd..f20997e96d 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -95,14 +95,11 @@ namespace osu.Game.Rulesets.Judgements case HitResult.Perfect: case HitResult.Great: return colours.Blue; - case HitResult.Ok: case HitResult.Good: return colours.Green; - case HitResult.Meh: return colours.Yellow; - case HitResult.Miss: return colours.Red; } From bed46b1f7e38b3d92ce55f7bce63bb0680f92625 Mon Sep 17 00:00:00 2001 From: Dan Balasescu <1329837+smoogipoo@users.noreply.github.com> Date: Wed, 4 Apr 2018 15:13:42 +0900 Subject: [PATCH 3/6] Split local variable assignment from construction of children --- osu.Game/Rulesets/Judgements/DrawableJudgement.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs index f20997e96d..a1a27c0d43 100644 --- a/osu.Game/Rulesets/Judgements/DrawableJudgement.cs +++ b/osu.Game/Rulesets/Judgements/DrawableJudgement.cs @@ -48,6 +48,7 @@ namespace osu.Game.Rulesets.Judgements private void load(OsuColour colours) { this.colours = colours; + Child = new SkinnableDrawable($"Play/{Judgement.Result}", _ => JudgementText = new OsuSpriteText { Text = Judgement.Result.GetDescription().ToUpper(), From 364c3bca06122e0c04ed72240cd9a379381df19b Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 4 Apr 2018 16:24:03 +0900 Subject: [PATCH 4/6] Fix osu!catch autoplay missing starts/ends of JuiceStreams Fixes #2328. Would only happen when ticks and ends were spaced too far apart (or there were no ticks in a juicestream). --- .../TestCaseJuiceStream.cs | 62 +++++++++++++++++++ .../Replays/CatchAutoGenerator.cs | 1 + 2 files changed, 63 insertions(+) create mode 100644 osu.Game.Rulesets.Catch.Tests/TestCaseJuiceStream.cs diff --git a/osu.Game.Rulesets.Catch.Tests/TestCaseJuiceStream.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseJuiceStream.cs new file mode 100644 index 0000000000..0af60cc452 --- /dev/null +++ b/osu.Game.Rulesets.Catch.Tests/TestCaseJuiceStream.cs @@ -0,0 +1,62 @@ +// Copyright (c) 2007-2018 ppy Pty Ltd . +// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE + +using System.Collections.Generic; +using System.Linq; +using osu.Game.Beatmaps; +using osu.Game.Rulesets.Catch.Objects; +using osu.Game.Rulesets.Catch.UI; +using osu.Game.Rulesets.Objects.Types; +using osu.Game.Screens.Play; +using osu.Game.Tests.Visual; +using OpenTK; + +namespace osu.Game.Rulesets.Catch.Tests +{ + public class TestCaseJuiceStream : TestCasePlayer + { + public TestCaseJuiceStream() + : base(new CatchRuleset()) + { + } + + protected override Beatmap CreateBeatmap(Ruleset ruleset) + { + var beatmap = new Beatmap + { + BeatmapInfo = new BeatmapInfo + { + BaseDifficulty = new BeatmapDifficulty { CircleSize = 6, SliderMultiplier = 3 }, + Ruleset = ruleset.RulesetInfo + } + }; + + for (int i = 0; i < 100; i++) + { + float width = (i % 10 + 1) / 20f; + + beatmap.HitObjects.Add(new JuiceStream + { + X = 0.5f - width / 2, + ControlPoints = new List + { + Vector2.Zero, + new Vector2(width * CatchPlayfield.BASE_WIDTH, 0) + }, + CurveType = CurveType.Linear, + Distance = width * CatchPlayfield.BASE_WIDTH, + StartTime = i * 2000, + NewCombo = i % 8 == 0 + }); + } + + return beatmap; + } + + protected override Player CreatePlayer(WorkingBeatmap beatmap, Ruleset ruleset) + { + beatmap.Mods.Value = beatmap.Mods.Value.Concat(new[] { ruleset.GetAutoplayMod() }); + return base.CreatePlayer(beatmap, ruleset); + } + } +} diff --git a/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs b/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs index f1503a14ee..244ab2b508 100644 --- a/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs +++ b/osu.Game.Rulesets.Catch/Replays/CatchAutoGenerator.cs @@ -108,6 +108,7 @@ namespace osu.Game.Rulesets.Catch.Replays case BananaShower.Banana _: case TinyDroplet _: case Droplet _: + case Fruit _: moveToNext(nestedObj); break; } From d4cb00e08f87f2a15e045a2c9fcfc2618dd82d59 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Wed, 4 Apr 2018 17:12:41 +0900 Subject: [PATCH 5/6] Don't display judgements in OsuEditPlayfield --- osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs | 1 + osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs b/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs index 5f232b1889..46a3d8575f 100644 --- a/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs +++ b/osu.Game.Rulesets.Osu/Edit/OsuEditPlayfield.cs @@ -8,5 +8,6 @@ namespace osu.Game.Rulesets.Osu.Edit public class OsuEditPlayfield : OsuPlayfield { protected override bool ProxyApproachCircles => false; + protected override bool DisplayJudgements => false; } } diff --git a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs index 0c5d757474..9010f66acb 100644 --- a/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs +++ b/osu.Game.Rulesets.Osu/UI/OsuPlayfield.cs @@ -24,6 +24,7 @@ namespace osu.Game.Rulesets.Osu.UI // Todo: This should not be a thing, but is currently required for the editor // https://github.com/ppy/osu-framework/issues/1283 protected virtual bool ProxyApproachCircles => true; + protected virtual bool DisplayJudgements => true; public static readonly Vector2 BASE_SIZE = new Vector2(512, 384); @@ -73,7 +74,7 @@ namespace osu.Game.Rulesets.Osu.UI private void onJudgement(DrawableHitObject judgedObject, Judgement judgement) { - if (!judgedObject.DisplayJudgement) + if (!judgedObject.DisplayJudgement || !DisplayJudgements) return; DrawableOsuJudgement explosion = new DrawableOsuJudgement(judgement, judgedObject) From e69951b59f63769397da87caeec84e3cae6c2221 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 4 Apr 2018 18:48:19 +0900 Subject: [PATCH 6/6] Rename test to signify it's got auto enabled --- .../{TestCaseJuiceStream.cs => TestCaseAutoJuiceStream.cs} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename osu.Game.Rulesets.Catch.Tests/{TestCaseJuiceStream.cs => TestCaseAutoJuiceStream.cs} (92%) diff --git a/osu.Game.Rulesets.Catch.Tests/TestCaseJuiceStream.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseAutoJuiceStream.cs similarity index 92% rename from osu.Game.Rulesets.Catch.Tests/TestCaseJuiceStream.cs rename to osu.Game.Rulesets.Catch.Tests/TestCaseAutoJuiceStream.cs index 0af60cc452..11a22c69f3 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestCaseJuiceStream.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestCaseAutoJuiceStream.cs @@ -13,9 +13,9 @@ using OpenTK; namespace osu.Game.Rulesets.Catch.Tests { - public class TestCaseJuiceStream : TestCasePlayer + public class TestCaseAutoJuiceStream : TestCasePlayer { - public TestCaseJuiceStream() + public TestCaseAutoJuiceStream() : base(new CatchRuleset()) { }