From 78a7564acd527ad54ee71cbaf003022b5b7c9630 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Sat, 24 Mar 2018 16:00:18 -0700 Subject: [PATCH 01/23] Score multiplier edits --- .../Mods/ManiaModDualStages.cs | 2 +- .../Mods/ManiaModRandom.cs | 2 +- osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs | 2 +- osu.Game.Tests/Visual/TestCaseMods.cs | 11 ++++--- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 31 ++++++++++++++++--- osu.Game/Rulesets/Mods/ModAutoplay.cs | 2 +- osu.Game/Rulesets/Mods/ModRelax.cs | 2 +- 7 files changed, 37 insertions(+), 15 deletions(-) diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs index a1f9e0290e..949a2c950c 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModDualStages.cs @@ -16,7 +16,7 @@ namespace osu.Game.Rulesets.Mania.Mods public override string Name => "Dual Stages"; public override string ShortenedName => "DS"; public override string Description => @"Double the stages, double the fun!"; - public override double ScoreMultiplier => 0; + public override double ScoreMultiplier => 1; public void ApplyToBeatmapConverter(BeatmapConverter beatmapConverter) { diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModRandom.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModRandom.cs index df0f9a5437..dd528cb163 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModRandom.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModRandom.cs @@ -18,7 +18,7 @@ namespace osu.Game.Rulesets.Mania.Mods public override string ShortenedName => "RD"; public override FontAwesome Icon => FontAwesome.fa_osu_dice; public override string Description => @"Shuffle around the keys!"; - public override double ScoreMultiplier => 0; + public override double ScoreMultiplier => 1; public void ApplyToRulesetContainer(RulesetContainer rulesetContainer) { diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs b/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs index 0c842143e4..c78274e453 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModAutopilot.cs @@ -13,7 +13,7 @@ namespace osu.Game.Rulesets.Osu.Mods public override string ShortenedName => "AP"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_autopilot; public override string Description => @"Automatic cursor movement - just follow the rhythm."; - public override double ScoreMultiplier => 0; + 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 039d8bfdb6..4f841d3ee2 100644 --- a/osu.Game.Tests/Visual/TestCaseMods.cs +++ b/osu.Game.Tests/Visual/TestCaseMods.cs @@ -105,7 +105,7 @@ namespace osu.Game.Tests.Visual private void testManiaMods(ManiaRuleset ruleset) { - testMultiplierTextUnranked(ruleset.GetModsFor(ModType.Special).First(m => m is ManiaModRandom)); + testRankedTextUnranked(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 testMultiplierTextUnranked(Mod mod) + private void testRankedTextUnranked(Mod mod) { - AddAssert("check for ranked", () => !modSelect.MultiplierLabel.Text.EndsWith(unranked_suffix)); + AddAssert("check for ranked", () => !modSelect.RankedLabel.Text.EndsWith(unranked_suffix)); selectNext(mod); - AddAssert("check for unranked", () => modSelect.MultiplierLabel.Text.EndsWith(unranked_suffix)); + AddAssert("check for unranked", () => modSelect.RankedLabel.Text.EndsWith(unranked_suffix)); selectPrevious(mod); - AddAssert("check for ranked", () => !modSelect.MultiplierLabel.Text.EndsWith(unranked_suffix)); + AddAssert("check for ranked", () => !modSelect.RankedLabel.Text.EndsWith(unranked_suffix)); } private void selectNext(Mod mod) => AddStep($"left click {mod.Name}", () => modSelect.GetModButton(mod)?.SelectNext(1)); @@ -224,6 +224,7 @@ namespace osu.Game.Tests.Visual } public new OsuSpriteText MultiplierLabel => base.MultiplierLabel; + public new OsuSpriteText RankedLabel => base.RankedLabel; public new TriangleButton DeselectAllButton => base.DeselectAllButton; public new Color4 LowMultiplierColour => base.LowMultiplierColour; diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index d8c95da94f..21c1082191 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -27,10 +27,11 @@ namespace osu.Game.Overlays.Mods { private const float content_width = 0.8f; - protected Color4 LowMultiplierColour, HighMultiplierColour; + protected Color4 LowMultiplierColour, HighMultiplierColour, RankedColour; protected readonly TriangleButton DeselectAllButton; protected readonly OsuSpriteText MultiplierLabel; + protected readonly OsuSpriteText RankedLabel; private readonly FillFlowContainer footerContainer; protected override bool BlockPassThroughKeyboard => false; @@ -55,8 +56,9 @@ namespace osu.Game.Overlays.Mods { SelectedMods.ValueChanged += selectedModsChanged; - LowMultiplierColour = colours.Red; + LowMultiplierColour = colours.Yellow; HighMultiplierColour = colours.Green; + RankedColour = colours.Red; if (osu != null) Ruleset.BindTo(osu.Ruleset); @@ -98,15 +100,24 @@ namespace osu.Game.Overlays.Mods } MultiplierLabel.Text = $"{multiplier:N2}x"; - if (!ranked) - MultiplierLabel.Text += " (Unranked)"; - if (multiplier > 1.0) MultiplierLabel.FadeColour(HighMultiplierColour, 200); else if (multiplier < 1.0) MultiplierLabel.FadeColour(LowMultiplierColour, 200); else MultiplierLabel.FadeColour(Color4.White, 200); + + RankedLabel.Text = null; + if (!ranked) + { + RankedLabel.Text += " (Unranked)"; + RankedLabel.FadeColour(RankedColour, 200); + } + else + { + RankedLabel.Text = null; + RankedLabel.FadeColour(Color4.White, 200); + } } protected override void PopOut() @@ -362,6 +373,16 @@ namespace osu.Game.Overlays.Mods } }, MultiplierLabel = new OsuSpriteText + { + Font = @"Exo2.0-Bold", + TextSize = 30, + Shadow = true, + Margin = new MarginPadding + { + Top = 5 + } + }, + RankedLabel = new OsuSpriteText { Font = @"Exo2.0-Bold", TextSize = 30, diff --git a/osu.Game/Rulesets/Mods/ModAutoplay.cs b/osu.Game/Rulesets/Mods/ModAutoplay.cs index 9f45cada7e..8ab12cd30f 100644 --- a/osu.Game/Rulesets/Mods/ModAutoplay.cs +++ b/osu.Game/Rulesets/Mods/ModAutoplay.cs @@ -27,7 +27,7 @@ namespace osu.Game.Rulesets.Mods public override string ShortenedName => "AT"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_auto; public override string Description => "Watch a perfect automated play through the song."; - public override double ScoreMultiplier => 0; + public override double ScoreMultiplier => 1; public bool AllowFail => false; public override Type[] IncompatibleMods => new[] { typeof(ModRelax), typeof(ModSuddenDeath), typeof(ModNoFail) }; } diff --git a/osu.Game/Rulesets/Mods/ModRelax.cs b/osu.Game/Rulesets/Mods/ModRelax.cs index e8328c3ac7..071f5d5a66 100644 --- a/osu.Game/Rulesets/Mods/ModRelax.cs +++ b/osu.Game/Rulesets/Mods/ModRelax.cs @@ -11,7 +11,7 @@ namespace osu.Game.Rulesets.Mods public override string Name => "Relax"; public override string ShortenedName => "RX"; public override FontAwesome Icon => FontAwesome.fa_osu_mod_relax; - public override double ScoreMultiplier => 0; + public override double ScoreMultiplier => 1; public override Type[] IncompatibleMods => new[] { typeof(ModAutoplay), typeof(ModNoFail), typeof(ModSuddenDeath) }; } } From 90d763fda51b8a5255179ee41ec466ebb9e1cc4b Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Sun, 25 Mar 2018 10:00:30 -0700 Subject: [PATCH 02/23] 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 } } } From ac9527147f1f81cd9fd65911cca8eb833516a78a Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Tue, 27 Mar 2018 03:05:05 -0700 Subject: [PATCH 03/23] Fix transitioning of unranked label --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 604e683917..37a789190a 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -116,14 +116,13 @@ namespace osu.Game.Overlays.Mods else MultiplierLabel.FadeColour(Color4.White, 200); - RankedLabel.Text = null; + RankedLabel.Text = "(Unranked)"; + RankedLabel.FadeColour(RankedColour, 200); + RankedLabel.FadeOut(200); if (!ranked) { - RankedLabel.Text = "(Unranked)"; - RankedLabel.FadeColour(RankedColour, 200); + RankedLabel.FadeIn(200); } - else - RankedLabel.FadeColour(Color4.White, 200); } protected override void PopOut() From 5457f17e792af7bbcebfc758a40fa73eba427270 Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Wed, 28 Mar 2018 19:53:15 -0700 Subject: [PATCH 04/23] Clean up code from reviews --- osu.Game.Tests/Visual/TestCaseMods.cs | 9 ++++--- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 29 +++++++--------------- 2 files changed, 15 insertions(+), 23 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseMods.cs b/osu.Game.Tests/Visual/TestCaseMods.cs index b194462a96..73bfe9b7bb 100644 --- a/osu.Game.Tests/Visual/TestCaseMods.cs +++ b/osu.Game.Tests/Visual/TestCaseMods.cs @@ -184,11 +184,14 @@ namespace osu.Game.Tests.Visual private void testRankedText(Mod mod) { - AddAssert("check for ranked", () => !modSelect.RankedLabel.Text.Equals(unranked_suffix)); + AddWaitStep(1, "wait for fade"); + AddAssert("check for ranked", () => modSelect.RankedLabel.Alpha.Equals(0)); selectNext(mod); - AddAssert("check for unranked", () => modSelect.RankedLabel.Text.Equals(unranked_suffix)); + AddWaitStep(1, "wait for fade"); + AddAssert("check for unranked", () => !modSelect.RankedLabel.Alpha.Equals(0)); selectPrevious(mod); - AddAssert("check for ranked", () => !modSelect.RankedLabel.Text.Equals(unranked_suffix)); + AddWaitStep(1, "wait for fade"); + AddAssert("check for ranked", () => modSelect.RankedLabel.Alpha.Equals(0)); } 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 37a789190a..f307d4c92f 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -27,12 +27,10 @@ namespace osu.Game.Overlays.Mods { private const float content_width = 0.8f; - protected Color4 LowMultiplierColour, HighMultiplierColour, RankedColour; + protected Color4 LowMultiplierColour, HighMultiplierColour; protected readonly TriangleButton DeselectAllButton; - protected readonly OsuSpriteText ScoreLabel; - protected readonly OsuSpriteText MultiplierLabel; - protected readonly OsuSpriteText RankedLabel; + protected readonly OsuSpriteText MultiplierLabel, RankedLabel; private readonly FillFlowContainer footerContainer; protected override bool BlockPassThroughKeyboard => false; @@ -59,7 +57,6 @@ namespace osu.Game.Overlays.Mods LowMultiplierColour = colours.Red; HighMultiplierColour = colours.Green; - RankedColour = colours.Blue; if (osu != null) Ruleset.BindTo(osu.Ruleset); @@ -100,14 +97,6 @@ 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); @@ -116,13 +105,10 @@ namespace osu.Game.Overlays.Mods else MultiplierLabel.FadeColour(Color4.White, 200); - RankedLabel.Text = "(Unranked)"; - RankedLabel.FadeColour(RankedColour, 200); - RankedLabel.FadeOut(200); - if (!ranked) - { + if (ranked) + RankedLabel.FadeOut(200); + else RankedLabel.FadeIn(200); - } } protected override void PopOut() @@ -367,8 +353,9 @@ namespace osu.Game.Overlays.Mods Right = 20 } }, - ScoreLabel = new OsuSpriteText + new OsuSpriteText { + Text = @"Score Multiplier:", TextSize = 30, Shadow = true, Margin = new MarginPadding @@ -390,7 +377,9 @@ namespace osu.Game.Overlays.Mods RankedLabel = new OsuSpriteText { Font = @"Exo2.0-Bold", + Text = @"(Unranked)", TextSize = 30, + Colour = OsuColour.FromHex(@"66ccff"), Shadow = true, Margin = new MarginPadding { From 1bebda61f8d6bd048f26d60ae5cbd6b2d508eafd Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Sat, 31 Mar 2018 10:51:44 -0700 Subject: [PATCH 05/23] Use "==" instead of "equals" --- osu.Game.Tests/Visual/TestCaseMods.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseMods.cs b/osu.Game.Tests/Visual/TestCaseMods.cs index 73bfe9b7bb..201804fa74 100644 --- a/osu.Game.Tests/Visual/TestCaseMods.cs +++ b/osu.Game.Tests/Visual/TestCaseMods.cs @@ -185,13 +185,13 @@ namespace osu.Game.Tests.Visual private void testRankedText(Mod mod) { AddWaitStep(1, "wait for fade"); - AddAssert("check for ranked", () => modSelect.RankedLabel.Alpha.Equals(0)); + AddAssert("check for ranked", () => modSelect.RankedLabel.Alpha == 0); selectNext(mod); AddWaitStep(1, "wait for fade"); - AddAssert("check for unranked", () => !modSelect.RankedLabel.Alpha.Equals(0)); + AddAssert("check for unranked", () => !(modSelect.RankedLabel.Alpha == 0)); selectPrevious(mod); AddWaitStep(1, "wait for fade"); - AddAssert("check for ranked", () => modSelect.RankedLabel.Alpha.Equals(0)); + AddAssert("check for ranked", () => modSelect.RankedLabel.Alpha == 0); } private void selectNext(Mod mod) => AddStep($"left click {mod.Name}", () => modSelect.GetModButton(mod)?.SelectNext(1)); From ee7db92e6bb5aba9a792b6b84ee3a22ac9e8682c Mon Sep 17 00:00:00 2001 From: Joseph Madamba Date: Tue, 3 Apr 2018 21:01:02 -0700 Subject: [PATCH 06/23] Simplify negative equality expression --- osu.Game.Tests/Visual/TestCaseMods.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game.Tests/Visual/TestCaseMods.cs b/osu.Game.Tests/Visual/TestCaseMods.cs index 201804fa74..8ee3c6e911 100644 --- a/osu.Game.Tests/Visual/TestCaseMods.cs +++ b/osu.Game.Tests/Visual/TestCaseMods.cs @@ -188,7 +188,7 @@ namespace osu.Game.Tests.Visual AddAssert("check for ranked", () => modSelect.RankedLabel.Alpha == 0); selectNext(mod); AddWaitStep(1, "wait for fade"); - AddAssert("check for unranked", () => !(modSelect.RankedLabel.Alpha == 0)); + AddAssert("check for unranked", () => modSelect.RankedLabel.Alpha != 0); selectPrevious(mod); AddWaitStep(1, "wait for fade"); AddAssert("check for ranked", () => modSelect.RankedLabel.Alpha == 0); From 5e4f83b80b158cdf0ddadd60db430a0fc1d83a15 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 25 May 2018 17:29:52 +0900 Subject: [PATCH 07/23] Add more correct catch playfield sizing --- osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs index 070dc19a6f..52763e09af 100644 --- a/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs +++ b/osu.Game.Rulesets.Catch/UI/CatchRulesetContainer.cs @@ -32,6 +32,8 @@ namespace osu.Game.Rulesets.Catch.UI public override PassThroughInputManager CreateInputManager() => new CatchInputManager(Ruleset.RulesetInfo); + protected override Vector2 PlayfieldArea => new Vector2(0.86f); // matches stable's vertical offset for catcher plate + protected override DrawableHitObject GetVisualRepresentation(CatchHitObject h) { switch (h) From 3fe25fe67d67d17eb5f0f6bca374317e97a17c96 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 25 May 2018 17:32:07 +0900 Subject: [PATCH 08/23] Fix catcher sizing to (roughly) match stable --- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 34 ++++++++++++++--------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 181536a91e..59d5ecd07f 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -23,7 +23,7 @@ namespace osu.Game.Rulesets.Catch.UI { public class CatcherArea : Container { - public const float CATCHER_SIZE = 172; + public const float CATCHER_SIZE = 84; protected readonly Catcher MovableCatcher; @@ -99,8 +99,6 @@ namespace osu.Game.Rulesets.Catch.UI public class Catcher : Container, IKeyBindingHandler { - private Texture texture; - private Container caughtFruit; public Container ExplodingFruitTarget; @@ -121,10 +119,8 @@ namespace osu.Game.Rulesets.Catch.UI } [BackgroundDependencyLoader] - private void load(TextureStore textures) + private void load() { - texture = textures.Get(@"Play/Catch/fruit-catcher-idle"); - Children = new Drawable[] { caughtFruit = new Container @@ -196,13 +192,7 @@ namespace osu.Game.Rulesets.Catch.UI Scheduler.AddDelayed(beginTrail, HyperDashing ? 25 : 50); } - private Sprite createCatcherSprite() => new Sprite - { - Size = new Vector2(CATCHER_SIZE), - FillMode = FillMode.Fill, - Texture = texture, - OriginPosition = new Vector2(-3, 10) // temporary until the sprite is aligned correctly. - }; + private Sprite createCatcherSprite() => new CatcherSprite(); /// /// Add a caught fruit to the catcher's stack. @@ -411,6 +401,24 @@ namespace osu.Game.Rulesets.Catch.UI f.Expire(); } } + + private class CatcherSprite : Sprite + { + public CatcherSprite() + { + Size = new Vector2(CATCHER_SIZE); + FillMode = FillMode.Fill; + + // Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling. + OriginPosition = new Vector2(-0.02f, 0.06f) * CATCHER_SIZE; + } + + [BackgroundDependencyLoader] + private void load(TextureStore textures) + { + Texture = textures.Get(@"Play/Catch/fruit-catcher-idle"); + } + } } } } From bf25e81c945398bbada55b44ebf29413c25363c8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 25 May 2018 17:32:22 +0900 Subject: [PATCH 09/23] Make drawable bananas testable --- .../TestCaseCatcherArea.cs | 2 +- .../TestCaseFruitObjects.cs | 20 +++++++++++++------ 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/osu.Game.Rulesets.Catch.Tests/TestCaseCatcherArea.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseCatcherArea.cs index f239290ed4..5119260c53 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestCaseCatcherArea.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestCaseCatcherArea.cs @@ -37,7 +37,7 @@ namespace osu.Game.Rulesets.Catch.Tests Child = catcherArea = new TestCatcherArea(new BeatmapDifficulty { CircleSize = size }) { Anchor = Anchor.CentreLeft, - Origin = Anchor.BottomLeft + Origin = Anchor.TopLeft }, }; } diff --git a/osu.Game.Rulesets.Catch.Tests/TestCaseFruitObjects.cs b/osu.Game.Rulesets.Catch.Tests/TestCaseFruitObjects.cs index 275752523d..e77dd76353 100644 --- a/osu.Game.Rulesets.Catch.Tests/TestCaseFruitObjects.cs +++ b/osu.Game.Rulesets.Catch.Tests/TestCaseFruitObjects.cs @@ -25,6 +25,7 @@ namespace osu.Game.Rulesets.Catch.Tests typeof(DrawableCatchHitObject), typeof(DrawableFruit), typeof(DrawableDroplet), + typeof(BananaShower), typeof(Pulp), }; @@ -53,12 +54,19 @@ namespace osu.Game.Rulesets.Catch.Tests private DrawableFruit createDrawable(int index) { - var fruit = new Fruit - { - StartTime = 1000000000000, - IndexInBeatmap = index, - Scale = 1.5f, - }; + Fruit fruit = index == 5 + ? new BananaShower.Banana + { + StartTime = 1000000000000, + IndexInBeatmap = index, + Scale = 1.5f, + } + : new Fruit + { + StartTime = 1000000000000, + IndexInBeatmap = index, + Scale = 1.5f, + }; return new DrawableFruit(fruit) { From f5ab93a712933f6540c852aa8cda691470221e98 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 25 May 2018 17:33:05 +0900 Subject: [PATCH 10/23] Make all drawable fruit absolute values easily scalable --- .../Objects/Drawable/DrawableFruit.cs | 41 +++++++++---------- .../Objects/Drawable/Pieces/Pulp.cs | 24 +++++++---- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs index 41792b10a4..4603148114 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/DrawableFruit.cs @@ -18,12 +18,19 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { private Circle border; + private const float drawable_radius = (float)CatchHitObject.OBJECT_RADIUS * radius_adjust; + + /// + /// Because we're adding a border around the fruit, we need to scale down some. + /// + private const float radius_adjust = 1.1f; + public DrawableFruit(Fruit h) : base(h) { Origin = Anchor.Centre; - Size = new Vector2((float)CatchHitObject.OBJECT_RADIUS); + Size = new Vector2(drawable_radius); Masking = false; Rotation = (float)(RNG.NextDouble() - 0.5f) * 40; @@ -44,14 +51,14 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { Hollow = !HitObject.HyperDash, Type = EdgeEffectType.Glow, - Radius = 4, + Radius = 4 * radius_adjust, Colour = HitObject.HyperDash ? Color4.Red : AccentColour.Darken(1).Opacity(0.6f) }, - Size = new Vector2(Height * 1.5f), + Size = new Vector2(Height), Anchor = Anchor.Centre, Origin = Anchor.Centre, BorderColour = Color4.White, - BorderThickness = 4f, + BorderThickness = 3f * radius_adjust, Children = new Framework.Graphics.Drawable[] { new Box @@ -82,8 +89,8 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable private Framework.Graphics.Drawable createPulp(FruitVisualRepresentation representation) { - const float large_pulp_3 = 13f; - const float distance_from_centre_3 = 0.23f; + const float large_pulp_3 = 8f * radius_adjust; + const float distance_from_centre_3 = 0.15f; const float large_pulp_4 = large_pulp_3 * 0.925f; const float distance_from_centre_4 = distance_from_centre_3 / 0.925f; @@ -106,11 +113,9 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { new Pulp { - Anchor = Anchor.TopCentre, - Origin = Anchor.BottomCentre, AccentColour = AccentColour, Size = new Vector2(small_pulp), - Y = 0.05f, + Y = -0.34f, }, new Pulp { @@ -146,11 +151,9 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { new Pulp { - Anchor = Anchor.TopCentre, - Origin = Anchor.BottomCentre, AccentColour = AccentColour, Size = new Vector2(small_pulp), - Y = 0.1f, + Y = -0.3f, }, new Pulp { @@ -186,11 +189,9 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { new Pulp { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, AccentColour = AccentColour, Size = new Vector2(small_pulp), - Y = -0.1f, + Y = -0.33f, }, new Pulp { @@ -220,10 +221,9 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { new Pulp { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, AccentColour = AccentColour, Size = new Vector2(small_pulp), + Y = -0.25f, }, new Pulp { @@ -253,16 +253,15 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable { new Pulp { - Anchor = Anchor.TopCentre, - Origin = Anchor.TopCentre, AccentColour = AccentColour, Size = new Vector2(small_pulp), - Y = -0.15f + Y = -0.3f }, new Pulp { AccentColour = AccentColour, - Size = new Vector2(large_pulp_4 * 1.2f, large_pulp_4 * 3), + Size = new Vector2(large_pulp_4 * 0.8f, large_pulp_4 * 2.5f), + Y = 0.05f, }, } }; diff --git a/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs b/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs index d17a72a165..250dc8c7f1 100644 --- a/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs +++ b/osu.Game.Rulesets.Catch/Objects/Drawable/Pieces/Pulp.cs @@ -29,14 +29,24 @@ namespace osu.Game.Rulesets.Catch.Objects.Drawable.Pieces set { accentColour = value; - - EdgeEffect = new EdgeEffectParameters - { - Type = EdgeEffectType.Glow, - Radius = 8, - Colour = accentColour.Darken(0.2f).Opacity(0.75f) - }; + if (IsLoaded) updateAccentColour(); } } + + private void updateAccentColour() + { + EdgeEffect = new EdgeEffectParameters + { + Type = EdgeEffectType.Glow, + Radius = Size.X / 2, + Colour = accentColour.Darken(0.2f).Opacity(0.75f) + }; + } + + protected override void LoadComplete() + { + base.LoadComplete(); + updateAccentColour(); + } } } From 5be46307fdeda27cdc5556d0ca1303cff98285dc Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Mon, 28 May 2018 19:43:59 +0900 Subject: [PATCH 11/23] Fix results screen parallax being cut off Alternative to / closes #2549. Didn't want to reference the toolbar as was done, also wanted to remove the awkward scaling factors so rather than scaling down the inner one, we scale up the outer one. --- osu.Game/Screens/Ranking/Results.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/osu.Game/Screens/Ranking/Results.cs b/osu.Game/Screens/Ranking/Results.cs index 32161a0b8e..7cbd2e4403 100644 --- a/osu.Game/Screens/Ranking/Results.cs +++ b/osu.Game/Screens/Ranking/Results.cs @@ -57,6 +57,7 @@ namespace osu.Game.Screens.Ranking { base.OnEntering(last); (Background as BackgroundScreenBeatmap)?.BlurTo(background_blur, 2500, Easing.OutQuint); + Background.ScaleTo(1.1f, transition_time, Easing.OutQuint); allCircles.ForEach(c => { @@ -102,6 +103,8 @@ namespace osu.Game.Screens.Ranking c.ScaleTo(0, transition_time, Easing.OutSine); }); + Background.ScaleTo(1f, transition_time / 4, Easing.OutQuint); + Content.FadeOut(transition_time / 4); return base.OnExiting(next); @@ -160,7 +163,6 @@ namespace osu.Game.Screens.Ranking { RelativeSizeAxes = Axes.Both, ParallaxAmount = 0.01f, - Scale = new Vector2(1 / circle_outer_scale / overscan), Anchor = Anchor.Centre, Origin = Anchor.Centre, Children = new Drawable[] From 7b8211e6db51cd8b1d9a43f2172b55fd974c8a73 Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Tue, 29 May 2018 04:23:29 -0300 Subject: [PATCH 12/23] Add MultiplayerScreen.Type --- osu.Game/Screens/Multi/Header.cs | 8 ++++---- osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs | 3 ++- osu.Game/Screens/Multi/Screens/MultiplayerScreen.cs | 5 +++++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Multi/Header.cs b/osu.Game/Screens/Multi/Header.cs index de71b20007..fb4da45aca 100644 --- a/osu.Game/Screens/Multi/Header.cs +++ b/osu.Game/Screens/Multi/Header.cs @@ -20,7 +20,7 @@ namespace osu.Game.Screens.Multi { public const float HEIGHT = 121; - private readonly OsuSpriteText screenTitle; + private readonly OsuSpriteText screenType; private readonly HeaderBreadcrumbControl breadcrumbs; public Header(Screen initialScreen) @@ -67,7 +67,7 @@ namespace osu.Game.Screens.Multi Text = "multiplayer ", TextSize = 25, }, - screenTitle = new OsuSpriteText + screenType = new OsuSpriteText { TextSize = 25, Font = @"Exo2.0-Light", @@ -86,14 +86,14 @@ namespace osu.Game.Screens.Multi }, }; - breadcrumbs.Current.ValueChanged += s => screenTitle.Text = ((MultiplayerScreen)s).Title; + breadcrumbs.Current.ValueChanged += s => screenType.Text = ((MultiplayerScreen)s).Type; breadcrumbs.Current.TriggerChange(); } [BackgroundDependencyLoader] private void load(OsuColour colours) { - screenTitle.Colour = colours.Yellow; + screenType.Colour = colours.Yellow; breadcrumbs.StripColour = colours.Green; } diff --git a/osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs b/osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs index 60ffe2c0b9..f0c93b1146 100644 --- a/osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs +++ b/osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs @@ -25,7 +25,8 @@ namespace osu.Game.Screens.Multi.Screens.Lounge protected readonly FillFlowContainer RoomsContainer; protected readonly RoomInspector Inspector; - public override string Title => "lounge"; + public override string Type => "lounge"; + public override string Title => "Lounge"; protected override Container TransitionContent => content; diff --git a/osu.Game/Screens/Multi/Screens/MultiplayerScreen.cs b/osu.Game/Screens/Multi/Screens/MultiplayerScreen.cs index 191fe66037..cdfa17a7a6 100644 --- a/osu.Game/Screens/Multi/Screens/MultiplayerScreen.cs +++ b/osu.Game/Screens/Multi/Screens/MultiplayerScreen.cs @@ -15,6 +15,11 @@ namespace osu.Game.Screens.Multi.Screens protected virtual Container TransitionContent => Content; + /// + /// The type to display in the title of the . + /// + public abstract string Type { get; } + protected override void OnEntering(Screen last) { base.OnEntering(last); From 6f72e5a876762bb5d10b28b4d8da24ae5b5ddb71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Tue, 29 May 2018 10:27:21 +0200 Subject: [PATCH 13/23] Fix Debug mode instead of Release mode for mono debug target --- .vscode/launch.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 11141dc182..32c82685c0 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -22,7 +22,7 @@ }, "type": "mono", "request": "launch", - "program": "${workspaceRoot}/osu.Game.Tests/bin/Debug/net471/osu.Game.Tests.exe", + "program": "${workspaceRoot}/osu.Game.Tests/bin/Release/net471/osu.Game.Tests.exe", "cwd": "${workspaceRoot}", "preLaunchTask": "Build (Release, msbuild)", "runtimeExecutable": null, From 4a18951cce0279731bf7afae07f330dda4d2d37f Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 29 May 2018 18:37:45 +0900 Subject: [PATCH 14/23] Report full error to log file --- osu.Game/Database/ArchiveModelManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index 99f1e9f581..6a31182370 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -206,8 +206,9 @@ namespace osu.Game.Database } } } - catch + catch (Exception e) { + Logger.Error(e, $"Import of {archive.Name} failed and has been rolled back.", LoggingTarget.Database); item = null; } From 31ab6f240841b5be96077c72e7761109e690c5e5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 29 May 2018 19:43:52 +0900 Subject: [PATCH 15/23] Fix event flushing sticking on early return --- osu.Game/Database/ArchiveModelManager.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index 6a31182370..62d8c16946 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -174,7 +174,7 @@ namespace osu.Game.Database /// The archive to be imported. public TModel Import(ArchiveReader archive) { - TModel item; + TModel item = null; delayEvents(); try @@ -211,9 +211,12 @@ namespace osu.Game.Database Logger.Error(e, $"Import of {archive.Name} failed and has been rolled back.", LoggingTarget.Database); item = null; } + finally + { + // we only want to flush events after we've confirmed the write context didn't have any errors. + flushEvents(item != null); + } - // we only want to flush events after we've confirmed the write context didn't have any errors. - flushEvents(item != null); return item; } From e23e2bd3485045eb079b4c69f71b5cdf50b98260 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 30 May 2018 13:37:52 +0900 Subject: [PATCH 16/23] Fix recycling never being performed due to incorrect ordering --- osu.Game/Database/DatabaseContextFactory.cs | 33 +++++++++++---------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/osu.Game/Database/DatabaseContextFactory.cs b/osu.Game/Database/DatabaseContextFactory.cs index ec408456e3..f57246453e 100644 --- a/osu.Game/Database/DatabaseContextFactory.cs +++ b/osu.Game/Database/DatabaseContextFactory.cs @@ -64,24 +64,25 @@ namespace osu.Game.Database currentWriteDidWrite |= usage.PerformedWrite; currentWriteDidError |= usage.Errors.Any(); - if (usages > 0) return; - - if (currentWriteDidError) - currentWriteTransaction?.Rollback(); - else - currentWriteTransaction?.Commit(); - - currentWriteTransaction = null; - currentWriteDidWrite = false; - currentWriteDidError = false; - - if (currentWriteDidWrite) + if (usages == 0) { - // explicitly dispose to ensure any outstanding flushes happen as soon as possible (and underlying resources are purged). - usage.Context.Dispose(); + if (currentWriteDidError) + currentWriteTransaction?.Rollback(); + else + currentWriteTransaction?.Commit(); - // once all writes are complete, we want to refresh thread-specific contexts to make sure they don't have stale local caches. - recycleThreadContexts(); + if (currentWriteDidWrite || currentWriteDidError) + { + // explicitly dispose to ensure any outstanding flushes happen as soon as possible (and underlying resources are purged). + usage.Context.Dispose(); + + // once all writes are complete, we want to refresh thread-specific contexts to make sure they don't have stale local caches. + recycleThreadContexts(); + } + + currentWriteTransaction = null; + currentWriteDidWrite = false; + currentWriteDidError = false; } } finally From 4a7de043e080aeb087de9d67eb7b3627a3471bf7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 30 May 2018 13:43:25 +0900 Subject: [PATCH 17/23] Recycle all contexts on beginning a write operation for the time being --- osu.Game/Database/DatabaseContextFactory.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osu.Game/Database/DatabaseContextFactory.cs b/osu.Game/Database/DatabaseContextFactory.cs index f57246453e..a1d371f431 100644 --- a/osu.Game/Database/DatabaseContextFactory.cs +++ b/osu.Game/Database/DatabaseContextFactory.cs @@ -48,7 +48,14 @@ namespace osu.Game.Database Monitor.Enter(writeLock); if (currentWriteTransaction == null && withTransaction) + { + // this mitigates the fact that changes on tracked entities will not be rolled back with the transaction by ensuring write operations are always executed in isolated contexts. + // if this results in sub-optimal efficiency, we may need to look into removing Database-level transactions in favour of running SaveChanges where we currently commit the transaction. + if (threadContexts.IsValueCreated) + recycleThreadContexts(); + currentWriteTransaction = threadContexts.Value.Database.BeginTransaction(); + } Interlocked.Increment(ref currentWriteUsages); From eb893174947ae5cf8d050d932b27658cfab990cb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 30 May 2018 13:43:43 +0900 Subject: [PATCH 18/23] Remove performance optimisation tracking disables to keep things simple for now --- osu.Game/Database/ArchiveModelManager.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/osu.Game/Database/ArchiveModelManager.cs b/osu.Game/Database/ArchiveModelManager.cs index 62d8c16946..1505ac0549 100644 --- a/osu.Game/Database/ArchiveModelManager.cs +++ b/osu.Game/Database/ArchiveModelManager.cs @@ -240,12 +240,8 @@ namespace osu.Game.Database /// The item to delete. public void Delete(TModel item) { - using (var usage = ContextFactory.GetForWrite()) + using (ContextFactory.GetForWrite()) { - var context = usage.Context; - - context.ChangeTracker.AutoDetectChangesEnabled = false; - // re-fetch the model on the import context. var foundModel = queryModel().Include(s => s.Files).ThenInclude(f => f.FileInfo).First(s => s.ID == item.ID); @@ -253,8 +249,6 @@ namespace osu.Game.Database if (ModelStore.Delete(foundModel)) Files.Dereference(foundModel.Files.Select(f => f.FileInfo).ToArray()); - - context.ChangeTracker.AutoDetectChangesEnabled = true; } } From ff93a54a64de5f81039f31f4faa7f08f2d0b432c Mon Sep 17 00:00:00 2001 From: DrabWeb Date: Wed, 30 May 2018 23:16:54 -0300 Subject: [PATCH 19/23] Default Type to Title, use ToLower for the screen type title. --- osu.Game/Screens/Multi/Header.cs | 2 +- osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs | 1 - osu.Game/Screens/Multi/Screens/MultiplayerScreen.cs | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/osu.Game/Screens/Multi/Header.cs b/osu.Game/Screens/Multi/Header.cs index fb4da45aca..46610a36d8 100644 --- a/osu.Game/Screens/Multi/Header.cs +++ b/osu.Game/Screens/Multi/Header.cs @@ -86,7 +86,7 @@ namespace osu.Game.Screens.Multi }, }; - breadcrumbs.Current.ValueChanged += s => screenType.Text = ((MultiplayerScreen)s).Type; + breadcrumbs.Current.ValueChanged += s => screenType.Text = ((MultiplayerScreen)s).Type.ToLower(); breadcrumbs.Current.TriggerChange(); } diff --git a/osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs b/osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs index f0c93b1146..016babcaa5 100644 --- a/osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs +++ b/osu.Game/Screens/Multi/Screens/Lounge/Lounge.cs @@ -25,7 +25,6 @@ namespace osu.Game.Screens.Multi.Screens.Lounge protected readonly FillFlowContainer RoomsContainer; protected readonly RoomInspector Inspector; - public override string Type => "lounge"; public override string Title => "Lounge"; protected override Container TransitionContent => content; diff --git a/osu.Game/Screens/Multi/Screens/MultiplayerScreen.cs b/osu.Game/Screens/Multi/Screens/MultiplayerScreen.cs index cdfa17a7a6..fa9b40684c 100644 --- a/osu.Game/Screens/Multi/Screens/MultiplayerScreen.cs +++ b/osu.Game/Screens/Multi/Screens/MultiplayerScreen.cs @@ -18,7 +18,7 @@ namespace osu.Game.Screens.Multi.Screens /// /// The type to display in the title of the . /// - public abstract string Type { get; } + public virtual string Type => Title; protected override void OnEntering(Screen last) { From 319faf12f7a9b4e010b318a8f470db825dadbd04 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 31 May 2018 12:39:56 +0900 Subject: [PATCH 20/23] Fix incorrect naming of label --- osu.Game.Tests/Visual/TestCaseMods.cs | 8 ++++---- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/osu.Game.Tests/Visual/TestCaseMods.cs b/osu.Game.Tests/Visual/TestCaseMods.cs index cf26230868..3255478bea 100644 --- a/osu.Game.Tests/Visual/TestCaseMods.cs +++ b/osu.Game.Tests/Visual/TestCaseMods.cs @@ -199,13 +199,13 @@ namespace osu.Game.Tests.Visual private void testRankedText(Mod mod) { AddWaitStep(1, "wait for fade"); - AddAssert("check for ranked", () => modSelect.RankedLabel.Alpha == 0); + AddAssert("check for ranked", () => modSelect.UnrankedLabel.Alpha == 0); selectNext(mod); AddWaitStep(1, "wait for fade"); - AddAssert("check for unranked", () => modSelect.RankedLabel.Alpha != 0); + AddAssert("check for unranked", () => modSelect.UnrankedLabel.Alpha != 0); selectPrevious(mod); AddWaitStep(1, "wait for fade"); - AddAssert("check for ranked", () => modSelect.RankedLabel.Alpha == 0); + AddAssert("check for ranked", () => modSelect.UnrankedLabel.Alpha == 0); } private void selectNext(Mod mod) => AddStep($"left click {mod.Name}", () => modSelect.GetModButton(mod)?.SelectNext(1)); @@ -241,7 +241,7 @@ namespace osu.Game.Tests.Visual } public new OsuSpriteText MultiplierLabel => base.MultiplierLabel; - public new OsuSpriteText RankedLabel => base.RankedLabel; + public new OsuSpriteText UnrankedLabel => base.UnrankedLabel; public new TriangleButton DeselectAllButton => base.DeselectAllButton; public new Color4 LowMultiplierColour => base.LowMultiplierColour; diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 69f409c3d2..3c44532627 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -31,7 +31,7 @@ namespace osu.Game.Overlays.Mods protected Color4 LowMultiplierColour, HighMultiplierColour; protected readonly TriangleButton DeselectAllButton; - protected readonly OsuSpriteText MultiplierLabel, RankedLabel; + protected readonly OsuSpriteText MultiplierLabel, UnrankedLabel; private readonly FillFlowContainer footerContainer; protected override bool BlockPassThroughKeyboard => false; @@ -107,9 +107,9 @@ namespace osu.Game.Overlays.Mods MultiplierLabel.FadeColour(Color4.White, 200); if (ranked) - RankedLabel.FadeOut(200); + UnrankedLabel.FadeOut(200); else - RankedLabel.FadeIn(200); + UnrankedLabel.FadeIn(200); } protected override void PopOut() @@ -373,7 +373,7 @@ namespace osu.Game.Overlays.Mods Top = 5 } }, - RankedLabel = new OsuSpriteText + UnrankedLabel = new OsuSpriteText { Font = @"Exo2.0-Bold", Text = @"(Unranked)", From 205aa1a3cdd5adf2927e78dcd9187306bf4f8889 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 31 May 2018 12:44:11 +0900 Subject: [PATCH 21/23] Fetch colour from OsuColour palette --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 3c44532627..5eb507c67c 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -58,6 +58,7 @@ namespace osu.Game.Overlays.Mods LowMultiplierColour = colours.Red; HighMultiplierColour = colours.Green; + UnrankedLabel.Colour = colours.Blue; if (osu != null) Ruleset.BindTo(osu.Ruleset); @@ -378,7 +379,6 @@ namespace osu.Game.Overlays.Mods Font = @"Exo2.0-Bold", Text = @"(Unranked)", TextSize = 30, - Colour = OsuColour.FromHex(@"66ccff"), Shadow = true, Margin = new MarginPadding { From 0f6c623ebb15b222cb21076a8d9d98a85d2ae3a7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 31 May 2018 12:44:59 +0900 Subject: [PATCH 22/23] Tidy up some unnecessary lines --- osu.Game/Overlays/Mods/ModSelectOverlay.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/osu.Game/Overlays/Mods/ModSelectOverlay.cs b/osu.Game/Overlays/Mods/ModSelectOverlay.cs index 5eb507c67c..f1624721da 100644 --- a/osu.Game/Overlays/Mods/ModSelectOverlay.cs +++ b/osu.Game/Overlays/Mods/ModSelectOverlay.cs @@ -107,10 +107,7 @@ namespace osu.Game.Overlays.Mods else MultiplierLabel.FadeColour(Color4.White, 200); - if (ranked) - UnrankedLabel.FadeOut(200); - else - UnrankedLabel.FadeIn(200); + UnrankedLabel.FadeTo(ranked ? 0 : 1, 200); } protected override void PopOut() @@ -357,7 +354,6 @@ namespace osu.Game.Overlays.Mods { Text = @"Score Multiplier:", TextSize = 30, - Shadow = true, Margin = new MarginPadding { Top = 5, @@ -368,7 +364,6 @@ namespace osu.Game.Overlays.Mods { Font = @"Exo2.0-Bold", TextSize = 30, - Shadow = true, Margin = new MarginPadding { Top = 5 @@ -379,7 +374,6 @@ namespace osu.Game.Overlays.Mods Font = @"Exo2.0-Bold", Text = @"(Unranked)", TextSize = 30, - Shadow = true, Margin = new MarginPadding { Top = 5, From b7511251d99ee6158e918725a35a26134c5e3529 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 31 May 2018 12:50:01 +0900 Subject: [PATCH 23/23] Remove pointless FillMode specification --- osu.Game.Rulesets.Catch/UI/CatcherArea.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs index 59d5ecd07f..d8c7b5130d 100644 --- a/osu.Game.Rulesets.Catch/UI/CatcherArea.cs +++ b/osu.Game.Rulesets.Catch/UI/CatcherArea.cs @@ -407,7 +407,6 @@ namespace osu.Game.Rulesets.Catch.UI public CatcherSprite() { Size = new Vector2(CATCHER_SIZE); - FillMode = FillMode.Fill; // Sets the origin roughly to the centre of the catcher's plate to allow for correct scaling. OriginPosition = new Vector2(-0.02f, 0.06f) * CATCHER_SIZE;