// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using osu.Game.Skinning; #nullable enable namespace osu.Game.Screens.Edit { /// /// A that fires when users have made a change to the beatmap skin /// of the map being edited. /// public class EditorSkinProvidingContainer : RulesetSkinProvidingContainer { private readonly EditorBeatmapSkin? beatmapSkin; public EditorSkinProvidingContainer(EditorBeatmap editorBeatmap) : base(editorBeatmap.PlayableBeatmap.BeatmapInfo.Ruleset.CreateInstance(), editorBeatmap, editorBeatmap.BeatmapSkin) { beatmapSkin = editorBeatmap.BeatmapSkin; } protected override void LoadComplete() { base.LoadComplete(); if (beatmapSkin != null) beatmapSkin.BeatmapSkinChanged += TriggerSourceChanged; } protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); if (beatmapSkin != null) beatmapSkin.BeatmapSkinChanged -= TriggerSourceChanged; } } }