Separate the settings for each modes radiuses

This commit is contained in:
mk-56 2022-01-22 19:38:56 +01:00
parent b5f813a949
commit 955bab926f
5 changed files with 75 additions and 38 deletions

View File

@ -3,6 +3,7 @@
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Game.Configuration;
using osu.Game.Rulesets.Catch.Objects;
using osu.Game.Rulesets.Catch.UI;
using osu.Game.Rulesets.Mods;
@ -15,8 +16,22 @@ namespace osu.Game.Rulesets.Catch.Mods
{
public override double ScoreMultiplier => 1.12;
public override bool DefaultComboDependency => true;
public override float DefaultRadius => 350;
[SettingSource("Change radius based on combo", "Decrease the flashlight radius as combo increases.")]
public override BindableBool ChangeRadius { get; } = new BindableBool
{
Default = true,
Value = true
};
[SettingSource("Initial radius", "Initial radius of the flashlight area.")]
public override BindableNumber<float> InitialRadius { get; } = new BindableNumber<float>
{
MinValue = 150f,
MaxValue = 600f,
Default = 350f,
Value = 350f,
Precision = 5f
};
public override Flashlight CreateFlashlight() => new CatchFlashlight(playfield, ChangeRadius.Value, InitialRadius.Value);

View File

@ -5,6 +5,7 @@ using System;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Layout;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mania.Objects;
using osu.Game.Rulesets.Mods;
using osuTK;
@ -16,8 +17,22 @@ namespace osu.Game.Rulesets.Mania.Mods
public override double ScoreMultiplier => 1;
public override Type[] IncompatibleMods => new[] { typeof(ModHidden) };
public override bool DefaultComboDependency => false;
public override float DefaultRadius => 180;
[SettingSource("Change radius based on combo", "Decrease the flashlight radius as combo increases.")]
public override BindableBool ChangeRadius { get; } = new BindableBool
{
Default = false,
Value = false
};
[SettingSource("Initial radius", "Initial radius of the flashlight area.")]
public override BindableNumber<float> InitialRadius { get; } = new BindableNumber<float>
{
MinValue = 0f,
MaxValue = 230f,
Default = 50f,
Value = 50f,
Precision = 5f
};
public override Flashlight CreateFlashlight() => new ManiaFlashlight(ChangeRadius.Value, InitialRadius.Value);

View File

@ -20,14 +20,32 @@ namespace osu.Game.Rulesets.Osu.Mods
{
public override double ScoreMultiplier => 1.12;
public override bool DefaultComboDependency => true;
//private const float default_flashlight_size = 180;
public override float DefaultRadius => 180;
private const double default_follow_delay = 120;
[SettingSource("Follow delay", "Milliseconds until the flashlight reaches the cursor")]
public BindableNumber<double> FollowDelay { get; } = new BindableDouble(default_follow_delay)
{
MinValue = default_follow_delay,
MaxValue = default_follow_delay * 10,
Precision = default_follow_delay,
};
[SettingSource("Change radius based on combo", "Decrease the flashlight radius as combo increases.")]
public override BindableBool ChangeRadius { get; } = new BindableBool
{
Default = true,
Value = true
};
[SettingSource("Initial radius", "Initial radius of the flashlight area.")]
public override BindableNumber<float> InitialRadius { get; } = new BindableNumber<float>
{
MinValue = 90f,
MaxValue = 360f,
Default = 180f,
Value = 180f,
Precision = 5f
};
private OsuFlashlight flashlight;
@ -39,14 +57,6 @@ namespace osu.Game.Rulesets.Osu.Mods
s.Tracking.ValueChanged += flashlight.OnSliderTrackingChange;
}
[SettingSource("Follow delay", "Milliseconds until the flashlight reaches the cursor")]
public BindableNumber<double> FollowDelay { get; } = new BindableDouble(default_follow_delay)
{
MinValue = default_follow_delay,
MaxValue = default_follow_delay * 10,
Precision = default_follow_delay,
};
private class OsuFlashlight : Flashlight, IRequireHighFrequencyMousePosition
{
public double FollowDelay { private get; set; }

View File

@ -4,6 +4,7 @@
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Layout;
using osu.Game.Configuration;
using osu.Game.Rulesets.Mods;
using osu.Game.Rulesets.Taiko.Objects;
using osu.Game.Rulesets.Taiko.UI;
@ -16,10 +17,22 @@ namespace osu.Game.Rulesets.Taiko.Mods
{
public override double ScoreMultiplier => 1.12;
public override bool DefaultComboDependency => true;
[SettingSource("Change radius based on combo", "Decrease the flashlight radius as combo increases.")]
public override BindableBool ChangeRadius { get; } = new BindableBool
{
Default = true,
Value = true
};
//private const float default_flashlight_size = 250;
public override float DefaultRadius => 250;
[SettingSource("Initial radius", "Initial radius of the flashlight area.")]
public override BindableNumber<float> InitialRadius { get; } = new BindableNumber<float>
{
MinValue = 0f,
MaxValue = 400f,
Default = 250f,
Value = 250f,
Precision = 5f
};
public override Flashlight CreateFlashlight() => new TaikoFlashlight(playfield, ChangeRadius.Value, InitialRadius.Value);

View File

@ -34,26 +34,10 @@ namespace osu.Game.Rulesets.Mods
public override string Description => "Restricted view area.";
[SettingSource("Change radius based on combo", "Decrease the flashlight radius as combo increases.")]
public Bindable<bool> ChangeRadius { get; private set; }
public abstract BindableBool ChangeRadius { get; }
[SettingSource("Initial radius", "Initial radius of the flashlight area.")]
public BindableNumber<float> InitialRadius { get; private set; }
public abstract float DefaultRadius { get; }
public abstract bool DefaultComboDependency { get; }
internal ModFlashlight()
{
InitialRadius = new BindableFloat(DefaultRadius)
{
MinValue = DefaultRadius * .5f,
MaxValue = DefaultRadius * 1.5f,
Precision = 5f,
};
ChangeRadius = new BindableBool(DefaultComboDependency);
}
public abstract BindableNumber<float> InitialRadius { get; }
}
public abstract class ModFlashlight<T> : ModFlashlight, IApplicableToDrawableRuleset<T>, IApplicableToScoreProcessor