Exemplo n.º 1
0
        public void SetPawnAndPod(Pawn pawn, Buildings_BarberPod Pod)
        {
            this.Pod                = Pod;
            this.Pawn               = pawn;
            this.PawnStartHairDef   = pawn.story.hairDef;
            this.CurrentHairColor   = pawn.story.hairColor;
            this.PawnStartHairColor = new Color(pawn.story.hairColor.r, pawn.story.hairColor.g, pawn.story.hairColor.b);
            this.PawnStartSkinColor = new Color(pawn.story.SkinColor.r, pawn.story.SkinColor.g, pawn.story.SkinColor.b);
            this.PawnStartBodyType  = pawn.story.bodyType;
            this.PawnStartTanValue  = pawn.story.melanin;

            this.PawnStartApp = new List <Apparel>();
            while (this.Pawn.apparel.WornApparelCount > 0)
            {
                this.PawnStartApp.Add(this.Pawn.apparel.WornApparel[0]);
                this.Pawn.apparel.Remove(this.Pawn.apparel.WornApparel[0]);
            }

            this.PawnStartHeadType = PS_HeadLoader.AllHeads.Where(x => x.TexturePath == this.Pawn.story.HeadGraphicPath).FirstOrDefault();
            FoundHeadType          = (this.PawnStartHeadType != null);
            if (!FoundHeadType)
            {
                Log.Warning("Unable to find pawn HeadType");
            }
            else
            {
                DebugLog(string.Format("Found pawn head type: {0}", this.PawnStartHeadType.FullName));
            }

            this.CurrentHeadType = this.PawnStartHeadType;
            UpdatePortrate();
        }
        public void StartBarbering(Buildings_BarberPod pod, Pawn pawn)
        {
            pawn.DeSpawn(DestroyMode.Vanish);
            pod.TryAcceptThing(pawn, true);

            var window = new PS_BarberPodPanel();

            window.SetPawnAndPod(pawn, pod);
            Find.WindowStack.Add(window);
        }
        protected override IEnumerable <Toil> MakeNewToils()
        {
            this.FailOnDespawnedOrNull(TargetIndex.A);
            yield return(Toils_Goto.GotoCell(TargetIndex.A, PathEndMode.InteractionCell));

            Toil openMissionSelect = new Toil();

            openMissionSelect.initAction = delegate()
            {
                Pawn actor = openMissionSelect.actor;
                Buildings_BarberPod pod = (Buildings_BarberPod)actor.jobs.curJob.GetTarget(TargetIndex.A).Thing;
                this.StartBarbering(pod, actor);
            };
            yield return(openMissionSelect);

            yield break;
        }