New common lib for WotR mods using Roslyn source generation aiming to automate some boilerplate.
Run the setup tool to set up a project with an empty, but functional, mod.
Most of the basic mod boilerplate is generated for you. You can see these files in Visual Studio by opening the nodes under Dependencies -> Analyzers -> MicroWrath.Generator
These are simple embedded source files that comprise the majority of the MicroWrath API. They are internal to your mod assembly so that changes to the core MicroWrath library are less likely to affect consumers.
Many of these files' are partial classes whose implementation is filled out by other source generators
TODO: explain what these are for
Contains static implementations for the BlueprintConstructor and ComponentConstructor classes
Generated Blueprint Name -> Blueprint Reference (MicroWrath.OwlcatBlueprint<TBlueprint>) mappings, grouped by blueprint type.
When you access properties under BlueprintsDb.Owlcat, those references are generated here.
Constructors for ConditionsChecker Conditions
Constructors for GameActions
Entries in guids.json generate properties here. Invocations of GeneratedGuid.Get will also generate properties if no entry is present. After build, the MicroWrath.Generator.GenerateGuidsFile task will run and save them to guids.json.
Contains a canonical implementation of the IMicroMod interface. If you provide your own implementation, this will not be generated.
string constants and static readonly fields and properties that are tagged with a LocalizedStringAttribute will cause members to be generated in the LocalizedStrings class. This class also adds these strings to the current LocalizationPack when Triggers.LocaleChanged fires (see below)
TODO
Methods tagged with this attribute will be executed immediately after the mod is loaded by UMM.
[Init]
static void Init()
{
// Initialization code here
}There are a few default Observables that fire on common entry points:
IObservable<Unit> Triggers.BlueprintsCache_Init_Prefix: Triggers before BlueprintsCache.Init
IObservable<Unit> Triggers.BlueprintsCache_Init: Triggers after BlueprintsCache.Init
IObservable<Unit> Triggers.BlueprintsCache_Init_Early: Triggers after BlueprintsCache.Init but before the previous event. Useful for eg. initializing settings
IObservable<Locale> Triggers.LocaleChanged: Triggers before LocalizationManager.OnLocaleChanged
TODO
