static PostDefPatcher() { if (Prefs.DevMode) { Log.Message("==Patching in Runes to all ThingDefs=="); } //Patch all weapons and apparel. foreach (ThingDef thingDef in DefDatabase <ThingDef> .AllDefs) { if (RuneUtility.ValidRuneTargetDef(thingDef)) { if (!thingDef.comps.Any(props => props is CompProperties_Socket)) { thingDef.comps.Add(new CompProperties_Socket()); if (Prefs.DevMode) { Log.Message("Patched: '" + thingDef.defName + "'"); } } else { if (Prefs.DevMode) { Log.Message("[X] Already got 'CompProperties_Socket' the Def: '" + thingDef.defName + "'"); } } } } }
public static void Patch_Graphic_RandomRotated_DrawWorker(ref Graphic __instance, ref Vector3 loc, ref Rot4 rot, Thing thing, float extraRotation, float ___maxAngle) { float num = 0f; if (thing != null) { num = -___maxAngle + (float)(thing.thingIDNumber * 542) % (___maxAngle * 2f); } num += extraRotation; RuneUtility.DrawRuneAttachments(thing, ref loc, num, false, __instance, rot); }
public bool Validator(Thing thing) { //Log.Message("Validating: " + thing.LabelCap + ", result=" + RuneUtility.ValidRuneTargetDef(thing.def)); return(RuneUtility.ValidRuneTargetDef(thing.def)); }
public static void Patch_PawnRenderer_DrawEquipmentAiming(Thing eq, ref Vector3 drawLoc, float aimAngle) { RuneUtility.DrawRuneAttachments(eq, ref drawLoc, aimAngle); }
public static void Patch_Graphic_DrawWorker(ref Vector3 loc, Thing thing, float extraRotation) { RuneUtility.DrawRuneAttachments(thing, ref loc, extraRotation); }