1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 06:12:56 +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 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) };
}
}

View File

@ -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));

View File

@ -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
}
}
}