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

Match size change precision.

This commit is contained in:
o-dasher 2022-10-12 15:56:17 -04:00
parent e6cffb0435
commit 79e0377638
5 changed files with 15 additions and 32 deletions

View File

@ -1,7 +1,6 @@
// 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;
@ -15,12 +14,10 @@ namespace osu.Game.Rulesets.Catch.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) public CatchModFlashlight()
{ {
MinValue = 0.5f, StartingFlashlightSize.MaxValue = 1.5f;
MaxValue = 1.5f, }
Precision = 0.1f
};
public override float DefaultFlashlightSize => 325; public override float DefaultFlashlightSize => 325;

View File

@ -2,7 +2,6 @@
// 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;
@ -19,15 +18,9 @@ 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,13 +32,6 @@ 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,7 +1,6 @@
// 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;
@ -16,13 +15,6 @@ 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);
@ -32,6 +24,9 @@ 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

@ -33,7 +33,7 @@ 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.";
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; 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.")] [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.")] [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 = 0.05f Precision = size_customization_precision
}; };
[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.")]