mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09: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:
Submodule osu-framework updated: f4362fce5a...fdcd1c5b50
@ -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()
|
||||
{
|
||||
|
Reference in New Issue
Block a user