public static void Postfix(IntVec3 c, RoofDef def) { if (def == null) { DesignatorMoveBase.SetNoRoofFalse(c); } }
public static void Postfix(IntVec3 c, RoofDef def) { if (def == null && Current.ProgramState == ProgramState.Playing) { DesignatorMoveBase.SetNoRoofFalse(c); } }
public static void PostfixTryReplaceWithSolidThing(Thing createdThing) { if (createdThing is Building building && building.def.holdsRoof) { DesignatorMoveBase.RemoveBuildingFromCache(building); } }
public static void Postfix(Designation __instance) { if (__instance.def == MoveBaseDefOf.MoveBase && __instance.target.Thing != null) { DesignatorMoveBase.Notify_Removing_Callback(__instance.target.Thing); InstallBlueprintUtility.CancelBlueprintsFor(__instance.target.Thing); } }
public override void ExposeData() { if (Scribe.mode == LoadSaveMode.LoadingVars) { DesignatorMoveBase.ClearCache(); _lastUpdateTick = 0; } DesignatorMoveBase.ExposeData(); }
public static void DesignateThingPrefix(Designator __instance, Thing t) { if (__instance is Designator_Cancel cancel) { if (t.MapHeld.designationManager.DesignationOn(t, MoveBaseDefOf.MoveBase) != null) { DesignatorMoveBase.Notify_Removing_Callback(t); InstallBlueprintUtility.CancelBlueprintsFor(t); } } }
public static void DesignateSingleCellPrefix(Designator __instance, IntVec3 c) { if (__instance is Designator_Cancel cancel) { foreach (Thing thing in c.GetThingList(__instance.Map)) { if (thing.MapHeld.designationManager.DesignationOn(thing, MoveBaseDefOf.MoveBase) != null) { DesignatorMoveBase.Notify_Removing_Callback(thing); InstallBlueprintUtility.CancelBlueprintsFor(thing); } } } }
public override void GameComponentTick() { base.GameComponentTick(); if (_lastUpdateTick + UpdateInterval > Current.Game.tickManager.TicksGame) { return; } else { DesignatorMoveBase.PlaceWaitingBuildings(); _lastUpdateTick += UpdateInterval; PerfProfile.OutputLog(); } }
/// <summary> /// Postfix method. /// </summary> /// <param name="t"></param> /// <param name="forced"></param> /// <param name="__result"></param> public static void Postfix(Thing t, bool forced, ref Job __result) { if (t is Blueprint_Install install && install.MiniToInstallOrBuildingToReinstall is Building building && building.def.holdsRoof) { if (forced) { DesignatorMoveBase.AddBeingReinstalledBuilding(building); return; } if (building.MapHeld.designationManager.DesignationOn(building, MoveBaseDefOf.MoveBase) != null) { bool canRemove = true; HashSet <IntVec3> roofInRange = building.RoofInRange(); List <Building> buildingsBeingRemoved = DesignatorMoveBase.GetBuildingsBeingReinstalled(building).Concat(building).ToList(); foreach (IntVec3 roof in roofInRange) { if (!roof.IsSupported(building.MapHeld, buildingsBeingRemoved)) { building.MapHeld.areaManager.NoRoof[roof] = true; building.MapHeld.areaManager.BuildRoof[roof] = false; DesignatorMoveBase.AddToRoofToRemove(roof, building); canRemove = false; } } if (canRemove) { DesignatorMoveBase.AddBeingReinstalledBuilding(building); } else { __result = null; } } } }
public static void Postfix(JobDriver_Uninstall __instance) { DesignatorMoveBase.UninstallJobCallback((Building)_building.GetValue(__instance), __instance.pawn.MapHeld); }