UnlimitedHugs / RimworldHugsLib

A lightweight shared library for Rimworld modding.
Other
245 stars 59 forks source link

Documentation questions: switching from Harmony to HugsLib #47

Closed lilwhitemouse closed 5 years ago

lilwhitemouse commented 5 years ago

I have a project that currently uses Harmony. To start using HugsLib, are these reasonable steps I should take?

  1. Download HugsLib and add a reference from my project to HugsLib.dll
  2. Remove(?) reference in my project from Harmony.dll? 2a. Do I need to add a reference to the 0Harmony.dll in the HugsLib Assembly directory?
  3. Remove my HarmonyInstance.Create(...) call and? my PatchAll(...) call
  4. Remove 0Harmony.dll from my mod's Assembly/ folder
  5. Profit!

Oh,

  1. overriding ModIdentifier is required, correct? That's a string?
  2. Optionally add the checker assembly
UnlimitedHugs commented 5 years ago

1: You can either download the HugsLib assembly manually, or add a reference to the NuGet package for more convenience if you're using Visual Studio (link in the readme). 2, 3, 4: You can include your own Harmony assembly, but that's optional, since HL already comes with one included. If you use the NuGet package, HL's included Harmony will be automatically referenced- otherwise you'll need to download that, too, and reference it manually. Make sure "Copy local" is set to False in the assembly properties, so you don't ship an additional copy of Harmony with your mod.
HL will automatically find and apply any HarmonyPatch patches found in your assembly. 6: Yep, you should get a documentation popup for it that will list the valid characters for your identifier. 7: Also available on NuGet, or added maually- in which case "Copy local" should be True so that the checker assembly is included in your build.

lilwhitemouse commented 5 years ago

Thank you very much! I am up and running. The NuGet package is super useful to know about.

Any chance you would put this list (minus step 5, say ;) ) in the wiki? I'd make a pull request, but can't do that for documentation...for some reason. Thanks for the work for HugsLib!

UnlimitedHugs commented 5 years ago

A step-by-step wiki page is a good idea. I'll see if I can find some time to do that.

lilwhitemouse commented 5 years ago

I could write something if you would like?

UnlimitedHugs commented 5 years ago

Sure, why not. You would likely have a better perspective of the matter to highlight the important points. Also, I made a project template a while ago- if you want to dust it off and make it available for folks to use, that'd be great. The library, the updater and Harmony could be pulled directly from NuGet- I think templates do allow for that. HugsLib_template.zip