1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 12:22:57 +08:00

Show mod settings as "on" or "off" rather than "True" or "False"

This commit is contained in:
Dean Herbert 2023-08-23 20:21:43 +09:00
parent d6aded3ac3
commit 72d2715222

View File

@ -71,8 +71,21 @@ namespace osu.Game.Rulesets.Mods
{
var bindable = (IBindable)property.GetValue(this)!;
string valueText;
switch (bindable)
{
case Bindable<bool> 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)));