-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
101 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
using DefaultEcs; | ||
using GameHost.Core.Modules; | ||
using GameHost.Injection; | ||
using GameHost.IO; | ||
using GameHost.Simulation.Application; | ||
using GameHost.Threading; | ||
using GameHost.Worlds; | ||
using PataNext.Game.BGM; | ||
using PataNext.Game.Client.Resources; | ||
|
||
[assembly: RegisterAvailableModule("PataNext.Game.Client.Resources", "guerro", typeof(Module))] | ||
|
||
namespace PataNext.Game.Client.Resources | ||
{ | ||
public class Module : GameHostModule | ||
{ | ||
public Module(Entity source, Context ctxParent, GameHostModuleDescription description) : base(source, ctxParent, description) | ||
{ | ||
Console.WriteLine("Resources module loaded"); | ||
|
||
var global = new ContextBindingStrategy(ctxParent, true).Resolve<GlobalWorld>(); | ||
Storage.Subscribe((_,exteriorStorage) => | ||
{ | ||
var storage = exteriorStorage switch | ||
{ | ||
{} => new StorageCollection{exteriorStorage, DllStorage}, | ||
null => new StorageCollection {DllStorage} | ||
}; | ||
global.Context.BindExisting(new BgmContainerStorage(storage.GetOrCreateDirectoryAsync("Bgm").Result)); | ||
foreach (ref readonly var listener in global.World.Get<IListener>()) | ||
{ | ||
if (listener is SimulationApplication simulationApplication) | ||
simulationApplication.Data.Context.BindExisting(new BgmContainerStorage(storage.GetOrCreateDirectoryAsync("Bgm").Result)); | ||
} | ||
}, true); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters