private void SelectColonist() { var list = new List <FloatMenuOption>(); if (innerContainer.Count == 0) { return; } foreach (var pawn in innerContainer) { var postfix = new TaggedString(); if (pawn.equipment.Primary != null && pawn.equipment.Primary.def.IsRangedWeapon) { postfix = $" ({pawn.equipment.Primary.def.label})"; } var textToAdd = $"{pawn.NameFullColored}{postfix}"; var pawnToEject = pawn; list.Add(new FloatMenuOption(textToAdd, delegate { innerContainer.TryDrop(pawnToEject, Toils_bunker.GetEnterOutLoc(this), Map, ThingPlaceMode.Near, out _); }, MenuOptionPriority.Default, null, null, 29f)); } var sortedList = list.OrderBy(option => option.Label).ToList(); sortedList.Add(new FloatMenuOption("Everyone".Translate(), EjectAllContents, MenuOptionPriority.Default, null, null, 29f)); Find.WindowStack.Add(new FloatMenu(sortedList)); }
public override IEnumerable <FloatMenuOption> GetFloatMenuOptions(Pawn myPawn) { foreach (FloatMenuOption o in base.GetFloatMenuOptions(myPawn)) { yield return(o); } if (this.innerContainer.Count < maxCount) { if (Toils_bunker.getEnterOutLoc(this) == null)//!myPawn.CanReach(this, PathEndMode.InteractionCell, Danger.Deadly, false, TraverseMode.ByPawn)) { FloatMenuOption failer = new FloatMenuOption("CannotUseNoPath".Translate(), null, MenuOptionPriority.Default, null, null, 0f, null, null); yield return(failer); } else { JobDef jobDef = DefDatabase <JobDef> .GetNamed("EnterRa2Bunker", true); //JobDefOf.EnterCryptosleepCasket; string jobStr = "EnterRa2Bunker".Translate(); Action jobAction = delegate { Job job = new Job(jobDef, this); myPawn.jobs.TryTakeOrderedJob(job, JobTag.Misc); }; yield return(FloatMenuUtility.DecoratePrioritizedTask(new FloatMenuOption(jobStr, jobAction, MenuOptionPriority.Default, null, null, 0f, null, null), myPawn, this, "ReservedBy")); } } yield break; }
// Token: 0x060002E6 RID: 742 RVA: 0x0001C3FC File Offset: 0x0001A7FC protected override IEnumerable <Toil> MakeNewToils() { this.FailOnDespawnedOrNull(TargetIndex.A); yield return(Toils_bunker.GotoThing(TargetIndex.A, PathEndMode.ClosestTouch));//Toils_Goto.GotoThing(TargetIndex.A, PathEndMode.ClosestTouch); Toil enter = new Toil(); enter.initAction = delegate { Pawn actor = enter.actor; Building_Bunker pod = (Building_Bunker)actor.CurJob.targetA.Thing; Action action = delegate { if (pod.GetInner().InnerListForReading.Count >= pod.maxCount) { return; } actor.DeSpawn(DestroyMode.Vanish); pod.TryAcceptThing(actor, true); }; action(); }; enter.defaultCompleteMode = ToilCompleteMode.Instant; yield return(enter); yield break; }
public virtual void EjectAllContents() { (AttackVerb as Verb_Bunker)?.ResetVerb(); innerContainer.TryDropAll(Toils_bunker.GetEnterOutLoc(this), Map, ThingPlaceMode.Near); }
public virtual void EjectContents() { (this.AttackVerb as Verb_Bunker).resetVerb(); this.innerContainer.TryDropAll(Toils_bunker.getEnterOutLoc(this), base.Map, ThingPlaceMode.Near, null, null); }
public override void DrawGhost(ThingDef def, IntVec3 center, Rot4 rot, Color ghostCol, Thing thing = null) { Map currentMap = Find.CurrentMap; GenDraw.DrawFieldEdges(Toils_bunker.getAllEnterOutLoc(center), Color.magenta); }