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

Fix DHOs not receiving initial skin changed events

This commit is contained in:
smoogipoo 2021-05-24 14:07:40 +09:00
parent babe24ff5d
commit 7494ddeef4

View File

@ -172,7 +172,13 @@ namespace osu.Game.Rulesets.Objects.Drawables
base.AddInternal(Samples = new PausableSkinnableSound());
CurrentSkin = skinSource;
CurrentSkin.SourceChanged += onSkinSourceChanged;
CurrentSkin.SourceChanged += skinSourceChanged;
}
protected override void LoadAsyncComplete()
{
base.LoadAsyncComplete();
skinChanged();
}
protected override void LoadComplete()
@ -495,7 +501,9 @@ namespace osu.Game.Rulesets.Objects.Drawables
protected ISkinSource CurrentSkin { get; private set; }
private void onSkinSourceChanged() => Scheduler.AddOnce(() =>
private void skinSourceChanged() => Scheduler.AddOnce(skinChanged);
private void skinChanged()
{
UpdateComboColour();
@ -503,7 +511,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
if (IsLoaded)
updateState(State.Value, true);
});
}
protected void UpdateComboColour()
{
@ -747,7 +755,7 @@ namespace osu.Game.Rulesets.Objects.Drawables
if (HitObject != null)
HitObject.DefaultsApplied -= onDefaultsApplied;
CurrentSkin.SourceChanged -= onSkinSourceChanged;
CurrentSkin.SourceChanged -= skinSourceChanged;
}
}