mirror of
https://github.com/ppy/osu.git
synced 2024-11-07 20:47:26 +08:00
Merge pull request #7383 from huoyaoyuan/resource-assembly
Construct DllResourceStore with assemblies
This commit is contained in:
commit
7ce12d0aed
@ -29,7 +29,7 @@ namespace osu.Game.Rulesets.Osu.Tests
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(AudioManager audio, SkinManager skinManager)
|
private void load(AudioManager audio, SkinManager skinManager)
|
||||||
{
|
{
|
||||||
var dllStore = new DllResourceStore("osu.Game.Rulesets.Osu.Tests.dll");
|
var dllStore = new DllResourceStore(typeof(SkinnableTestScene).Assembly);
|
||||||
|
|
||||||
metricsSkin = new TestLegacySkin(new SkinInfo(), new NamespacedResourceStore<byte[]>(dllStore, "Resources/metrics_skin"), audio, true);
|
metricsSkin = new TestLegacySkin(new SkinInfo(), new NamespacedResourceStore<byte[]>(dllStore, "Resources/metrics_skin"), audio, true);
|
||||||
defaultSkin = skinManager.GetSkin(DefaultLegacySkin.Info);
|
defaultSkin = skinManager.GetSkin(DefaultLegacySkin.Info);
|
||||||
|
@ -9,7 +9,7 @@ namespace osu.Game.Tests.Resources
|
|||||||
{
|
{
|
||||||
public static class TestResources
|
public static class TestResources
|
||||||
{
|
{
|
||||||
public static DllResourceStore GetStore() => new DllResourceStore("osu.Game.Tests.dll");
|
public static DllResourceStore GetStore() => new DllResourceStore(typeof(TestResources).Assembly);
|
||||||
|
|
||||||
public static Stream OpenResource(string name) => GetStore().GetStream($"Resources/{name}");
|
public static Stream OpenResource(string name) => GetStore().GetStream($"Resources/{name}");
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ namespace osu.Game.Tournament
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(Storage storage, FrameworkConfigManager frameworkConfig)
|
private void load(Storage storage, FrameworkConfigManager frameworkConfig)
|
||||||
{
|
{
|
||||||
Resources.AddStore(new DllResourceStore(@"osu.Game.Tournament.dll"));
|
Resources.AddStore(new DllResourceStore(typeof(TournamentGameBase).Assembly));
|
||||||
|
|
||||||
AddFont(Resources, @"Resources/Fonts/Aquatico-Regular");
|
AddFont(Resources, @"Resources/Fonts/Aquatico-Regular");
|
||||||
AddFont(Resources, @"Resources/Fonts/Aquatico-Light");
|
AddFont(Resources, @"Resources/Fonts/Aquatico-Light");
|
||||||
|
@ -29,6 +29,7 @@ using osu.Game.Database;
|
|||||||
using osu.Game.Input;
|
using osu.Game.Input;
|
||||||
using osu.Game.Input.Bindings;
|
using osu.Game.Input.Bindings;
|
||||||
using osu.Game.IO;
|
using osu.Game.IO;
|
||||||
|
using osu.Game.Resources;
|
||||||
using osu.Game.Rulesets;
|
using osu.Game.Rulesets;
|
||||||
using osu.Game.Rulesets.Mods;
|
using osu.Game.Rulesets.Mods;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
@ -125,7 +126,7 @@ namespace osu.Game
|
|||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
Resources.AddStore(new DllResourceStore(@"osu.Game.Resources.dll"));
|
Resources.AddStore(new DllResourceStore(OsuResources.ResourceAssembly));
|
||||||
|
|
||||||
dependencies.Cache(contextFactory = new DatabaseContextFactory(Storage));
|
dependencies.Cache(contextFactory = new DatabaseContextFactory(Storage));
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ namespace osu.Game.Rulesets
|
|||||||
|
|
||||||
public virtual Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.Solid.QuestionCircle };
|
public virtual Drawable CreateIcon() => new SpriteIcon { Icon = FontAwesome.Solid.QuestionCircle };
|
||||||
|
|
||||||
public virtual IResourceStore<byte[]> CreateResourceStore() => new NamespacedResourceStore<byte[]>(new DllResourceStore(GetType().Assembly.Location), @"Resources");
|
public virtual IResourceStore<byte[]> CreateResourceStore() => new NamespacedResourceStore<byte[]>(new DllResourceStore(GetType().Assembly), @"Resources");
|
||||||
|
|
||||||
public abstract string Description { get; }
|
public abstract string Description { get; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user