Update OsuDropDownMenu for Framework-Changes

Since the DropDownMenu in the framework has changed it was necessary
to update the GetDropDownItems override of OsuDropDownMenu to
accomodate the new structure of the framework.
This commit is contained in:
default0
2017-02-06 01:17:50 +01:00
parent fe86a9e431
commit b230b5cfb9
2 changed files with 3 additions and 11 deletions

View File

@ -17,16 +17,8 @@ namespace osu.Game.Graphics.UserInterface
{
protected override DropDownHeader CreateHeader() => new OsuDropDownHeader();
protected override IEnumerable<DropDownMenuItem<U>> GetDropDownItems(IEnumerable<U> values)
{
return values.Select(v =>
{
var field = typeof(U).GetField(Enum.GetName(typeof(U), v));
return new OsuDropDownMenuItem<U>(
field.GetCustomAttribute<DescriptionAttribute>()?.Description ?? field.Name, v);
});
}
protected override IEnumerable<DropDownMenuItem<U>> GetDropDownItems(IEnumerable<KeyValuePair<string, U>> values)
=> values.Select(v => new OsuDropDownMenuItem<U>(v.Key, v.Value));
public OsuDropDownMenu()
{