2019-12-20 10:30:23 +00:00
|
|
|
// 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.
|
|
|
|
|
2022-06-17 07:37:17 +00:00
|
|
|
#nullable disable
|
|
|
|
|
2021-01-29 05:48:51 +00:00
|
|
|
using System.Linq;
|
|
|
|
using osu.Game.Beatmaps;
|
|
|
|
using osu.Game.Configuration;
|
2019-12-20 10:30:23 +00:00
|
|
|
using osu.Game.Rulesets.Mods;
|
|
|
|
|
|
|
|
namespace osu.Game.Rulesets.Taiko.Mods
|
|
|
|
{
|
|
|
|
public class TaikoModDifficultyAdjust : ModDifficultyAdjust
|
|
|
|
{
|
2021-07-08 07:40:32 +00:00
|
|
|
[SettingSource("Scroll Speed", "Adjust a beatmap's set scroll speed", LAST_SETTING_ORDER + 1, SettingControlType = typeof(DifficultyAdjustSettingsControl))]
|
|
|
|
public DifficultyBindable ScrollSpeed { get; } = new DifficultyBindable
|
2021-01-29 05:48:51 +00:00
|
|
|
{
|
|
|
|
Precision = 0.05f,
|
|
|
|
MinValue = 0.25f,
|
|
|
|
MaxValue = 4,
|
2021-07-09 04:24:26 +00:00
|
|
|
ReadCurrentFromDifficulty = _ => 1,
|
2021-01-29 05:48:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
public override string SettingDescription
|
|
|
|
{
|
|
|
|
get
|
|
|
|
{
|
2022-03-02 09:38:17 +00:00
|
|
|
string scrollSpeed = ScrollSpeed.IsDefault ? string.Empty : $"Scroll x{ScrollSpeed.Value:N2}";
|
2021-01-29 05:48:51 +00:00
|
|
|
|
|
|
|
return string.Join(", ", new[]
|
|
|
|
{
|
|
|
|
base.SettingDescription,
|
2021-01-29 09:04:55 +00:00
|
|
|
scrollSpeed
|
2021-01-29 05:48:51 +00:00
|
|
|
}.Where(s => !string.IsNullOrEmpty(s)));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override void ApplySettings(BeatmapDifficulty difficulty)
|
|
|
|
{
|
|
|
|
base.ApplySettings(difficulty);
|
|
|
|
|
2021-07-08 07:40:32 +00:00
|
|
|
if (ScrollSpeed.Value != null) difficulty.SliderMultiplier *= ScrollSpeed.Value.Value;
|
2021-01-29 05:48:51 +00:00
|
|
|
}
|
2019-12-20 10:30:23 +00:00
|
|
|
}
|
|
|
|
}
|