ResoniteSampleMod
A Mod for Resonite that just adds a "Hello World!" log entry whenever you click a button.
About this repository
This repository is a template everyone can copy from.
It includes automatic github workflows to test your code (Continuous Integration including linting and style checking) and a manually triggered release workflow to publish a new version.
Mods created using this template support two different mod loaders: ResoniteModLoader and MonkeyLoader
Using this Template
- Use this repository as a template (green button
Use this template/Create a new repository
on the top right)
- Inside the new repository go to the tab
Actions
and run the workflow Init Template
(You can specify user/mod names that differ from the repository.)
- After the action is finished, follow the instructions in the newly created Issue
Setup repository to support full CI/CD
(most likely #1 when reading this in your repository)
- On your local machine make sure that the environment variables
ResonitePath
(required) and ResoniteCache
(recommended) are set and that you have at least one mod loader installed.
- ???
- Happy coding!
Additional Notes:
- This template uses a shared project to reduce redundancies between the different mod loader variants.
(Using solution internal dependencies would cause multiple dll files to be output. To reduce the inconvenience for ResoniteModLoader users I chose this hacky workaround.)
Only open one of those projects at a time to avoid bugs with Visual Studio!
If you open multiple variants at a time you may encounter warning messages and cannot save changes to the csproj files!
Restarting Visual Studio makes sure that the error messages go away.
- You can freely add dependencies to your project. Shared dependencies should be added to the project SampleMod.csproj (without suffix!) to keep dependencies of the variants in sync.
- There are unit tests using the mod loader independent project.
- You can start Resonite directly from Visual Studio. The dll files/NuGet packages will be directly copied into the Resonite install.
If you add additional files you have to adjust the scripts in the files SampleModMonkey.csproj and SampleModRML.csproj.
The file
manifest-template.json
and the step Build
of workflow Build & Test (ResoniteModLoader)
need to be adjusted for proper release automation, too.
(TODO: hints for NuGet-based MonkeyLoader mods)
Publishing a new Mod Version
- Increment the <Version> number within the files
SampleMod.csproj
and Mod.RML/SampleModRML.cs
- Execute the github workflow
Create Release
Installation (ResoniteModLoader)
- Install ResoniteModLoader.
- Download release zip file and extract contents into Resonite directory. (e.g. rml_mods should be merged with rml_mods.)
- Start Resonite. (with
-LoadAssembly Libraries/ResoniteModLoader.dll
launch option)
Installation (MonkeyLoader)
(Work in Progress)
- ~Install MonkeyLoader.~
- ~Add package source "https://nuget.pkg.github.com/mpmxyz/index.json"~
- ~Add package "mpmxyz.SampleMod.MonkeyLoader"~
- ~Start Resonite.~