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

Apply review changes and suggestions

This commit is contained in:
Joseph Madamba 2018-03-25 10:00:30 -07:00
parent 78a7564acd
commit 90d763fda5
3 changed files with 23 additions and 17 deletions

View File

@ -14,7 +14,6 @@ namespace osu.Game.Rulesets.Osu.Mods
public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot; public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot;
public override string Description => @"Automatic cursor movement - just follow the rhythm."; public override string Description => @"Automatic cursor movement - just follow the rhythm.";
public override double ScoreMultiplier => 1; 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) }; public override Type[] IncompatibleMods => new[] { typeof(OsuModSpunOut), typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail), typeof(ModAutoplay) };
} }
} }

View File

@ -24,7 +24,7 @@ namespace osu.Game.Tests.Visual
[Description("mod select and icon display")] [Description("mod select and icon display")]
public class TestCaseMods : OsuTestCase public class TestCaseMods : OsuTestCase
{ {
private const string unranked_suffix = " (Unranked)"; private const string unranked_suffix = "(Unranked)";
private RulesetStore rulesets; private RulesetStore rulesets;
private ModDisplay modDisplay; private ModDisplay modDisplay;
@ -105,7 +105,7 @@ namespace osu.Game.Tests.Visual
private void testManiaMods(ManiaRuleset ruleset) 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) private void testSingleMod(Mod mod)
@ -182,13 +182,13 @@ namespace osu.Game.Tests.Visual
checkLabelColor(Color4.White); 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); selectNext(mod);
AddAssert("check for unranked", () => modSelect.RankedLabel.Text.EndsWith(unranked_suffix)); AddAssert("check for unranked", () => modSelect.RankedLabel.Text.Equals(unranked_suffix));
selectPrevious(mod); 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)); private void selectNext(Mod mod) => AddStep($"left click {mod.Name}", () => modSelect.GetModButton(mod)?.SelectNext(1));

View File

@ -30,6 +30,7 @@ namespace osu.Game.Overlays.Mods
protected Color4 LowMultiplierColour, HighMultiplierColour, RankedColour; protected Color4 LowMultiplierColour, HighMultiplierColour, RankedColour;
protected readonly TriangleButton DeselectAllButton; protected readonly TriangleButton DeselectAllButton;
protected readonly OsuSpriteText ScoreLabel;
protected readonly OsuSpriteText MultiplierLabel; protected readonly OsuSpriteText MultiplierLabel;
protected readonly OsuSpriteText RankedLabel; protected readonly OsuSpriteText RankedLabel;
private readonly FillFlowContainer footerContainer; private readonly FillFlowContainer footerContainer;
@ -56,9 +57,9 @@ namespace osu.Game.Overlays.Mods
{ {
SelectedMods.ValueChanged += selectedModsChanged; SelectedMods.ValueChanged += selectedModsChanged;
LowMultiplierColour = colours.Yellow; LowMultiplierColour = colours.Red;
HighMultiplierColour = colours.Green; HighMultiplierColour = colours.Green;
RankedColour = colours.Red; RankedColour = colours.Blue;
if (osu != null) if (osu != null)
Ruleset.BindTo(osu.Ruleset); Ruleset.BindTo(osu.Ruleset);
@ -99,6 +100,14 @@ namespace osu.Game.Overlays.Mods
ranked &= mod.Ranked; 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"; MultiplierLabel.Text = $"{multiplier:N2}x";
if (multiplier > 1.0) if (multiplier > 1.0)
MultiplierLabel.FadeColour(HighMultiplierColour, 200); MultiplierLabel.FadeColour(HighMultiplierColour, 200);
@ -110,14 +119,11 @@ namespace osu.Game.Overlays.Mods
RankedLabel.Text = null; RankedLabel.Text = null;
if (!ranked) if (!ranked)
{ {
RankedLabel.Text += " (Unranked)"; RankedLabel.Text = "(Unranked)";
RankedLabel.FadeColour(RankedColour, 200); RankedLabel.FadeColour(RankedColour, 200);
} }
else else
{
RankedLabel.Text = null;
RankedLabel.FadeColour(Color4.White, 200); RankedLabel.FadeColour(Color4.White, 200);
}
} }
protected override void PopOut() protected override void PopOut()
@ -362,14 +368,14 @@ namespace osu.Game.Overlays.Mods
Right = 20 Right = 20
} }
}, },
new OsuSpriteText ScoreLabel = new OsuSpriteText
{ {
Text = @"Score Multiplier: ",
TextSize = 30, TextSize = 30,
Shadow = true, Shadow = true,
Margin = new MarginPadding Margin = new MarginPadding
{ {
Top = 5 Top = 5,
Right = 10
} }
}, },
MultiplierLabel = new OsuSpriteText MultiplierLabel = new OsuSpriteText
@ -389,7 +395,8 @@ namespace osu.Game.Overlays.Mods
Shadow = true, Shadow = true,
Margin = new MarginPadding Margin = new MarginPadding
{ {
Top = 5 Top = 5,
Left = 10
} }
} }
} }