Esempio n. 1
0
        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 + "'");
                        }
                    }
                }
            }
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 public bool Validator(Thing thing)
 {
     //Log.Message("Validating: " + thing.LabelCap + ", result=" + RuneUtility.ValidRuneTargetDef(thing.def));
     return(RuneUtility.ValidRuneTargetDef(thing.def));
 }
Esempio n. 4
0
 public static void Patch_PawnRenderer_DrawEquipmentAiming(Thing eq, ref Vector3 drawLoc, float aimAngle)
 {
     RuneUtility.DrawRuneAttachments(eq, ref drawLoc, aimAngle);
 }
Esempio n. 5
0
 public static void Patch_Graphic_DrawWorker(ref Vector3 loc, Thing thing, float extraRotation)
 {
     RuneUtility.DrawRuneAttachments(thing, ref loc, extraRotation);
 }