mirror of
https://github.com/ppy/osu
synced 2024-12-13 18:37:04 +00:00
Merge pull request #2934 from smoogipoo/fix-skin-crash
Fix crash if the skin stored in the config doesn't exist anymore
This commit is contained in:
commit
7c5ad43d22
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user