mirror of
https://github.com/ppy/osu.git
synced 2025-01-28 09:43:10 +08:00
Fix skins not being displayed correctly in the editor (#6426)
Fix skins not being displayed correctly in the editor Co-authored-by: Dan Balasescu <smoogipoo@smgi.me>
This commit is contained in:
commit
d5aca57b08
@ -11,6 +11,7 @@ using osu.Framework.Logging;
|
|||||||
using osu.Game.Rulesets.Edit;
|
using osu.Game.Rulesets.Edit;
|
||||||
using osu.Game.Screens.Edit.Compose.Components;
|
using osu.Game.Screens.Edit.Compose.Components;
|
||||||
using osu.Game.Screens.Edit.Compose.Components.Timeline;
|
using osu.Game.Screens.Edit.Compose.Components.Timeline;
|
||||||
|
using osu.Game.Skinning;
|
||||||
using osuTK.Graphics;
|
using osuTK.Graphics;
|
||||||
|
|
||||||
namespace osu.Game.Screens.Edit.Compose
|
namespace osu.Game.Screens.Edit.Compose
|
||||||
@ -115,7 +116,17 @@ namespace osu.Game.Screens.Edit.Compose
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
composerContainer.Child = composer;
|
var beatmapSkinProvider = new BeatmapSkinProvidingContainer(Beatmap.Value.Skin);
|
||||||
|
|
||||||
|
// the beatmapSkinProvider is used as the fallback source here to allow the ruleset-specific skin implementation
|
||||||
|
// full access to all skin sources.
|
||||||
|
var rulesetSkinProvider = new SkinProvidingContainer(ruleset.CreateLegacySkinProvider(beatmapSkinProvider));
|
||||||
|
|
||||||
|
// load the skinning hierarchy first.
|
||||||
|
// this is intentionally done in two stages to ensure things are in a loaded state before exposing the ruleset to skin sources.
|
||||||
|
composerContainer.Add(
|
||||||
|
beatmapSkinProvider.WithChild(
|
||||||
|
rulesetSkinProvider.WithChild(composer)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ namespace osu.Game.Skinning
|
|||||||
if (AllowTextureLookup(componentName) && (sourceTexture = skin?.GetTexture(componentName)) != null)
|
if (AllowTextureLookup(componentName) && (sourceTexture = skin?.GetTexture(componentName)) != null)
|
||||||
return sourceTexture;
|
return sourceTexture;
|
||||||
|
|
||||||
return fallbackSource.GetTexture(componentName);
|
return fallbackSource?.GetTexture(componentName);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SampleChannel GetSample(ISampleInfo sampleInfo)
|
public SampleChannel GetSample(ISampleInfo sampleInfo)
|
||||||
|
Loading…
Reference in New Issue
Block a user