From 41f4f0ab5e7eb373e8abe6d25c627c651415fe21 Mon Sep 17 00:00:00 2001 From: Semyon Rozhkov Date: Wed, 10 Nov 2021 03:57:22 +0300 Subject: [PATCH] Different setting slider description in each mod --- osu.Game.Rulesets.Catch/Mods/CatchModNoScope.cs | 16 ++++++++++++++++ osu.Game.Rulesets.Osu/Mods/OsuModNoScope.cs | 16 ++++++++++++++++ osu.Game/Rulesets/Mods/ModNoScope.cs | 15 +-------------- 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModNoScope.cs b/osu.Game.Rulesets.Catch/Mods/CatchModNoScope.cs index b0e374898e..bec53fc3bd 100644 --- a/osu.Game.Rulesets.Catch/Mods/CatchModNoScope.cs +++ b/osu.Game.Rulesets.Catch/Mods/CatchModNoScope.cs @@ -3,9 +3,12 @@ using System; using System.Linq; +using osu.Framework.Bindables; using osu.Game.Beatmaps; using osu.Game.Rulesets.Mods; using osu.Framework.Utils; +using osu.Game.Configuration; +using osu.Game.Overlays.Settings; using osu.Game.Rulesets.Catch.Objects; using osu.Game.Rulesets.Catch.UI; using osu.Game.Rulesets.UI; @@ -19,6 +22,19 @@ public class CatchModNoScope : ModNoScope, IApplicableToBeatmap, IUpdatableByPla public PeriodTracker BananaShowerPeriods; + [SettingSource( + "Hidden at combo", + "The combo count at which the catcher becomes completely hidden", + SettingControlType = typeof(SettingsSlider) + )] + public override BindableInt HiddenComboCount { get; } = new BindableInt + { + Default = 10, + Value = 10, + MinValue = 0, + MaxValue = 50, + }; + public void ApplyToBeatmap(IBeatmap beatmap) { BananaShowerPeriods = new PeriodTracker(beatmap.HitObjects.OfType().Select(b => new Period(b.StartTime - TRANSITION_DURATION, b.EndTime))); diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModNoScope.cs b/osu.Game.Rulesets.Osu/Mods/OsuModNoScope.cs index 3f9cd098cd..a73ddde110 100644 --- a/osu.Game.Rulesets.Osu/Mods/OsuModNoScope.cs +++ b/osu.Game.Rulesets.Osu/Mods/OsuModNoScope.cs @@ -3,8 +3,11 @@ using System; using System.Linq; +using osu.Framework.Bindables; using osu.Framework.Utils; using osu.Game.Beatmaps; +using osu.Game.Configuration; +using osu.Game.Overlays.Settings; using osu.Game.Rulesets.Mods; using osu.Game.Rulesets.Osu.Objects; using osu.Game.Rulesets.UI; @@ -18,6 +21,19 @@ public class OsuModNoScope : ModNoScope, IUpdatableByPlayfield, IApplicableToBea private PeriodTracker spinnerPeriods; + [SettingSource( + "Hidden at combo", + "The combo count at which the cursor becomes completely hidden", + SettingControlType = typeof(SettingsSlider) + )] + public override BindableInt HiddenComboCount { get; } = new BindableInt + { + Default = 10, + Value = 10, + MinValue = 0, + MaxValue = 50, + }; + public void ApplyToBeatmap(IBeatmap beatmap) { spinnerPeriods = new PeriodTracker(beatmap.HitObjects.OfType().Select(b => new Period(b.StartTime - TRANSITION_DURATION, b.EndTime))); diff --git a/osu.Game/Rulesets/Mods/ModNoScope.cs b/osu.Game/Rulesets/Mods/ModNoScope.cs index 9e2734b775..7a935eb38f 100644 --- a/osu.Game/Rulesets/Mods/ModNoScope.cs +++ b/osu.Game/Rulesets/Mods/ModNoScope.cs @@ -6,9 +6,7 @@ using osu.Framework.Graphics; using osu.Framework.Graphics.Sprites; using osu.Framework.Localisation; -using osu.Game.Configuration; using osu.Game.Graphics.UserInterface; -using osu.Game.Overlays.Settings; using osu.Game.Rulesets.Scoring; using osu.Game.Scoring; using osu.Game.Screens.Play; @@ -36,18 +34,7 @@ public abstract class ModNoScope : Mod, IApplicableToScoreProcessor, IApplicable protected float ComboBasedAlpha; - [SettingSource( - "Hidden at combo", - "The combo count at which the cursor becomes completely hidden", - SettingControlType = typeof(SettingsSlider) - )] - public BindableInt HiddenComboCount { get; } = new BindableInt - { - Default = 10, - Value = 10, - MinValue = 0, - MaxValue = 50, - }; + public abstract BindableInt HiddenComboCount { get; } public ScoreRank AdjustRank(ScoreRank rank, double accuracy) => rank;