1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 11:43:21 +08:00

Revert oversight.

This reverts commit 79e0377638.

The intention of these was to match the Precision values without much code repetition but this seems out of scope + the precision on `StartingFlaghlightSize` isn't really necessary since user changed values precision is capped at a min of 0.1
This commit is contained in:
o-dasher 2022-10-13 14:59:45 -04:00
parent f3435f9abc
commit bf7b3ee30e
5 changed files with 31 additions and 16 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.UI; using osu.Game.Rulesets.Catch.UI;
@ -14,10 +15,12 @@ namespace osu.Game.Rulesets.Catch.Mods
{ {
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1; public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1;
public CatchModFlashlight() public override BindableFloat StartingFlashlightSize { get; } = new BindableFloat(1)
{ {
StartingFlashlightSize.MaxValue = 1.5f; MinValue = 0.5f,
} MaxValue = 1.5f,
Precision = 0.1f
};
public override float DefaultFlashlightSize => 325; public override float DefaultFlashlightSize => 325;

View File

@ -2,6 +2,7 @@
// See the LICENCE file in the repository root for full licence text. // See the LICENCE file in the repository root for full licence text.
using System; using System;
using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Layout; using osu.Framework.Layout;
using osu.Game.Rulesets.Mania.Objects; using osu.Game.Rulesets.Mania.Objects;
@ -18,9 +19,15 @@ namespace osu.Game.Rulesets.Mania.Mods
public ManiaModFlashlight() public ManiaModFlashlight()
{ {
FinalFlashlightSize.Default = 1; 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; public override float DefaultFlashlightSize => 50;
protected override Flashlight CreateFlashlight() => new ManiaFlashlight(this); protected override Flashlight CreateFlashlight() => new ManiaFlashlight(this);

View File

@ -32,6 +32,13 @@ namespace osu.Game.Rulesets.Osu.Mods
Precision = default_follow_delay, 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; public override float DefaultFlashlightSize => 200;
private OsuFlashlight flashlight = null!; private OsuFlashlight flashlight = null!;

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. // 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. // See the LICENCE file in the repository root for full licence text.
using osu.Framework.Bindables;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Layout; using osu.Framework.Layout;
using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Mods;
@ -15,6 +16,13 @@ namespace osu.Game.Rulesets.Taiko.Mods
{ {
public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1; 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; public override float DefaultFlashlightSize => 200;
protected override Flashlight CreateFlashlight() => new TaikoFlashlight(this, playfield); protected override Flashlight CreateFlashlight() => new TaikoFlashlight(this, playfield);
@ -24,9 +32,6 @@ namespace osu.Game.Rulesets.Taiko.Mods
public override void ApplyToDrawableRuleset(DrawableRuleset<TaikoHitObject> drawableRuleset) public override void ApplyToDrawableRuleset(DrawableRuleset<TaikoHitObject> drawableRuleset)
{ {
playfield = (TaikoPlayfield)drawableRuleset.Playfield; playfield = (TaikoPlayfield)drawableRuleset.Playfield;
StartingFlashlightSize.MaxValue = 1.5f;
base.ApplyToDrawableRuleset(drawableRuleset); base.ApplyToDrawableRuleset(drawableRuleset);
} }

View File

@ -32,8 +32,6 @@ namespace osu.Game.Rulesets.Mods
public override ModType Type => ModType.DifficultyIncrease; public override ModType Type => ModType.DifficultyIncrease;
public override LocalisableString Description => "Restricted view area."; public override LocalisableString Description => "Restricted view area.";
private const float size_customization_precision = 0.05f;
private float findClosestMultipleFrom(int value, float multiple) => MathF.Round(value / multiple) * multiple; private float findClosestMultipleFrom(int value, float multiple) => MathF.Round(value / multiple) * multiple;
protected ModFlashlight() protected ModFlashlight()
@ -51,19 +49,14 @@ namespace osu.Game.Rulesets.Mods
} }
[SettingSource("Starting flashlight size", "Multiplier applied to the default flashlight size.")] [SettingSource("Starting flashlight size", "Multiplier applied to the default flashlight size.")]
public BindableFloat StartingFlashlightSize { get; } = new BindableFloat(1) public abstract BindableFloat StartingFlashlightSize { get; }
{
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.")] [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) public BindableFloat FinalFlashlightSize { get; } = new BindableFloat(0.625f)
{ {
MinValue = 0.5f, MinValue = 0.5f,
MaxValue = 1, MaxValue = 1,
Precision = size_customization_precision Precision = 0.05f
}; };
[SettingSource("Change size combo divisor", "Changes the combo divisor where the flashlight size is changed.")] [SettingSource("Change size combo divisor", "Changes the combo divisor where the flashlight size is changed.")]