move overridability to SettingDescription method

This commit is contained in:
Liam DeVoe
2020-03-20 16:34:36 -04:00
parent 7bdbdd25f8
commit cda1efef0b
8 changed files with 67 additions and 15 deletions

View File

@ -51,7 +51,23 @@ namespace osu.Game.Rulesets.Mods
/// are displayed in the tooltip.
/// </remarks>
[JsonIgnore]
public virtual string IconTooltip => Name;
public string IconTooltip
{
get
{
string settingDescription = string.IsNullOrEmpty(SettingDescription) ? "" : $" ({SettingDescription})";
return $"{Name}{settingDescription}";
}
}
/// <summary>
/// The description of editable settings of a mod to use in the <see cref="IconTooltip"/>.
/// </summary>
/// <remarks>
/// Parentheses are added to the tooltip, surrounding the value of this property. If this property is <c>string.Empty</c>,
/// the tooltip will not have parentheses.
/// </remarks>
public virtual string SettingDescription => string.Empty;
/// <summary>
/// The score multiplier of this mod.