diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs b/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs index 5a5a1a6b9f..ec68ffe360 100644 --- a/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs +++ b/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.UI; @@ -15,12 +14,10 @@ namespace osu.Game.Rulesets.Catch.Mods { public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1; - public override BindableFloat StartingFlashlightSize { get; } = new BindableFloat(1) + public CatchModFlashlight() { - MinValue = 0.5f, - MaxValue = 1.5f, - Precision = 0.1f - }; + StartingFlashlightSize.MaxValue = 1.5f; + } public override float DefaultFlashlightSize => 325; diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs index 3489fe8dfc..a69e51fec1 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs @@ -2,7 +2,6 @@ // See the LICENCE file in the repository root for full licence text. using System; -using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Layout; using osu.Game.Rulesets.Mania.Objects; @@ -19,15 +18,9 @@ namespace osu.Game.Rulesets.Mania.Mods public ManiaModFlashlight() { FinalFlashlightSize.Default = 1; + StartingFlashlightSize.MaxValue = 3; } - public override BindableFloat StartingFlashlightSize { get; } = new BindableFloat(1) - { - MinValue = 0.5f, - MaxValue = 3f, - Precision = 0.1f - }; - public override float DefaultFlashlightSize => 50; protected override Flashlight CreateFlashlight() => new ManiaFlashlight(this); diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs index 3d5cfcd64b..a1e2fa3e79 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs @@ -32,13 +32,6 @@ namespace osu.Game.Rulesets.Osu.Mods Precision = default_follow_delay, }; - public override BindableFloat StartingFlashlightSize { get; } = new BindableFloat(1) - { - MinValue = 0.5f, - MaxValue = 2f, - Precision = 0.1f - }; - public override float DefaultFlashlightSize => 200; private OsuFlashlight flashlight = null!; diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs index 1b0222bfeb..08086c38ae 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs @@ -1,7 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Layout; using osu.Game.Rulesets.Mods; @@ -16,13 +15,6 @@ namespace osu.Game.Rulesets.Taiko.Mods { public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1; - public override BindableFloat StartingFlashlightSize { get; } = new BindableFloat(1) - { - MinValue = 0.5f, - MaxValue = 1.5f, - Precision = 0.1f - }; - public override float DefaultFlashlightSize => 200; protected override Flashlight CreateFlashlight() => new TaikoFlashlight(this, playfield); @@ -32,6 +24,9 @@ namespace osu.Game.Rulesets.Taiko.Mods public override void ApplyToDrawableRuleset(DrawableRuleset drawableRuleset) { playfield = (TaikoPlayfield)drawableRuleset.Playfield; + + StartingFlashlightSize.MaxValue = 1.5f; + base.ApplyToDrawableRuleset(drawableRuleset); } diff --git a/osu.Game/Rulesets/Mods/ModFlashlight.cs b/osu.Game/Rulesets/Mods/ModFlashlight.cs index 0cf25ab1b7..bc79f6e772 100644 --- a/osu.Game/Rulesets/Mods/ModFlashlight.cs +++ b/osu.Game/Rulesets/Mods/ModFlashlight.cs @@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Mods public override ModType Type => ModType.DifficultyIncrease; public override LocalisableString Description => "Restricted view area."; - protected virtual float DefaultFinalFlashlightSize => 0.625f; + private const float size_customization_precision = 0.05f; private float findClosestMultipleFrom(int value, float multiple) => MathF.Round(value / multiple) * multiple; @@ -52,14 +52,19 @@ namespace osu.Game.Rulesets.Mods } [SettingSource("Starting flashlight size", "Multiplier applied to the default flashlight size.")] - public abstract BindableFloat StartingFlashlightSize { get; } + public BindableFloat StartingFlashlightSize { get; } = new BindableFloat(1) + { + MinValue = 0.5f, + MaxValue = 2, + Precision = size_customization_precision + }; [SettingSource("Final flashlight size", "Multiplier applied to the starting flashlight size after the max flashlight combo is reached.")] public BindableFloat FinalFlashlightSize { get; } = new BindableFloat(0.625f) { MinValue = 0.5f, MaxValue = 1, - Precision = 0.05f + Precision = size_customization_precision }; [SettingSource("Change size combo divisor", "Changes the combo divisor where the flashlight size is changed.")]