예제 #1
0
        protected override void DoPawnsListing(Rect rect)
        {
            Listing_PawnsMenu listing_SlaveMenu = new Listing_PawnsMenu();

            listing_SlaveMenu.Begin(rect);
            listing_SlaveMenu.nestIndentWidth = 7f;
            listing_SlaveMenu.lineHeight      = 25;
            listing_SlaveMenu.verticalSpacing = 0f;
            slaveNodes.pawns.Clear();
            var slaves = this.colonistGroup.Map.mapPawns.AllPawnsSpawned.Where(x => x.RaceProps.Humanlike && x.IsSlaveOfColony && !x.Fogged());

            foreach (var pawn in slaves)
            {
                slaveNodes.pawns.Add(pawn);
            }
            listing_SlaveMenu.DoCategory(slaveNodes, 0, 32, true);
            listing_SlaveMenu.End();
            lastDrawnHeight = listing_SlaveMenu.CurHeight;
        }
예제 #2
0
        protected override void DoPawnsListing(Rect rect)
        {
            Listing_PawnsMenu listing_AnimalMenu = new Listing_PawnsMenu();

            listing_AnimalMenu.Begin(rect);
            listing_AnimalMenu.nestIndentWidth = 7f;
            listing_AnimalMenu.lineHeight      = 25;
            listing_AnimalMenu.verticalSpacing = 0f;

            var animals = this.colonistGroup.Map.mapPawns.SpawnedPawnsInFaction(Faction.OfPlayer).Where(x => x.RaceProps.Animal);

            foreach (var data in animalNodes)
            {
                data.Value.pawns?.Clear();
            }

            foreach (var pawn in animals)
            {
                if (animalNodes.ContainsKey(pawn.def))
                {
                    if (animalNodes[pawn.def].pawns is null)
                    {
                        animalNodes[pawn.def].pawns = new List <Pawn>();
                    }
                    animalNodes[pawn.def].pawns.Add(pawn);
                }
                else
                {
                    animalNodes[pawn.def] = new TreeNode_Pawns(new List <Pawn> {
                        pawn
                    }, pawn.def.LabelCap);
                }
            }

            foreach (var listing in animalNodes)
            {
                listing_AnimalMenu.DoCategory(listing.Value, 0, 32);
            }
            listing_AnimalMenu.End();
            lastDrawnHeight = listing_AnimalMenu.CurHeight;
        }
예제 #3
0
        protected override void DoPawnsListing(Rect rect)
        {
            Listing_PawnsMenu listing_GuestMenu = new Listing_PawnsMenu();

            listing_GuestMenu.Begin(rect);
            listing_GuestMenu.nestIndentWidth = 7f;
            listing_GuestMenu.lineHeight      = 25;
            listing_GuestMenu.verticalSpacing = 0f;

            var guests = this.colonistGroup.Map.mapPawns.AllPawnsSpawned.Where(x => x.RaceProps.Humanlike && !x.IsPrisoner && !x.Fogged() && x.Faction != null &&
                                                                               x.Faction != Faction.OfPlayer && !x.Faction.HostileTo(Faction.OfPlayer));

            foreach (var data in guestNodes)
            {
                data.Value.pawns?.Clear();
            }

            foreach (var pawn in guests)
            {
                if (guestNodes.ContainsKey(pawn.Faction.def))
                {
                    if (guestNodes[pawn.Faction.def].pawns is null)
                    {
                        guestNodes[pawn.Faction.def].pawns = new List <Pawn>();
                    }
                    guestNodes[pawn.Faction.def].pawns.Add(pawn);
                }
                else
                {
                    guestNodes[pawn.Faction.def] = new TreeNode_Pawns(new List <Pawn> {
                        pawn
                    }, pawn.Faction.def.LabelCap);
                }
            }
            foreach (var listing in guestNodes)
            {
                listing_GuestMenu.DoCategory(listing.Value, 0, 32);
            }
            listing_GuestMenu.End();
            lastDrawnHeight = listing_GuestMenu.CurHeight;
        }
예제 #4
0
        protected override void DoPawnsListing(Rect rect)
        {
            Listing_PawnsMenu listing_PrisonerMenu = new Listing_PawnsMenu();

            listing_PrisonerMenu.Begin(rect);
            listing_PrisonerMenu.nestIndentWidth = 7f;
            listing_PrisonerMenu.lineHeight      = 25;
            listing_PrisonerMenu.verticalSpacing = 0f;

            var prisoners = this.colonistGroup.Map.mapPawns.PrisonersOfColony;

            foreach (var data in prisonerNodes)
            {
                data.Value.pawns?.Clear();
            }

            foreach (var pawn in prisoners)
            {
                if (prisonerNodes.ContainsKey(pawn.guest.interactionMode))
                {
                    if (prisonerNodes[pawn.guest.interactionMode].pawns is null)
                    {
                        prisonerNodes[pawn.guest.interactionMode].pawns = new List <Pawn>();
                    }
                    prisonerNodes[pawn.guest.interactionMode].pawns.Add(pawn);
                }
                else
                {
                    prisonerNodes[pawn.guest.interactionMode] = new TreeNode_Pawns(new List <Pawn> {
                        pawn
                    }, pawn.guest.interactionMode.LabelCap);
                }
            }

            foreach (var listing in prisonerNodes)
            {
                listing_PrisonerMenu.DoCategory(listing.Value, 0, 32);
            }
            listing_PrisonerMenu.End();
            lastDrawnHeight = listing_PrisonerMenu.CurHeight;
        }