From 90d763fda51b8a5255179ee41ec466ebb9e1cc4b Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Sun, 25 Mar 2018 10:00:30 -0700 Subject: [PATCH] Apply review changes and suggestions --- osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs | 1 - osu.Game.Tests/Visual/TestCaseMods.cs | 12 ++++----- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 27 ++++++++++++------- 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs b/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs index c78274e453..b5e9540eae 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs @@ -14,7 +14,6 @@ namespace osu.Game.Rulesets.Osu.Mods public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot; public override string Description => @"Automatic cursor movement - just follow the rhythm."; public override double ScoreMultiplier => 1; - public override bool Ranked => false; public override Type[] IncompatibleMods => new[] { typeof(OsuModSpunOut), typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail), typeof(ModAutoplay) }; } } diff --git a/osu.Game.Tests/Visual/TestCaseMods.cs b/osu.Game.Tests/Visual/TestCaseMods.cs index 4f841d3ee2..b194462a96 100644 --- a/osu.Game.Tests/Visual/TestCaseMods.cs +++ b/osu.Game.Tests/Visual/TestCaseMods.cs @@ -24,7 +24,7 @@ namespace osu.Game.Tests.Visual [Description("mod select and icon display")] public class TestCaseMods : OsuTestCase { - private const string unranked_suffix = " (Unranked)"; + private const string unranked_suffix = "(Unranked)"; private RulesetStore rulesets; private ModDisplay modDisplay; @@ -105,7 +105,7 @@ namespace osu.Game.Tests.Visual private void testManiaMods(ManiaRuleset ruleset) { - testRankedTextUnranked(ruleset.GetModsFor(ModType.Special).First(m => m is ManiaModRandom)); + testRankedText(ruleset.GetModsFor(ModType.Special).First(m => m is ManiaModRandom)); } private void testSingleMod(Mod mod) @@ -182,13 +182,13 @@ namespace osu.Game.Tests.Visual checkLabelColor(Color4.White); } - private void testRankedTextUnranked(Mod mod) + private void testRankedText(Mod mod) { - AddAssert("check for ranked", () => !modSelect.RankedLabel.Text.EndsWith(unranked_suffix)); + AddAssert("check for ranked", () => !modSelect.RankedLabel.Text.Equals(unranked_suffix)); selectNext(mod); - AddAssert("check for unranked", () => modSelect.RankedLabel.Text.EndsWith(unranked_suffix)); + AddAssert("check for unranked", () => modSelect.RankedLabel.Text.Equals(unranked_suffix)); selectPrevious(mod); - AddAssert("check for ranked", () => !modSelect.RankedLabel.Text.EndsWith(unranked_suffix)); + AddAssert("check for ranked", () => !modSelect.RankedLabel.Text.Equals(unranked_suffix)); } private void selectNext(Mod mod) => AddStep($"left click {mod.Name}", () => modSelect.GetModButton(mod)?.SelectNext(1)); diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 21c1082191..604e683917 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -30,6 +30,7 @@ namespace osu.Game.Overlays.Mods protected Color4 LowMultiplierColour, HighMultiplierColour, RankedColour; protected readonly TriangleButton DeselectAllButton; + protected readonly OsuSpriteText ScoreLabel; protected readonly OsuSpriteText MultiplierLabel; protected readonly OsuSpriteText RankedLabel; private readonly FillFlowContainer footerContainer; @@ -56,9 +57,9 @@ namespace osu.Game.Overlays.Mods { SelectedMods.ValueChanged += selectedModsChanged; - LowMultiplierColour = colours.Yellow; + LowMultiplierColour = colours.Red; HighMultiplierColour = colours.Green; - RankedColour = colours.Red; + RankedColour = colours.Blue; if (osu != null) Ruleset.BindTo(osu.Ruleset); @@ -99,6 +100,14 @@ namespace osu.Game.Overlays.Mods ranked &= mod.Ranked; } + ScoreLabel.Text = "Score Multiplier:"; + if (multiplier > 1.0) + ScoreLabel.FadeColour(HighMultiplierColour, 200); + else if (multiplier < 1.0) + ScoreLabel.FadeColour(LowMultiplierColour, 200); + else + ScoreLabel.FadeColour(Color4.White, 200); + MultiplierLabel.Text = $"{multiplier:N2}x"; if (multiplier > 1.0) MultiplierLabel.FadeColour(HighMultiplierColour, 200); @@ -110,14 +119,11 @@ namespace osu.Game.Overlays.Mods RankedLabel.Text = null; if (!ranked) { - RankedLabel.Text += " (Unranked)"; + RankedLabel.Text = "(Unranked)"; RankedLabel.FadeColour(RankedColour, 200); } else - { - RankedLabel.Text = null; RankedLabel.FadeColour(Color4.White, 200); - } } protected override void PopOut() @@ -362,14 +368,14 @@ namespace osu.Game.Overlays.Mods Right = 20 } }, - new OsuSpriteText + ScoreLabel = new OsuSpriteText { - Text = @"Score Multiplier: ", TextSize = 30, Shadow = true, Margin = new MarginPadding { - Top = 5 + Top = 5, + Right = 10 } }, MultiplierLabel = new OsuSpriteText @@ -389,7 +395,8 @@ namespace osu.Game.Overlays.Mods Shadow = true, Margin = new MarginPadding { - Top = 5 + Top = 5, + Left = 10 } } }