Remove ManiaColourCode in favor for boolean

This commit is contained in:
Justus Franklin Tumacder 2021-04-24 20:39:22 +08:00
parent d6d81fb8e5
commit a8b401522b
5 changed files with 7 additions and 18 deletions

View File

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

View File

@ -37,10 +37,10 @@ private void load()
Current = config.GetBindable<double>(ManiaRulesetSetting.ScrollTime),
KeyboardStep = 5
},
new SettingsEnumDropdown<ManiaColourCode>
new SettingsCheckbox
{
LabelText = "Colour-coded notes",
Current = config.GetBindable<ManiaColourCode>(ManiaRulesetSetting.ColourCode),
Current = config.GetBindable<bool>(ManiaRulesetSetting.ColourCode),
}
};
}

View File

@ -29,7 +29,7 @@ public class DrawableNote : DrawableManiaHitObject<Note>, IKeyBindingHandler<Man
private OsuColour colours { get; set; }
[Resolved]
private Bindable<ManiaColourCode> configColourCode { get; set; }
private Bindable<bool> 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);
}

View File

@ -55,7 +55,7 @@ public class DrawableManiaRuleset : DrawableScrollingRuleset<ManiaHitObject>
protected new ManiaRulesetConfigManager Config => (ManiaRulesetConfigManager)base.Config;
[Cached]
protected readonly Bindable<ManiaColourCode> configColourCode = new Bindable<ManiaColourCode>();
protected readonly Bindable<bool> configColourCode = new Bindable<bool>();
public ScrollVisualisationMethod ScrollMethod
{

View File

@ -1,11 +0,0 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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
}
}