From 24e50251ec56d881b7dce4dc0c970702d6c21328 Mon Sep 17 00:00:00 2001 From: o-dasher <88356162+o-dasher@users.noreply.github.com> Date: Mon, 26 Sep 2022 19:40:24 -0400 Subject: [PATCH] Apply suggestions from the review --- .../Mods/CatchModFlashlight.cs | 4 +-- .../Mods/ManiaModFlashlight.cs | 4 +-- .../Mods/OsuModFlashlight.cs | 4 +-- .../Mods/TaikoModFlashlight.cs | 4 +-- .../SongSelect/TestSceneBeatmapLeaderboard.cs | 2 +- osu.Game/Rulesets/Mods/ModFlashlight.cs | 25 +++++++++---------- 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs b/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs index 874d495a27..acfd05745b 100644 --- a/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs +++ b/osu.Game.Rulesets.Catch/Mods/CatchModFlashlight.cs @@ -16,8 +16,8 @@ namespace osu.Game.Rulesets.Catch.Mods { public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1; - [SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")] - public override BindableFloat SizeMultiplier { get; } = new BindableFloat + [SettingSource("Starting flashlight size", "Multiplier applied to the default flashlight size.")] + public override BindableFloat StartingFlashlightSize { get; } = new BindableFloat { MinValue = 0.5f, MaxValue = 1.5f, diff --git a/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs b/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs index 1f91e40e0c..ab595e6188 100644 --- a/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs +++ b/osu.Game.Rulesets.Mania/Mods/ManiaModFlashlight.cs @@ -22,8 +22,8 @@ namespace osu.Game.Rulesets.Mania.Mods FinalFlashlightSize.Default = 1; } - [SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")] - public override BindableFloat SizeMultiplier { get; } = new BindableFloat + [SettingSource("Starting flashlight size", "Multiplier applied to the default flashlight size.")] + public override BindableFloat StartingFlashlightSize { get; } = new BindableFloat { MinValue = 0.5f, MaxValue = 3f, diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs index c4ded8fe7f..80692a8b8f 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModFlashlight.cs @@ -32,8 +32,8 @@ namespace osu.Game.Rulesets.Osu.Mods Precision = default_follow_delay, }; - [SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")] - public override BindableFloat SizeMultiplier { get; } = new BindableFloat + [SettingSource("Starting flashlight size", "Multiplier applied to the default flashlight size.")] + public override BindableFloat StartingFlashlightSize { get; } = new BindableFloat { MinValue = 0.5f, MaxValue = 2f, diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs index d62f6e1f8d..832b11c912 100644 --- a/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs +++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModFlashlight.cs @@ -17,8 +17,8 @@ namespace osu.Game.Rulesets.Taiko.Mods { public override double ScoreMultiplier => UsesDefaultConfiguration ? 1.12 : 1; - [SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")] - public override BindableFloat SizeMultiplier { get; } = new BindableFloat + [SettingSource("Starting flashlight size", "Multiplier applied to the default flashlight size.")] + public override BindableFloat StartingFlashlightSize { get; } = new BindableFloat { MinValue = 0.5f, MaxValue = 1.5f, diff --git a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapLeaderboard.cs b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapLeaderboard.cs index 07da1790c8..89ee6ec7c6 100644 --- a/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapLeaderboard.cs +++ b/osu.Game.Tests/Visual/SongSelect/TestSceneBeatmapLeaderboard.cs @@ -200,7 +200,7 @@ namespace osu.Game.Tests.Visual.SongSelect new OsuModFlashlight { FollowDelay = { Value = 200 }, - SizeMultiplier = { Value = 5 }, + StartingFlashlightSize = { Value = 5 }, }, new OsuModDifficultyAdjust { diff --git a/osu.Game/Rulesets/Mods/ModFlashlight.cs b/osu.Game/Rulesets/Mods/ModFlashlight.cs index 0ee08c0da6..eccdf080a5 100644 --- a/osu.Game/Rulesets/Mods/ModFlashlight.cs +++ b/osu.Game/Rulesets/Mods/ModFlashlight.cs @@ -42,10 +42,10 @@ namespace osu.Game.Rulesets.Mods FinalFlashlightSize.DefaultChanged += _ => FinalFlashlightSize.SetDefault(); } - [SettingSource("Flashlight size", "Multiplier applied to the default flashlight size.")] - public abstract BindableFloat SizeMultiplier { get; } + [SettingSource("Starting flashlight size", "Multiplier applied to the default flashlight size.")] + public abstract BindableFloat StartingFlashlightSize { get; } - [SettingSource("Final flashlight size", "The final size multiplier that is reached when the flashlight changes size for the last time.")] + [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.8f) { MinValue = 0.5f, @@ -60,8 +60,8 @@ namespace osu.Game.Rulesets.Mods MaxValue = max_change_size_combo, }; - [SettingSource("Change size times", "Changes how many times the flashlight size is changed before reaching the final flashlight size.")] - public BindableInt MaxChangeSizeTimes { get; } = new BindableInt(2) + [SettingSource("Amount of size changes", "The amount of times the flashlight size changes.")] + public BindableInt SizeChangesAmount { get; } = new BindableInt(2) { MinValue = min_change_size_combo, MaxValue = max_change_size_combo, @@ -133,23 +133,22 @@ namespace osu.Game.Rulesets.Mods private readonly float changeSizeDecreaseRatio; private readonly bool comboBasedSize; - private readonly int maxChangeSizeTimes; + private readonly int sizeChangesAmount; private readonly float changeSizeCombo; protected Flashlight(ModFlashlight modFlashlight) { changeSizeCombo = modFlashlight.ChangeSizeCombo.Value; - maxChangeSizeTimes = modFlashlight.MaxChangeSizeTimes.Value; + sizeChangesAmount = modFlashlight.SizeChangesAmount.Value; - appliedFlashlightSize = modFlashlight.DefaultFlashlightSize * modFlashlight.SizeMultiplier.Value; + appliedFlashlightSize = modFlashlight.DefaultFlashlightSize * modFlashlight.StartingFlashlightSize.Value; - var finalFlashlightSizeBinding = modFlashlight.FinalFlashlightSize; - float finalFlashlightSize = finalFlashlightSizeBinding.Value; + float finalFlashlightSize = modFlashlight.FinalFlashlightSize.Value; comboBasedSize = !Precision.AlmostEquals(finalFlashlightSize, 1); if (comboBasedSize) - changeSizeDecreaseRatio = (1 - finalFlashlightSize) / maxChangeSizeTimes; + changeSizeDecreaseRatio = (1 - finalFlashlightSize) / sizeChangesAmount; } [BackgroundDependencyLoader] @@ -187,9 +186,9 @@ namespace osu.Game.Rulesets.Mods { if (!comboBasedSize) return appliedFlashlightSize; - float changeSizeComboReachedTimesLimited = MathF.Min(maxChangeSizeTimes, MathF.Floor(combo / changeSizeCombo)); + float sizeChangeCount = MathF.Min(sizeChangesAmount, MathF.Floor(combo / changeSizeCombo)); - return appliedFlashlightSize * (1 - changeSizeComboReachedTimesLimited * changeSizeDecreaseRatio); + return appliedFlashlightSize * (1 - sizeChangeCount * changeSizeDecreaseRatio); } private Vector2 flashlightPosition;