From 72d27152225f760c6526d3ecc186d3ff469224c5 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Wed, 23 Aug 2023 20:21:43 +0900 Subject: [PATCH] Show mod settings as "on" or "off" rather than "True" or "False" --- osu.Game/Rulesets/Mods/Mod.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/osu.Game/Rulesets/Mods/Mod.cs b/osu.Game/Rulesets/Mods/Mod.cs index 6d40826afe..a9ecf89df1 100644 --- a/osu.Game/Rulesets/Mods/Mod.cs +++ b/osu.Game/Rulesets/Mods/Mod.cs @@ -71,8 +71,21 @@ namespace osu.Game.Rulesets.Mods { var bindable = (IBindable)property.GetValue(this)!; + string valueText; + + switch (bindable) + { + case Bindable b: + valueText = b.Value ? "on" : "off"; + break; + + default: + valueText = bindable.ToString() ?? string.Empty; + break; + } + if (!bindable.IsDefault) - tooltipTexts.Add($"{attr.Label}: {bindable}"); + tooltipTexts.Add($"{attr.Label}: {valueText}"); } return string.Join(", ", tooltipTexts.Where(s => !string.IsNullOrEmpty(s)));