Skip to content

Commit 22ba956

Browse files
authored
Merge pull request #34833 from peppy/fix-mod-cosmetics
Fix some mods showing tooltips when settings are default
2 parents 24ec43b + 9e77a5b commit 22ba956

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

osu.Game/Rulesets/Mods/Mod.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ public abstract class Mod : IMod, IEquatable<Mod>, IDeepCloneable<Mod>
5656
{
5757
var bindable = (IBindable)property.GetValue(this)!;
5858

59+
if (bindable.IsDefault)
60+
continue;
61+
5962
string valueText;
6063

6164
switch (bindable)
@@ -69,8 +72,7 @@ public abstract class Mod : IMod, IEquatable<Mod>, IDeepCloneable<Mod>
6972
break;
7073
}
7174

72-
if (!bindable.IsDefault)
73-
yield return (attr.Label, valueText);
75+
yield return (attr.Label, valueText);
7476
}
7577
}
7678
}

osu.Game/Rulesets/Mods/ModBarrelRoll.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,19 @@ public abstract class ModBarrelRoll<TObject> : Mod, IUpdatableByPlayfield, IAppl
4646
{
4747
get
4848
{
49-
yield return ("Roll speed", $"{SpinSpeed.Value:N2} rpm");
50-
yield return ("Direction", Direction.Value.GetDescription());
49+
if (!SpinSpeed.IsDefault)
50+
yield return ("Roll speed", $"{SpinSpeed.Value:N2} rpm");
51+
if (!Direction.IsDefault)
52+
yield return ("Direction", Direction.Value.GetDescription());
5153
}
5254
}
5355

5456
private PlayfieldAdjustmentContainer playfieldAdjustmentContainer = null!;
5557

5658
public virtual void Update(Playfield playfield)
5759
{
58-
playfieldAdjustmentContainer.Rotation = CurrentRotation = (Direction.Value == RotationDirection.Counterclockwise ? -1 : 1) * 360 * (float)(playfield.Time.Current / 60000 * SpinSpeed.Value);
60+
playfieldAdjustmentContainer.Rotation =
61+
CurrentRotation = (Direction.Value == RotationDirection.Counterclockwise ? -1 : 1) * 360 * (float)(playfield.Time.Current / 60000 * SpinSpeed.Value);
5962
}
6063

6164
public void ApplyToDrawableRuleset(DrawableRuleset<TObject> drawableRuleset)

osu.Game/Rulesets/Mods/ModTimeRamp.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ public abstract class ModTimeRamp : Mod, IUpdatableByPlayfield, IApplicableToBea
4141
{
4242
get
4343
{
44-
yield return ("Speed change", $"{InitialRate.Value:N2}x to {FinalRate.Value:N2}x");
44+
if (!InitialRate.IsDefault || !FinalRate.IsDefault)
45+
yield return ("Speed change", $"{InitialRate.Value:N2}x to {FinalRate.Value:N2}x");
4546

4647
if (!AdjustPitch.IsDefault)
4748
yield return ("Adjust pitch", AdjustPitch.Value ? "On" : "Off");

0 commit comments

Comments
 (0)