Don't hard-bail if config skin doesn't exist anymore

This commit is contained in:
smoogipoo 2018-07-02 16:49:07 +09:00
parent 7d256f6595
commit 9f405b0894

View File

@ -56,7 +56,13 @@ namespace osu.Game.Overlays.Settings.Sections
reloadSkins();
skinDropdown.Bindable = config.GetBindable<int>(OsuSetting.Skin);
var skinBindable = config.GetBindable<int>(OsuSetting.Skin);
// Todo: This should not be necessary when OsuConfigManager is databased
if (skinDropdown.Items.All(s => s.Value != skinBindable.Value))
skinBindable.Value = 0;
skinDropdown.Bindable = skinBindable;
}
private void reloadSkins() => skinDropdown.Items = skins.GetAllUsableSkins().Select(s => new KeyValuePair<string, int>(s.ToString(), s.ID));