mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 06:42:56 +08:00
Merge pull request #24632 from peppy/mod-bool-display-improvement
Show mod settings as "on" or "off" rather than "True" or "False"
This commit is contained in:
commit
8d24bf5049
@ -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)));
|
||||
|
Loading…
Reference in New Issue
Block a user