1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-15 12:02:55 +08:00

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

@ -1 +1 @@
Subproject commit f4362fce5a891e8b8dd84fadc0a9743a8c92e030
Subproject commit fdcd1c5b5036c7cc1d75abb605e225e7411d5742

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()
{