UnlimitedHugs / RimworldHugsLib

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

Update to 1.1 #55

Closed diddily closed 4 years ago

diddily commented 4 years ago

Minimal changes I found necessary to get up and running with v1.1. There is certainly more work that can be done to improve against the new features of 1.1, but at least the existing features appear to work.

diddily commented 4 years ago

If nothing else this can be a starting point for the changes that need to be made in order to update.

UnlimitedHugs commented 4 years ago

Hey, that was a lot of work, and i appreciate it. 1.1 has caught me by surprise (as it has everyone else, it seems) so it'll be a few days for me to get my bearings and get out a working version. There are some breaking changes I have on the backlog, so this is a good opportunity. About the possible improvements you mentioned, I'd be happy to hear them, if you have something specific in mind.

diddily commented 4 years ago

No problem, I wanted to get something up and running so I could still work on my mods locally against 1.1 and figured it might help with the transition. Sounds like only Harmony saw this coming :).

The most obvious thing to adapt is taking the mod Id directly from the game instead of having a separate identifier for HugsLib (a pretty print name for the sake of logging could still exist).

HarmonyUtility.DescribeHarmonyVersions no longer needs a parameter as the function it calls is now static in Harmony 2.0, but I didn't want to touch that as it'd be breaking if called by another mod.

There are new fun mod support features such as versioning, load dependency/order, and hotlinking in game. Not sure if tying into these features are within your vision but for example it could be nice to be able to register dependencies programatically and have the download links come from the dependent mod (instead of the mod that defines the dependency as it is currently), though I suppose mods would still need to manually add HugsLib.

Let me know if there is anything else I can do to help. Also, if you need a (simple) test case that should be compatible with 1.1 and uses HugsLib I've updated my PowerAlerts mod on Github.

UnlimitedHugs commented 4 years ago

Good call on using the mod id from About.xml, I'll see what I can do about that. As for the new vanilla features, I'll have to look into those. In any case, I'll prioritize any API changes so I can get a release out quickly. Any new features we can add after that.