Added stat caching, fixed all the bugs
Added RitualObligationTriggers analyzer category, Fixed defs from other mods with broken market value breaking fish's storage patches, Fixed storage caches not updating for quality, rotting and similar changes to stored things, Fixed storage caches not updating capacity when reinstalling storage, Fixed prison labor compatibility, Improved multiplayer compatibility, Fixed ideology style dominance and altar sharing patches throwing errors instead of defaulting to disabled when not having ideology, Fixed compatibility with RIMMSqol's world pawn GC patch by disabling that patch, Fixed rare threading issues throwing errors on startup
This commit is contained in:
@@ -12,4 +12,8 @@ public static class StaticEvents
|
||||
add => Cache.Utility.Cleared += value;
|
||||
remove => Cache.Utility.Cleared -= value;
|
||||
}
|
||||
|
||||
public static event Action? StaticConstructorOnStartupCalled;
|
||||
|
||||
internal static void OnStaticConstructorOnStartupCalled() => StaticConstructorOnStartupCalled?.Invoke();
|
||||
}
|
||||
@@ -11,7 +11,8 @@ public sealed class ThingEvents : ClassWithFishPrepatches
|
||||
{
|
||||
public static event Action<Thing>?
|
||||
Initialized,
|
||||
Destroyed;
|
||||
Destroyed,
|
||||
QualityChanging;
|
||||
|
||||
public sealed class Instanced
|
||||
{
|
||||
@@ -163,5 +164,20 @@ public sealed class ThingEvents : ClassWithFishPrepatches
|
||||
public static void Postfix(ThingWithComps __instance) => OnThingInitialized(__instance);
|
||||
}
|
||||
|
||||
public sealed class SetQualityPatch : FishPrepatch
|
||||
{
|
||||
public override bool ShowSettings => false;
|
||||
|
||||
public override MethodBase TargetMethodBase { get; }
|
||||
= AccessTools.DeclaredMethod(typeof(CompQuality), nameof(CompQuality.SetQuality));
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static void Prefix(CompQuality __instance, QualityCategory q)
|
||||
{
|
||||
if (q != __instance.qualityInt)
|
||||
QualityChanging?.Invoke(__instance.parent);
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnThingInitialized(Thing thing) => Initialized?.Invoke(thing);
|
||||
}
|
||||
Reference in New Issue
Block a user