mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 18:23:04 +08:00
parent
9e5e2c8863
commit
903dd7a015
@ -51,15 +51,17 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
skins.ItemAdded += reloadSkins;
|
skins.ItemAdded += onItemsChanged;
|
||||||
skins.ItemRemoved += reloadSkins;
|
skins.ItemRemoved += onItemsChanged;
|
||||||
|
|
||||||
reloadSkins(null);
|
reloadSkins();
|
||||||
|
|
||||||
skinDropdown.Bindable = config.GetBindable<int>(OsuSetting.Skin);
|
skinDropdown.Bindable = config.GetBindable<int>(OsuSetting.Skin);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void reloadSkins(SkinInfo changed) => Schedule(() => skinDropdown.Items = skins.GetAllUsableSkins().Select(s => new KeyValuePair<string, int>(s.ToString(), s.ID)));
|
private void reloadSkins() => skinDropdown.Items = skins.GetAllUsableSkins().Select(s => new KeyValuePair<string, int>(s.ToString(), s.ID));
|
||||||
|
|
||||||
|
private void onItemsChanged(SkinInfo _) => Schedule(reloadSkins);
|
||||||
|
|
||||||
protected override void Dispose(bool isDisposing)
|
protected override void Dispose(bool isDisposing)
|
||||||
{
|
{
|
||||||
@ -67,8 +69,8 @@ namespace osu.Game.Overlays.Settings.Sections
|
|||||||
|
|
||||||
if (skins != null)
|
if (skins != null)
|
||||||
{
|
{
|
||||||
skins.ItemAdded -= reloadSkins;
|
skins.ItemAdded -= onItemsChanged;
|
||||||
skins.ItemRemoved -= reloadSkins;
|
skins.ItemRemoved -= onItemsChanged;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user