From 8394e2ff382666018da256b73f6bb699f5eac7c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Sat, 11 Feb 2017 16:27:15 +0100 Subject: [PATCH] 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. --- osu.Game/Overlays/Options/OptionDropDown.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/osu.Game/Overlays/Options/OptionDropDown.cs b/osu.Game/Overlays/Options/OptionDropDown.cs index ee355d4016..b9d676109e 100644 --- a/osu.Game/Overlays/Options/OptionDropDown.cs +++ b/osu.Game/Overlays/Options/OptionDropDown.cs @@ -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; + } } }