From a8b401522bf561d5a2d49567ec99a2048e56586a Mon Sep 17 00:00:00 2001 From: Justus Franklin Tumacder Date: Sat, 24 Apr 2021 20:39:22 +0800 Subject: [PATCH] Remove ManiaColourCode in favor for boolean --- .../Configuration/ManiaRulesetConfigManager.cs | 2 +- osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs | 4 ++-- .../Objects/Drawables/DrawableNote.cs | 6 +++--- osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs | 2 +- osu.Game.Rulesets.Mania/UI/ManiaColourCode.cs | 11 ----------- 5 files changed, 7 insertions(+), 18 deletions(-) delete mode 100644 osu.Game.Rulesets.Mania/UI/ManiaColourCode.cs diff --git a/osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs b/osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs index 292d494d88..f37937a736 100644 --- a/osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs +++ b/osu.Game.Rulesets.Mania/Configuration/ManiaRulesetConfigManager.cs @@ -22,7 +22,7 @@ protected override void InitialiseDefaults() SetDefault(ManiaRulesetSetting.ScrollTime, 1500.0, DrawableManiaRuleset.MIN_TIME_RANGE, DrawableManiaRuleset.MAX_TIME_RANGE, 5); SetDefault(ManiaRulesetSetting.ScrollDirection, ManiaScrollingDirection.Down); - SetDefault(ManiaRulesetSetting.ColourCode, ManiaColourCode.Off); + SetDefault(ManiaRulesetSetting.ColourCode, false); } public override TrackedSettings CreateTrackedSettings() => new TrackedSettings diff --git a/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs b/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs index d46076d3bc..c0c587f67c 100644 --- a/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs +++ b/osu.Game.Rulesets.Mania/ManiaSettingsSubsection.cs @@ -37,10 +37,10 @@ private void load() Current = config.GetBindable(ManiaRulesetSetting.ScrollTime), KeyboardStep = 5 }, - new SettingsEnumDropdown + new SettingsCheckbox { LabelText = "Colour-coded notes", - Current = config.GetBindable(ManiaRulesetSetting.ColourCode), + Current = config.GetBindable(ManiaRulesetSetting.ColourCode), } }; } diff --git a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs index 3b2a9feee2..7cda70f2af 100644 --- a/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs +++ b/osu.Game.Rulesets.Mania/Objects/Drawables/DrawableNote.cs @@ -29,7 +29,7 @@ public class DrawableNote : DrawableManiaHitObject, IKeyBindingHandler configColourCode { get; set; } + private Bindable configColourCode { get; set; } [Resolved(canBeNull: true)] private ManiaBeatmap beatmap { get; set; } @@ -166,9 +166,9 @@ private static bool AlmostDivisibleBy(double dividend, double divisor) return Precision.AlmostEquals(remainder, 0, LENIENCY_MS) || Precision.AlmostEquals(remainder - divisor, 0, LENIENCY_MS); } - private void UpdateSnapColour(ManiaColourCode colourCode, int snap) + private void UpdateSnapColour(bool colourCode, int snap) { - if (colourCode == ManiaColourCode.On) + if (colourCode) { Colour = BindableBeatDivisor.GetColourFor(Snap, colours); } diff --git a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs index 850d4800cd..94830adc33 100644 --- a/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs +++ b/osu.Game.Rulesets.Mania/UI/DrawableManiaRuleset.cs @@ -55,7 +55,7 @@ public class DrawableManiaRuleset : DrawableScrollingRuleset protected new ManiaRulesetConfigManager Config => (ManiaRulesetConfigManager)base.Config; [Cached] - protected readonly Bindable configColourCode = new Bindable(); + protected readonly Bindable configColourCode = new Bindable(); public ScrollVisualisationMethod ScrollMethod { diff --git a/osu.Game.Rulesets.Mania/UI/ManiaColourCode.cs b/osu.Game.Rulesets.Mania/UI/ManiaColourCode.cs deleted file mode 100644 index 91b637b71d..0000000000 --- a/osu.Game.Rulesets.Mania/UI/ManiaColourCode.cs +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -namespace osu.Game.Rulesets.Mania.UI -{ - public enum ManiaColourCode - { - Off, - On - } -}