Add labels and fix dropdown bindable values

This commit is contained in:
voidedWarranties 2020-02-27 17:30:06 -08:00
parent aea77cae98
commit f486db48de
1 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,6 @@
using JetBrains.Annotations;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.UserInterface;
using osu.Game.Overlays.Settings;
namespace osu.Game.Configuration
@ -105,7 +104,8 @@ public static IEnumerable<Drawable> CreateSettingsControls(this object obj)
var dropdownType = typeof(SettingsEnumDropdown<>).MakeGenericType(bindable.GetType().GetGenericArguments()[0]);
var dropdown = (Drawable)Activator.CreateInstance(dropdownType);
dropdown.GetType().GetProperty(nameof(IHasCurrentValue<object>.Current))?.SetValue(dropdown, obj);
dropdownType.GetProperty(nameof(SettingsDropdown<object>.LabelText))?.SetValue(dropdown, attr.Label);
dropdownType.GetProperty(nameof(SettingsDropdown<object>.Bindable))?.SetValue(dropdown, bindable);
yield return dropdown;