Exemple #1
0
        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));
        }
Exemple #2
0
 public virtual void EjectAllContents()
 {
     (AttackVerb as Verb_Bunker)?.ResetVerb();
     innerContainer.TryDropAll(Toils_bunker.GetEnterOutLoc(this), Map, ThingPlaceMode.Near);
 }