/Boneject

A basic Ninject implementation and wrapper for BONELAB.

Primary LanguageC#MIT LicenseMIT

This project is now archived

This was causing some performance issues and I want to work on some actual projects rather than fixing this. As such, it is archived/deprecated until further notice.

Boneject

A BONELAB mod that provides a basic Ninject implementation and wrapper for use in the game. This can be useful for mods that do a lot of things with a lot of concrete dependencies; Ninject can manage those for you.

This project is still in active development, there are not as many locations as there could be. More will be added in time or as I need them. If you'd like to use Boneject in a location that it currently does not support, please DM me on Discord (Millzy#8418) and I can add it for you. Or if you prefer, open a PR to add it in on the GitHub repository.

This is installed, do I need it?

Probably! For the mods that do implement this, it will most likely be essential.

For Contributors

  1. Clone the project from the GitHub repository.
  2. Open Boneject.sln in your favourite IDE.
  3. Create a copy of Boneject.csproj.user.template and remove the .template suffix.
  4. In the same file, replace the comment between the <BonelabDir> tags with your BONELAB installation path. This will let Boneject build with your game's assemblies.
  5. Save the file.
  6. Make sure Ninject has been downloaded from Nuget.
  7. All set!

For Developers

If you are considering implementing Boneject in to your mod, by all means, give it a go! I found that after using a Dependency Injection framework for modding Unity games (at the time Zenject in BeatSaber) it is very tricky to go back afterwards.

Read the wiki to get started.

Credits

  • Auros - For creating SiraUtil, the inspiration for this project.
  • Danike - For creating BSIPA and it's Mod Init Injection system, that part of this project is based on.