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:
parent
fe86a9e431
commit
b230b5cfb9
@ -1 +1 @@
|
||||
Subproject commit f4362fce5a891e8b8dd84fadc0a9743a8c92e030
|
||||
Subproject commit fdcd1c5b5036c7cc1d75abb605e225e7411d5742
|
@ -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()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user