using RimWorld; using UnityEngine; using Verse; namespace BlaxZones { /// /// Package Designators. "Delivery zone" in the Zone menu, dragged like a stockpile. Inserted after /// Designator_ZoneAdd_Growing by Patches/BlaxZones_Designators.xml (a namespace-qualified /// PatchOperationInsert; anchor on Growing, because the Fishing entry carries MayRequire Odyssey). /// Visible reads BlaxZonesSettings.deliveryZones live. /// /// Subclasses Designator_ZoneAdd directly, never Designator_ZoneAddStockpile, so Blax Defaults' /// stockpile hook never reaches it. Designator_ZoneAdd compares the exact zone type and refuses /// cells in other zones (Designator_ZoneAdd.cs:46, 73, 114, 127), and DesignateMultiCell drops /// every cell that already has a zone (Designator_ZoneAdd.cs:142), so expanding only adds cells. /// public class Designator_ZoneAdd_Delivery : Designator_ZoneAdd { public const string IconPath = "UI/Designators/ZoneCreate_Stockpile"; /// The tooltip; mentions the 4-cell home area growth (AutoHomeAreaMaker.cs:48-58). public const string DescKey = "BlaxZones_DesignatorDeliveryZoneDesc"; public const string TutorTag = "ZoneAdd_Delivery"; protected override string NewZoneLabel => "BlaxZones_DeliveryZone".Translate(); /// Read live by GizmoGridDrawer (Gizmo.cs:31, GizmoGridDrawer.cs:265), so the toggle needs no restart. public override bool Visible => BlaxZonesMod.S.deliveryZones; public Designator_ZoneAdd_Delivery() { zoneTypeToPlace = typeof(Zone_Delivery); defaultLabel = "BlaxZones_DeliveryZone".Translate(); defaultDesc = DescKey.Translate(); icon = ContentFinder.Get(IconPath); defaultIconColor = Zone_Delivery.IconColor; tutorTag = TutorTag; // Dragged like a stockpile (Designator_ZoneAdd.cs:36-38, Designator_ZoneAddStockpile.cs:37). soundDragSustain = SoundDefOf.Designate_DragAreaAdd; soundDragChanged = SoundDefOf.Designate_DragZone_Changed; soundSucceeded = SoundDefOf.Designate_ZoneAdd_Stockpile; } protected override Zone MakeNewZone() => new Zone_Delivery(Find.CurrentMap.zoneManager); } /// Package Designators. The expand gizmo of a selected delivery zone; only adds new cells. public class Designator_ZoneAdd_Delivery_Expand : Designator_ZoneAdd_Delivery { public Designator_ZoneAdd_Delivery_Expand() { defaultLabel = "DesignatorZoneExpand".Translate(); hotKey = KeyBindingDefOf.Misc6; } } }