mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 08:23:00 +08:00
fix style issues
This commit is contained in:
parent
5a6d8f1932
commit
9dc8146811
@ -45,11 +45,11 @@ namespace osu.Game.Configuration
|
||||
TooltipText = tooltipText;
|
||||
}
|
||||
|
||||
public SettingSourceAttribute(string label, string description, string tooltipText) : this(label, description)
|
||||
public SettingSourceAttribute(string label, string description, string tooltipText)
|
||||
: this(label, description)
|
||||
{
|
||||
TooltipText = tooltipText;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static class SettingSourceExtensions
|
||||
|
@ -60,25 +60,28 @@ namespace osu.Game.Rulesets.Mods
|
||||
get
|
||||
{
|
||||
List<string> attributes = new List<string>();
|
||||
|
||||
foreach ((SettingSourceAttribute attr, System.Reflection.PropertyInfo property) in this.GetOrderedSettingsSourceProperties())
|
||||
{
|
||||
// use TooltipText from SettingSource if available, but fall back to Label, which has to be provided
|
||||
string tooltipText = attr.TooltipText ?? attr.Label + " {0}";
|
||||
object bindableObj = property.GetValue(this);
|
||||
|
||||
if (bindableObj is BindableInt bindableInt && !bindableInt.IsDefault)
|
||||
{
|
||||
attributes.Add(string.Format(tooltipText, bindableInt.Value));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bindableObj is BindableFloat bindableFloat && !bindableFloat.IsDefault)
|
||||
{
|
||||
attributes.Add(string.Format(tooltipText, bindableFloat.Value));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (bindableObj is BindableDouble bindableDouble && !bindableDouble.IsDefault)
|
||||
{
|
||||
attributes.Add(string.Format(tooltipText, bindableDouble.Value));
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return $"{Name}{(attributes.Any() ? $" ({string.Join(", ", attributes)})" : "")}";
|
||||
|
Loading…
Reference in New Issue
Block a user