Exclude extended limits setting in ModDifficultyAdjust.UserAdjustedSettingsCount#33561
Closed
tsunyoku wants to merge 1 commit into
Closed
Exclude extended limits setting in ModDifficultyAdjust.UserAdjustedSettingsCount#33561tsunyoku wants to merge 1 commit into
ModDifficultyAdjust.UserAdjustedSettingsCount#33561tsunyoku wants to merge 1 commit into
Conversation
bdach
reviewed
Jun 9, 2025
Comment on lines
+126
to
+127
| if (property.Name == nameof(ExtendedLimits)) | ||
| continue; |
Collaborator
There was a problem hiding this comment.
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?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #33522.
There's no point including it in the adjusted settings count since enabling it without changing any other properties does nothing.