diff --git a/Languages/English/Keyed/AllKeyed_Other.xml b/Languages/English/Keyed/AllKeyed_Other.xml index be9ac022..cdfcea50 100644 --- a/Languages/English/Keyed/AllKeyed_Other.xml +++ b/Languages/English/Keyed/AllKeyed_Other.xml @@ -70,6 +70,7 @@ Activate the Lockdown for all drone stations on the map. Reactivate all Lift the Lockdown for all drone stations on the map. + {0}\nSelect Area Settings Toggle Jobs for this Drone Station diff --git a/Source/ProjectRimFactory/Drones/Building_DroneStation.cs b/Source/ProjectRimFactory/Drones/Building_DroneStation.cs index a2100b43..c23df72f 100644 --- a/Source/ProjectRimFactory/Drones/Building_DroneStation.cs +++ b/Source/ProjectRimFactory/Drones/Building_DroneStation.cs @@ -83,7 +83,9 @@ public class DroneAreaSelector : Designator public static Area SelectedArea => selectedArea; - + + + public override AcceptanceReport CanDesignateCell(IntVec3 loc) { return loc.InBounds(base.Map) && Designator_AreaAllowed.SelectedArea != null && !Designator_AreaAllowed.SelectedArea[loc]; @@ -224,9 +226,9 @@ public void Update_droneAllowedArea_forDrones(Area dr = null) { //Refresh the area droneAllowedArea = dr ?? (Area)GetDroneAllowedArea; - foreach (Pawn_Drone sdrone in spawnedDrones) + for (int i = 0; i < spawnedDrones.Count; i++) { - sdrone.playerSettings.AreaRestriction = droneAllowedArea; + spawnedDrones[i].playerSettings.AreaRestriction = droneAllowedArea; } } @@ -328,11 +330,22 @@ public override void SpawnSetup(Map map, bool respawningAfterLoad) GenSpawn.Spawn(drone, Position, Map); drone.Destroy(); } + //Init the Designator default Label + update_droneAreaSelectorLable(droneAllowedArea); + } - - - + private void update_droneAreaSelectorLable(Area a) + { + if (a == null) + { + droneAreaSelectorLable = "PRFDroneStationSelectArea".Translate("Unrestricted".Translate()); + } + else + { + droneAreaSelectorLable = "PRFDroneStationSelectArea".Translate(a.Label); + } } + public override void Draw() { base.Draw(); @@ -533,14 +546,7 @@ Holds example of how i want this Gizmo Implemented selectAction = (a) => { Update_droneAllowedArea_forDrones(a); - if (a == null) - { - droneAreaSelectorLable = "Unrestricted\nSelect Area"; - } - else - { - droneAreaSelectorLable = a.Label + "\nSelect Area"; - } + update_droneAreaSelectorLable(a); } };