From 5df8fc378001a9788fc30ee69aad143249255e1f Mon Sep 17 00:00:00 2001 From: andy840119 Date: Wed, 8 Jun 2022 23:05:30 +0800 Subject: [PATCH] Should load the resource file from the dll in the debug build. --- osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs b/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs index 6be05d607..2ba569907 100644 --- a/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs +++ b/osu.Game.Rulesets.Karaoke/KaraokeRuleset.cs @@ -25,6 +25,7 @@ using osu.Game.Rulesets.Karaoke.Edit.Setup; using osu.Game.Rulesets.Karaoke.Mods; using osu.Game.Rulesets.Karaoke.Replays; +using osu.Game.Rulesets.Karaoke.Resources; using osu.Game.Rulesets.Karaoke.Scoring; using osu.Game.Rulesets.Karaoke.Skinning.Legacy; using osu.Game.Rulesets.Karaoke.Statistics; @@ -182,23 +183,16 @@ public override IResourceStore CreateResourceStore() { var store = new ResourceStore(); - // add ruleset store - store.AddStore(getRulesetStore()); + // add resource in the current dll. + store.AddStore(base.CreateResourceStore()); + + // add resource dll, it only works in the local because it will be packed into main dll in the resource build. + store.AddStore(new DllResourceStore(KaraokeResources.ResourceAssembly)); // add shader resource from font package. store.AddStore(new NamespacedResourceStore(new ShaderResourceStore(), "Resources")); return store; - - IResourceStore getRulesetStore() - { - var rulesetStore = base.CreateResourceStore(); - if (rulesetStore.GetAvailableResources().Any()) - return rulesetStore; - - // IRMerge might change the assembly name, which will cause resource not found. - return new NamespacedResourceStore(new DllResourceStore("osu.Game.Rulesets.Karaoke.dll"), @"Resources"); - } } public override DifficultyCalculator CreateDifficultyCalculator(IWorkingBeatmap beatmap) => new KaraokeDifficultyCalculator(RulesetInfo, beatmap);