예제 #1
0
        //
        // Methods
        //
        public override void DoCell(Rect rect, Pawn pawn, PawnTable table)
        {
            // Allow robots to be assigned to any area
            AllowedAreaMode mode = AllowedAreaMode.Any;

            AreaAllowedGUI.DoAllowedAreaSelectors(rect, pawn, mode);
        }
예제 #2
0
 static void Postfix(Rect rect, Pawn pawn, PawnTable table)
 {
     if (pawn.IsPrisonerOfColony)
     {
         //Log.Message($"Pawn {pawn.LabelShort} area: {pawn.playerSettings.AreaRestriction}, is MouseBlocked: {Mouse.IsInputBlockedNow}");
         AreaAllowedGUI.DoAllowedAreaSelectors(rect, pawn);
     }
 }
예제 #3
0
 public override void DoCell(Rect rect, Pawn pawn, PawnTable table)
 {
     if (pawn.Faction != Faction.OfPlayer)
     {
         return;
     }
     AreaAllowedGUI.DoAllowedAreaSelectors(rect, pawn);
 }
예제 #4
0
        protected override void DrawPawnRow(Rect rect, Pawn p)
        {
            var pawn = (PawnConverted)p;

            GUI.BeginGroup(rect);
            float num = 175f;

            Rect rect7 = new Rect(num, 0f, WorkTypeWidth, rect.height);
            Rect rect8 = rect7.ContractedBy(2f);

            Text.Font = GameFont.Small;
            var workType = DefDatabase <WorkTypeDef> .GetNamed(pawn.WorkType);

            //if (workType!=null)
            {
                Widgets.Label(rect8, workType.pawnLabel);
            }
            num += WorkTypeWidth;

            Rect rect2 = new Rect(num, 0f, StayHomeWidth, rect.height);
            Rect rect3 = rect2.ContractedBy(2f);

            Text.Font = GameFont.Small;
            Widgets.LabelCheckbox(rect3, "StayHomeCheck".Translate(), ref pawn.stayHome, pawn.Crashed);
            num += StayHomeWidth;

            Rect rect4 = new Rect(num, 0f, FullRepairWidth, rect.height);
            Rect rect5 = rect4.ContractedBy(2f);

            Text.Font = GameFont.Small;
            Widgets.LabelCheckbox(rect5, "FullRepairCheck".Translate(), ref pawn.fullRepair, pawn.Crashed);
            num += FullRepairWidth;

            Rect rect6 = new Rect(num, 0f, AreaAllowedWidth, rect.height);

            AreaAllowedGUI.DoAllowedAreaSelectors(rect6, p, AllowedAreaMode.Humanlike);
            num += AreaAllowedWidth;

            GUI.EndGroup();
        }
예제 #5
0
        private void DoAreaRestriction(Listing_Standard listingStandard, CompGuest comp)
        {
            var areaRect = listingStandard.GetRect(24);

            if (SelPawn.playerSettings == null)
            {
                var savedArea = comp.GuestArea;
                SelPawn.playerSettings = new Pawn_PlayerSettings(SelPawn)
                {
                    AreaRestriction = savedArea
                };
            }

            var oldArea = SelPawn.playerSettings.AreaRestriction = comp.GuestArea;

            AreaAllowedGUI.DoAllowedAreaSelectors(areaRect, SelPawn, AllowedAreaMode.Humanlike);
            Text.Anchor = TextAnchor.UpperLeft;

            if (SelPawn.playerSettings.AreaRestriction != oldArea)
            {
                SetAreaRestriction(SelPawn.GetLord(), SelPawn.playerSettings.AreaRestriction);
            }
        }
        protected override void DrawPawnRow(Rect rect, Pawn p)
        {
            // sizes for stuff
            float x = 16f;

            float heightOffset = (rect.height - x) / 2;
            float widthOffset  = (50 - x) / 2;

            GUI.BeginGroup(rect);
            float num = 175f;

            if (p.training.IsCompleted(TrainableDefOf.Obedience))
            {
                Rect   rect2 = new Rect(num, 0f, 90f, rect.height);
                Rect   rect3 = rect2.ContractedBy(2f);
                string label = (p.playerSettings.master == null) ? "NoneLower".Translate() : p.playerSettings.master.LabelBaseShort;
                Text.Font = GameFont.Small;
                if (Widgets.TextButton(rect3, label))
                {
                    TrainableUtility.OpenMasterSelectMenu(p);
                }
            }
            num += 90f;

            Rect      recta    = new Rect(num + widthOffset, heightOffset, x, x);
            Texture2D labelSex = GenderTextures[(int)p.gender];
            TipSignal tipSex   = p.gender.ToString();

            GUI.DrawTexture(recta, labelSex);
            TooltipHandler.TipRegion(recta, tipSex);
            num += 50f;

            Rect      rectb    = new Rect(num + widthOffset, heightOffset, x, x);
            var       labelAge = p.RaceProps.lifeStageAges.Count > 3 ? LifeStageTextures[3] : LifeStageTextures[p.ageTracker.CurLifeStageIndex];
            TipSignal tipAge   = p.ageTracker.CurLifeStage.LabelCap + ", " + p.ageTracker.AgeBiologicalYears;

            GUI.DrawTexture(rectb, labelAge);
            TooltipHandler.TipRegion(rectb, tipAge);
            num += 50f;

            Rect rectc     = new Rect(num, 0f, 50f, 30f);
            Rect rectc1    = new Rect(num + 17f, heightOffset, x, x);
            bool slaughter = Find.DesignationManager.DesignationOn(p, DesignationDefOf.Slaughter) != null;

            if (slaughter)
            {
                GUI.DrawTexture(rectc1, WorkBoxCheckTex);
                TooltipHandler.TipRegion(rectc, "Fluffy.StopSlaughter".Translate());
            }
            else
            {
                TooltipHandler.TipRegion(rectc, "Fluffy.MarkSlaughter".Translate());
            }
            if (Widgets.InvisibleButton(rectc))
            {
                if (slaughter)
                {
                    Widgets_Animals.UnSlaughterAnimal(p);
                    SoundDefOf.CheckboxTurnedOff.PlayOneShotOnCamera();
                }
                else
                {
                    Widgets_Animals.SlaughterAnimal(p);
                    SoundDefOf.CheckboxTurnedOn.PlayOneShotOnCamera();
                }
            }
            if (Mouse.IsOver(rectc))
            {
                GUI.DrawTexture(rectc1, TexUI.HighlightTex);
            }

            num += 50f;

            Rect trainingRect = new Rect(num, 0f, 80f, 30f);

            Widgets_Animals.DoTrainingRow(trainingRect, p);

            num += 90f;

            Rect rect4 = new Rect(num, 0f, 350f, rect.height);

            AreaAllowedGUI.DoAllowedAreaSelectors(rect4, p, AllowedAreaMode.Animal);
            GUI.EndGroup();
        }