Skip to content

Exclude extended limits setting in ModDifficultyAdjust.UserAdjustedSettingsCount#33561

Closed
tsunyoku wants to merge 1 commit into
ppy:masterfrom
tsunyoku:fix-difficulty-adjust-extended-limits-icon
Closed

Exclude extended limits setting in ModDifficultyAdjust.UserAdjustedSettingsCount#33561
tsunyoku wants to merge 1 commit into
ppy:masterfrom
tsunyoku:fix-difficulty-adjust-extended-limits-icon

Conversation

@tsunyoku
Copy link
Copy Markdown
Member

@tsunyoku tsunyoku commented Jun 8, 2025

Resolves #33522.

There's no point including it in the adjusted settings count since enabling it without changing any other properties does nothing.

image
image

@bdach bdach self-requested a review June 9, 2025 06:31
Comment on lines +126 to +127
if (property.Name == nameof(ExtendedLimits))
continue;
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I would rather de-reflection this entire thing than try this. Something like

diff --git a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs
index c300afa79f..e4a910700c 100644
--- a/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs
+++ b/osu.Game.Rulesets.Catch/Mods/CatchModDifficultyAdjust.cs
@@ -41,7 +41,7 @@ public override string ExtendedIconInformation
         {
             get
             {
-                if (UserAdjustedSettingsCount != 1)
+                if (!IsExactlyOneSettingChanged(CircleSize, ApproachRate, OverallDifficulty, DrainRate))
                     return string.Empty;
 
                 if (!CircleSize.IsDefault) return format("CS", CircleSize);
diff --git a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs
index 1d94ac6335..1c3b7360bc 100644
--- a/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs
+++ b/osu.Game.Rulesets.Osu/Mods/OsuModDifficultyAdjust.cs
@@ -41,7 +41,7 @@ public override string ExtendedIconInformation
         {
             get
             {
-                if (UserAdjustedSettingsCount != 1)
+                if (!IsExactlyOneSettingChanged(CircleSize, ApproachRate, OverallDifficulty, DrainRate))
                     return string.Empty;
 
                 if (!CircleSize.IsDefault) return format("CS", CircleSize);
diff --git a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs
index 57b57555c2..296342ed97 100644
--- a/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs
+++ b/osu.Game.Rulesets.Taiko/Mods/TaikoModDifficultyAdjust.cs
@@ -25,7 +25,7 @@ public override string ExtendedIconInformation
         {
             get
             {
-                if (UserAdjustedSettingsCount != 1)
+                if (!IsExactlyOneSettingChanged(ScrollSpeed, OverallDifficulty, DrainRate))
                     return string.Empty;
 
                 if (!ScrollSpeed.IsDefault) return format("SC", ScrollSpeed);
diff --git a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs
index 15ce583413..e811a3f853 100644
--- a/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs
+++ b/osu.Game/Rulesets/Mods/ModDifficultyAdjust.cs
@@ -72,7 +72,7 @@ public override string ExtendedIconInformation
         {
             get
             {
-                if (UserAdjustedSettingsCount != 1)
+                if (!IsExactlyOneSettingChanged(OverallDifficulty, DrainRate))
                     return string.Empty;
 
                 if (!OverallDifficulty.IsDefault) return format("OD", OverallDifficulty);
@@ -84,6 +84,24 @@ public override string ExtendedIconInformation
             }
         }
 
+        protected bool IsExactlyOneSettingChanged(params DifficultyBindable[] difficultySettings)
+        {
+            DifficultyBindable? result = null;
+
+            foreach (var setting in difficultySettings)
+            {
+                if (setting.IsDefault)
+                    continue;
+
+                if (result != null)
+                    return false;
+
+                result = setting;
+            }
+
+            return result != null;
+        }
+
         public override IEnumerable<(LocalisableString setting, LocalisableString value)> SettingDescription
         {
             get

@peppy am I alone in thinking this?

bdach added a commit to bdach/osu that referenced this pull request Jun 30, 2025
…extended limits active

- Closes ppy#33522.
- Alternative to / closes ppy#33561.
@bdach bdach closed this in #33962 Jun 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Difficulty Adjust doesn't change icon if "Extended limits" is enabled

2 participants