I'm confused because I've seen two widely different ways to apply patch:
and
Which one is the right way?
And it's very weird that these two seems cannot synergize through HarmonyPriority, in my test, if a patch is applied in the second way and at the top of modlist, it will ignore priority and always execute first.
Code Select
[StaticConstructorOnStartup]
public static class HarmonyInit
{
static HarmonyInit()
{
Harmony harmony = new Harmony("patch.id");
harmony.PatchAll();
}
}
and
Code Select
class ThisMod : Mod
{
public static Settings settings;
public ThisMod(ModContentPack content): base(content)
{
new Harmony("patch.id").PatchAll();
settings = GetSettings<Settings>();
}
public override string SettingsCategory()
{
// ...
}
public override void DoSettingsWindowContents(Rect canvas)
{
// ...
}
}
Which one is the right way?
And it's very weird that these two seems cannot synergize through HarmonyPriority, in my test, if a patch is applied in the second way and at the top of modlist, it will ignore priority and always execute first.