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

Update OptionDropDown value when items change

Items of OptionDropDown could previously already be changes on-the-fly,
but the selected value was not correctly updated (it kept the same index).
This commit addresses this problem.
This commit is contained in:
Thomas Müller 2017-02-11 16:27:15 +01:00
parent 2c4ecb990d
commit 8394e2ff38

View File

@ -71,7 +71,14 @@ namespace osu.Game.Overlays.Options
{
items = value;
if(dropdown != null)
{
dropdown.Items = value;
// We need to refresh the dropdown because our items changed,
// thus its selected value may be outdated.
if (bindable != null)
dropdown.SelectedValue = bindable.Value;
}
}
}