Пример #1
0
        public override void DoWindowContents(Rect rect)
        {
            base.DoWindowContents(rect);
            Vector2 zero          = Vector2.zero;
            Rect    groupNameRect = new Rect(zero.x, zero.y + 20f, rect.width, 30f);

            Text.Anchor = TextAnchor.MiddleCenter;
            var font = Text.Font;

            Text.Font = GameFont.Medium;
            Widgets.Label(groupNameRect, this.colonistGroup.curGroupName);
            Text.Font   = font;
            Text.Anchor = TextAnchor.UpperLeft;
            zero       += InitialFloatOptionPositionShift;
            for (int i = 0; i < options.Count; i++)
            {
                TieredFloatMenuOption floatMenuOption = options[i];
                Rect rect2 = new Rect(zero.x, zero.y, (this.backgroundTexture.width - InitialFloatOptionPositionShift.x) / 1.2f, floatMenuOption.curIcon.height);
                if (floatMenuOption.DoGUI(rect2, this))
                {
                    Find.WindowStack.TryRemove(this);
                    break;
                }
                zero.y += floatMenuOption.bottomIndent;
            }
            DrawExtraGui(rect);
            GUI.color = Color.white;
        }
Пример #2
0
        public override void DoWindowContents(Rect rect)
        {
            base.DoWindowContents(rect);
            Vector2 zero = Vector2.zero;

            zero += InitialFloatOptionPositionShift;
            for (int i = 0; i < options.Count; i++)
            {
                TieredFloatMenuOption floatMenuOption = options[i];
                Rect rect2 = new Rect(zero.x, zero.y, floatMenuOption.curIcon.width, floatMenuOption.curIcon.height);
                if (floatMenuOption.DoGUI(rect2, this))
                {
                    Find.WindowStack.TryRemove(this);
                    break;
                }
                zero.y += floatMenuOption.bottomIndent;
            }
            DrawExtraGui(rect);
            GUI.color = Color.white;
        }
Пример #3
0
        public override void DoWindowContents(Rect rect)
        {
            base.DoWindowContents(rect);
            Vector2 zero = Vector2.zero;

            zero += InitialFloatOptionPositionShift;
            for (int i = 0; i < options.Count; i++)
            {
                TieredFloatMenuOption floatMenuOption = options[i];
                Rect rect2 = new Rect(zero.x, zero.y, (this.backgroundTexture.width - InitialFloatOptionPositionShift.x) / 1.2f, floatMenuOption.curIcon.height);
                if (floatMenuOption.DoGUI(rect2, this))
                {
                    Find.WindowStack.TryRemove(this);
                    break;
                }
                zero.y += floatMenuOption.bottomIndent;
            }

            var pawnBox = new Rect(rect.x + 10f, rect.y + 23f, 130f, 180f);

            GUI.DrawTexture(pawnBox, PortraitsCache.Get(pawn, pawnBox.size, Rot4.South, PawnTextureCameraOffset, 1.15f));
            Widgets.InfoCardButton(pawnBox.x + pawnBox.width - 18f, pawnBox.x + pawnBox.height - 23f, pawn);
            Text.Anchor = TextAnchor.MiddleLeft;

            //var pawnTabsRect = new Rect(pawnBox.x, pawnBox.yMax + 10, 120, 120);
            //Widgets.DrawBox(pawnTabsRect);

            //MainTabWindow_Inspect mainTabWindow_Inspect = (MainTabWindow_Inspect)MainButtonDefOf.Inspect.TabWindow;
            //
            //TacticInspectPaneUtility.UpdateTabs(mainTabWindow_Inspect);

            var armorValue = pawn.apparel.WornApparel != null?TacticUtils.OverallArmorValue(pawn) : 0f;

            var armorValueLabel = new Rect(pawnBox.xMax + 5, pawnBox.y, 27, 26);

            Widgets.Label(armorValueLabel, armorValue.ToStringDecimalIfSmall());
            var armorValueRect = new Rect(armorValueLabel.xMax, pawnBox.y, Textures.CrossHairs.width, Textures.CrossHairs.height);

            GUI.DrawTexture(armorValueRect, Textures.ArmorIcon);


            var dpsValue = pawn.equipment.Primary != null?TacticUtils.WeaponScoreGain(pawn.equipment.Primary) : pawn.GetStatValue(StatDefOf.MeleeDPS);

            var dpsValueLabel = new Rect(pawnBox.xMax + 5, armorValueLabel.yMax, 27, 26);

            Widgets.Label(dpsValueLabel, dpsValue.ToStringDecimalIfSmall());
            var dpsValueRect = new Rect(dpsValueLabel.xMax, dpsValueLabel.y, Textures.CrossHairs.width, Textures.CrossHairs.height);

            GUI.DrawTexture(dpsValueRect, Textures.CrossHairs);
            var pawnInfoRect = new Rect(dpsValueRect.xMax - 30, rect.y + 90f, rect.width - 170f, rect.height - 110f);

            TacticCharacterCardUtility.DrawCharacterCard(pawnInfoRect, pawn, null, rect);

            Text.Anchor = TextAnchor.MiddleCenter;

            var moodTexture = GetMoodTexture(out string moodLabel);
            var moodRect    = new Rect(rect.x + 425f, rect.y + 90, moodTexture.width, moodTexture.height);

            GUI.DrawTexture(moodRect, moodTexture);
            var moodLabelRect = new Rect(moodRect.x, moodRect.y + moodTexture.height, 45, 24);

            Widgets.Label(moodLabelRect, moodLabel);
            TooltipHandler.TipRegion(moodRect, Strings.MoodIconTooltip);

            var healthTexture = GetHealthTexture(out string healthPercent);
            var healthRect    = new Rect(moodRect.x + 45f, moodRect.y, healthTexture.width, healthTexture.height);

            GUI.DrawTexture(healthRect, healthTexture);
            var healthLabelRect = new Rect(healthRect.x, healthRect.y + healthRect.height, 40, 24);

            Widgets.Label(healthLabelRect, healthPercent);
            TooltipHandler.TipRegion(healthRect, Strings.HealthIconTooltip);

            var restTexture = GetRestTexture(out string restPercent);
            var restRect    = new Rect(healthRect.x + 45f, healthRect.y, restTexture.width, restTexture.height);

            GUI.DrawTexture(restRect, restTexture);
            var restLabelRect = new Rect(restRect.x, restRect.y + restRect.height, 40, 24);

            Widgets.Label(restLabelRect, restPercent);
            TooltipHandler.TipRegion(restRect, Strings.RestIconTooltip);

            var foodTexture  = GetFoodTexture(out string foodPercent);
            var foodStatRect = new Rect(restRect.x + 45f, restRect.y, foodTexture.width, foodTexture.height);

            GUI.DrawTexture(foodStatRect, foodTexture);
            var foodLabelRect = new Rect(foodStatRect.x, foodStatRect.y + foodStatRect.height, 40, 24);

            Widgets.Label(foodLabelRect, foodPercent);
            TooltipHandler.TipRegion(foodStatRect, Strings.HungerIconTooltip);

            var needRect = new Rect(moodRect.x - 5f, moodLabelRect.yMax, 180f, rect.height - 160);

            TacticNeedsCardUtility.DoNeeds(needRect, pawn);

            GUI.color   = Color.white;
            Text.Anchor = TextAnchor.UpperLeft;

            var skillRect = new Rect(needRect.xMax + 10, moodRect.y - 1f, 164, rect.height - 110);

            TacticSkillUI.DrawSkillsOf(pawn, new Vector2(skillRect.x, skillRect.y), TacticSkillUI.SkillDrawMode.Gameplay);
        }
Пример #4
0
        public override void DoWindowContents(Rect rect)
        {
            base.DoWindowContents(rect);
            Vector2 zero = Vector2.zero;

            zero += InitialFloatOptionPositionShift;
            for (int i = 0; i < options.Count; i++)
            {
                TieredFloatMenuOption floatMenuOption = options[i];
                Rect rect2 = new Rect(zero.x, zero.y, (this.backgroundTexture.width - InitialFloatOptionPositionShift.x) / 1.2f, floatMenuOption.curIcon.height);
                if (floatMenuOption.DoGUI(rect2, this))
                {
                    Find.WindowStack.TryRemove(this);
                    break;
                }
                zero.y += floatMenuOption.bottomIndent;
            }

            var rect3    = new Rect(rect.x + zero.x, rect.y + 75f, rect.width, rect.height);
            var iconRows = GetWorkIconRows(2);

            for (var i = 0; i < iconRows.Count; i++)
            {
                for (var j = 0; j < iconRows[i].Count; j++)
                {
                    Rect iconRect = new Rect(rect3.x + (j * iconRows[i][j].width) + j * 10, rect3.y + (i * iconRows[i][j].height) + i * 7,
                                             iconRows[i][j].width, iconRows[i][j].height);
                    GUI.DrawTexture(iconRect, iconRows[i][j]);
                    if (this.colonistGroup.activeWorkTypes.TryGetValue(workIconStates[iconRows[i][j]], out WorkState state2))
                    {
                        if (state2 == WorkState.Active)
                        {
                            GUI.DrawTexture(iconRect, Textures.Clock);
                        }
                        else if (state2 == WorkState.ForcedLabor)
                        {
                            GUI.DrawTexture(iconRect, Textures.ClockSlave);
                        }
                    }
                    TooltipHandler.TipRegion(iconRect, tooltips[iconRows[i][j]] + "\n" + Strings.ForcedLaborTooltip);
                    if (Mouse.IsOver(iconRect))
                    {
                        GUI.DrawTexture(iconRect, Textures.WorkButtonHover);
                        if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 1)
                        {
                            this.colonistGroup.RemoveWorkState(workIconStates[iconRows[i][j]]);
                            TacticDefOf.TG_WorkSFX.PlayOneShotOnCamera();
                            WorkSearchUtility.SearchForWork(workIconStates[iconRows[i][j]], this.colonistGroup.ActivePawns);
                            Event.current.Use();
                        }
                        else if (Event.current.type == EventType.MouseDown && Event.current.button == 1 && Event.current.clickCount == 1)
                        {
                            this.colonistGroup.ChangeWorkState(workIconStates[iconRows[i][j]]);
                            if (this.colonistGroup.activeWorkTypes[workIconStates[iconRows[i][j]]] == WorkState.ForcedLabor)
                            {
                                TacticDefOf.TG_SlaveLaborSFX.PlayOneShotOnCamera();
                            }
                            else
                            {
                                TacticDefOf.TG_ClickSFX.PlayOneShotOnCamera();
                            }
                            WorkSearchUtility.SearchForWork(workIconStates[iconRows[i][j]], this.colonistGroup.ActivePawns);
                            Event.current.Use();
                        }
                    }
                }
            }

            var rect4     = new Rect(rect.x + zero.x, rect.y + 475f, rect.width, rect.height);
            var iconRows2 = GetBreakIconRows(2);

            for (var i = 0; i < iconRows2.Count; i++)
            {
                for (var j = 0; j < iconRows2[i].Count; j++)
                {
                    Rect iconRect = new Rect(rect4.x + (j * iconRows2[i][j].width) + j * 10, rect4.y + (i * iconRows2[i][j].height) + i * 7,
                                             iconRows2[i][j].width, iconRows2[i][j].height);
                    GUI.DrawTexture(iconRect, iconRows2[i][j]);
                    TooltipHandler.TipRegion(iconRect, tooltips[iconRows2[i][j]]);

                    if (Mouse.IsOver(iconRect))
                    {
                        GUI.DrawTexture(iconRect, Textures.WorkButtonHover);
                        if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 1)
                        {
                            if (breakIconStates[iconRows2[i][j]] == BreakType.LightsOut)
                            {
                                TacticDefOf.TG_LightsOutSFX.PlayOneShotOnCamera();
                            }
                            else if (breakIconStates[iconRows2[i][j]] == BreakType.ChowHall)
                            {
                                TacticDefOf.TG_ChowTimeSFX.PlayOneShotOnCamera();
                            }
                            WorkSearchUtility.TakeABreak(breakIconStates[iconRows2[i][j]], this.colonistGroup.ActivePawns);
                            Event.current.Use();
                        }
                    }
                }
            }

            var workRows     = GetWorkTypeRows(2);
            var initialRect  = new Rect((rect.x + rect.width) - 245, rect.y + 75, 240, rect.height - 95);
            var workMenuRect = new Rect(initialRect);

            workMenuRect.height -= 103;

            DoManualPrioritiesCheckbox(new Rect(workMenuRect.x, rect.y + 30, workMenuRect.width, 40));
            float listHeight = workRows.Count * 33 + (workRows.Count * 2);
            Rect  rect5      = new Rect(0f, 0f, workMenuRect.width - 16f, listHeight);

            Widgets.BeginScrollView(workMenuRect, ref scrollPosition, rect5);

            for (var i = 0; i < workRows.Count; i++)
            {
                for (var j = 0; j < workRows[i].Count; j++)
                {
                    Rect workRect = new Rect(rect5.x + (j * 20) + j * 91.5f, rect5.y + (i * 17) + i * 17, 24, 24);
                    this.DoWorkCell(workRect, workRows[i][j]);
                    this.DoWorkHeader(workRect, workRows[i][j]);
                }
            }
            Widgets.EndScrollView();
            DrawExtraGui(rect);


            var caravanButtonRect = new Rect(initialRect.x + 155, rect.y + 23, Textures.CaravanButton.width, Textures.CaravanButton.height);

            GUI.DrawTexture(caravanButtonRect, Textures.CaravanButton);
            if (Mouse.IsOver(caravanButtonRect))
            {
                GUI.DrawTexture(caravanButtonRect, Textures.CaravanHover);
                if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 1)
                {
                    TacticDefOf.TG_WorkSFX.PlayOneShotOnCamera();

                    var floatMenu = new CaravanMenu(this, this.colonistGroup, this.windowRect, Textures.CaravanMenu);
                    this.OpenNewMenu(floatMenu);
                    Event.current.Use();
                }
            }


            var researchWorkRect = new Rect(rect.x + 253, rect.y + 459, Textures.ResearchWorkButton.width, Textures.ResearchWorkButton.height);

            GUI.DrawTexture(researchWorkRect, Textures.ResearchWorkButton);
            if (this.colonistGroup.activeWorkTypes.TryGetValue(WorkType.Research, out WorkState state))
            {
                if (state == WorkState.Active)
                {
                    GUI.DrawTexture(researchWorkRect, Textures.Clock, ScaleMode.ScaleToFit);
                }
                else if (state == WorkState.ForcedLabor)
                {
                    GUI.DrawTexture(researchWorkRect, Textures.ClockSlave, ScaleMode.ScaleToFit);
                }
            }

            Text.Anchor = TextAnchor.MiddleCenter;
            var researchLabel = new Rect(researchWorkRect.x + 30, researchWorkRect.y - 25, 80, 24);

            Widgets.Label(researchLabel, Strings.WorkTaskTooltipResearch);
            Text.Anchor = TextAnchor.UpperLeft;

            TooltipHandler.TipRegion(researchWorkRect, Strings.WorkTaskTooltipResearch + "\n" + Strings.ForcedLaborTooltip);
            if (Mouse.IsOver(researchWorkRect))
            {
                GUI.DrawTexture(researchWorkRect, Textures.ResearchHover);
                if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 1)
                {
                    TacticDefOf.TG_ResearchSFX.PlayOneShotOnCamera();
                    this.colonistGroup.RemoveWorkState(WorkType.Research);
                    WorkSearchUtility.SearchForWork(WorkType.Research, this.colonistGroup.ActivePawns);
                    Event.current.Use();
                }
                else if (Event.current.type == EventType.MouseDown && Event.current.button == 1 && Event.current.clickCount == 1)
                {
                    TacticDefOf.TG_ClickSFX.PlayOneShotOnCamera();
                    this.colonistGroup.ChangeWorkState(WorkType.Research);
                    WorkSearchUtility.SearchForWork(WorkType.Research, this.colonistGroup.ActivePawns);
                    Event.current.Use();
                }
            }
            var researchMenuRect = new Rect(researchWorkRect.x + 89, researchWorkRect.y, Textures.ResearchMenuButton.width, Textures.ResearchMenuButton.height);

            GUI.DrawTexture(researchMenuRect, Textures.ResearchMenuButton);
            if (Mouse.IsOver(researchMenuRect))
            {
                GUI.DrawTexture(researchMenuRect, Textures.ResearchHover);
                if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 1)
                {
                    TacticDefOf.TG_ClickSFX.PlayOneShotOnCamera();
                    Find.MainTabsRoot.ToggleTab(MainButtonDefOf.Research);
                    Event.current.Use();
                }
            }
            TooltipHandler.TipRegion(researchMenuRect, Strings.WorkTaskTooltipResearchMenu);
            GUI.color = Color.white;
        }
Пример #5
0
        public override void DoWindowContents(Rect rect)
        {
            base.DoWindowContents(rect);
            Vector2 zero = Vector2.zero;

            zero += InitialFloatOptionPositionShift;
            for (int i = 0; i < options.Count; i++)
            {
                TieredFloatMenuOption floatMenuOption = options[i];
                Rect rect2 = new Rect(zero.x, zero.y, (this.backgroundTexture.width - InitialFloatOptionPositionShift.x) / 1.2f, floatMenuOption.curIcon.height);
                if (floatMenuOption.DoGUI(rect2, this))
                {
                    Find.WindowStack.TryRemove(this);
                    break;
                }
                zero.y += floatMenuOption.bottomIndent;
            }

            var getBreakIconRect = new Rect(rect.x + zero.x, rect.y + 475f, rect.width, rect.height);
            var iconRows         = GetBreakIconRows(2);

            for (var i = 0; i < iconRows.Count; i++)
            {
                for (var j = 0; j < iconRows[i].Count; j++)
                {
                    Rect iconRect = new Rect(getBreakIconRect.x + (j * iconRows[i][j].width) + j * 10, getBreakIconRect.y + (i * iconRows[i][j].height) + i * 7,
                                             iconRows[i][j].width, iconRows[i][j].height);
                    GUI.DrawTexture(iconRect, iconRows[i][j]);
                    TooltipHandler.TipRegion(iconRect, tooltips[iconRows[i][j]]);

                    if (Mouse.IsOver(iconRect))
                    {
                        GUI.DrawTexture(iconRect, Textures.WorkButtonHover);
                        if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 1)
                        {
                            if (breakIconStates[iconRows[i][j]] == BreakType.LightsOut)
                            {
                                TacticDefOf.TG_LightsOutSFX.PlayOneShotOnCamera();
                            }
                            else if (breakIconStates[iconRows[i][j]] == BreakType.ChowHall)
                            {
                                TacticDefOf.TG_ChowTimeSFX.PlayOneShotOnCamera();
                            }
                            WorkSearchUtility.TakeABreak(breakIconStates[iconRows[i][j]], this.colonistGroup.ActivePawns);
                            Event.current.Use();
                        }
                    }
                }
            }

            var workRows     = GetWorkTypeRows(2);
            var initialRect  = new Rect(rect.x, rect.y + 75, 320, rect.height - 95);
            var workMenuRect = new Rect(initialRect);

            workMenuRect.height -= 103;
            var resetWorkPriorities = new Rect(workMenuRect.x + 20, rect.y + 32, Textures.ResetIcon.width, Textures.ResetIcon.height);

            GUI.DrawTexture(resetWorkPriorities, Textures.ResetIcon);
            if (Mouse.IsOver(resetWorkPriorities))
            {
                if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 1)
                {
                    this.colonistGroup.groupWorkPriorities?.Clear();
                    Event.current.Use();
                }
                TooltipHandler.TipRegion(resetWorkPriorities, Strings.GroupWorkPrioritiesReset);
            }

            var manualPrioritiesRect = new Rect(resetWorkPriorities.xMax + 10, rect.y + 30, 162, 40);

            DoManualPrioritiesCheckbox(manualPrioritiesRect);
            float listHeight   = workRows.Count * 33 + (workRows.Count * 2);
            Rect  workCellRect = new Rect(0f, 0f, workMenuRect.width - 16f, listHeight);

            Widgets.BeginScrollView(workMenuRect, ref scrollPosition, workCellRect);

            for (var i = 0; i < workRows.Count; i++)
            {
                for (var j = 0; j < workRows[i].Count; j++)
                {
                    Rect      workTypeRect = new Rect(workCellRect.x + (j * 72) + (j * 72) + 17.5f, (workCellRect.y + (i * 17) + (i * 17)) + 8, Textures.WorkSelectEmpty.width, Textures.WorkSelectEmpty.height);
                    var       workDictData = this.colonistGroup.activeWorkTypes.FirstOrDefault(x => x.Key.workTypeDef == workRows[i][j]);
                    WorkState workState;
                    if (workDictData.Key != null)
                    {
                        workState = workDictData.Value;
                    }
                    else
                    {
                        workState = WorkState.Inactive;
                    }

                    switch (workState)
                    {
                    case WorkState.Temporary:
                    case WorkState.Inactive:
                        GUI.DrawTexture(workTypeRect, Textures.WorkSelectEmpty);
                        TooltipHandler.TipRegion(workTypeRect, Strings.WorkTypeLeftClickToApply);
                        break;

                    case WorkState.Active:
                        GUI.DrawTexture(workTypeRect, Textures.WorkSelectBlue);
                        TooltipHandler.TipRegion(workTypeRect, Strings.WorkTypeForcedLabor);
                        break;

                    case WorkState.ForcedLabor:
                        GUI.DrawTexture(workTypeRect, Textures.WorkSelectRed);
                        TooltipHandler.TipRegion(workTypeRect, Strings.WorkTypeSlaveLabor);
                        break;
                    }

                    if (Mouse.IsOver(workTypeRect))
                    {
                        if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 1)
                        {
                            WorkSearchUtility.SearchForWork(workRows[i][j], this.colonistGroup.pawns);
                            this.colonistGroup.ChangeWorkState(workRows[i][j]);
                            Event.current.Use();
                        }
                    }
                    Rect workRect = new Rect(workTypeRect.xMax + 5, workTypeRect.y - 8, 24, 24);
                    this.DoWorkCell(workRect, workRows[i][j]);
                    this.DoWorkHeader(workRect, workRows[i][j]);
                }
            }
            Widgets.EndScrollView();
            DrawExtraGui(rect);

            var caravanButtonRect = new Rect(manualPrioritiesRect.xMax + 5, rect.y + 23, Textures.CaravanButton.width, Textures.CaravanButton.height);

            GUI.DrawTexture(caravanButtonRect, Textures.CaravanButton);
            if (Mouse.IsOver(caravanButtonRect))
            {
                GUI.DrawTexture(caravanButtonRect, Textures.CaravanHover);
                if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 1)
                {
                    TacticDefOf.TG_WorkSFX.PlayOneShotOnCamera();

                    var floatMenu = new CaravanMenu(this, this.colonistGroup, this.windowRect, Textures.CaravanMenu);
                    this.OpenNewMenu(floatMenu);
                    Event.current.Use();
                }
            }


            var researchMenuRect = new Rect(rect.x + 253, rect.y + 459, Textures.ResearchWorkButton.width, Textures.ResearchWorkButton.height);

            GUI.DrawTexture(researchMenuRect, Textures.ResearchMenuButton);
            if (Mouse.IsOver(researchMenuRect))
            {
                GUI.DrawTexture(researchMenuRect, Textures.ResearchHover);
                if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 1)
                {
                    TacticDefOf.TG_ClickSFX.PlayOneShotOnCamera();
                    Find.MainTabsRoot.ToggleTab(MainButtonDefOf.Research);
                    Event.current.Use();
                }
            }
            TooltipHandler.TipRegion(researchMenuRect, Strings.WorkTaskTooltipResearchMenu);
            GUI.color = Color.white;
        }
Пример #6
0
        public override void DoWindowContents(Rect rect)
        {
            base.DoWindowContents(rect);
            Vector2 zero = Vector2.zero;

            zero += InitialFloatOptionPositionShift;
            for (int i = 0; i < options.Count; i++)
            {
                TieredFloatMenuOption floatMenuOption = options[i];
                Rect rect2 = new Rect(zero.x, zero.y, (this.backgroundTexture.width - InitialFloatOptionPositionShift.x) / 1.2f, floatMenuOption.curIcon.height);
                if (floatMenuOption.DoGUI(rect2, this))
                {
                    Find.WindowStack.TryRemove(this);
                    break;
                }
                zero.y += floatMenuOption.bottomIndent;
            }
            DrawExtraGui(rect);

            var captureRect = new Rect(rect.x + 27, zero.y + 5, Textures.Arrest.width, Textures.Arrest.height);

            GUI.DrawTexture(captureRect, Textures.Arrest);
            TooltipHandler.TipRegion(captureRect, Strings.CaptureTooltip);
            if (Mouse.IsOver(captureRect))
            {
                GUI.DrawTexture(captureRect, Textures.RescueTendHover);
                if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 1)
                {
                    var victims = this.colonistGroup.Map.mapPawns.AllPawns.Where(x => x.RaceProps.Humanlike).ToList();;
                    foreach (var pawn in this.colonistGroup.ActivePawns)
                    {
                        if (!pawn.Dead && !pawn.Downed && pawn.health.capacities.CapableOf(PawnCapacityDefOf.Manipulation))
                        {
                            for (int num = victims.Count - 1; num >= 0; num--)
                            {
                                var victim = victims[num];
                                if (!victim.InBed() && !victim.mindState.WillJoinColonyIfRescued && pawn.CanReserveAndReach(victim, PathEndMode.OnCell, Danger.Deadly, 1, -1, null, ignoreOtherReservations: true))
                                {
                                    if (victim.InMentalState || victim.Faction != Faction.OfPlayer || (victim.Downed && (victim.guilt.IsGuilty || victim.IsPrisonerOfColony)))
                                    {
                                        var designation = victim.Map.designationManager.DesignationOn(victim);
                                        if (designation is null || designation.def.defName != "FinishOffDesignation")
                                        {
                                            Building_Bed building_Bed = RestUtility.FindBedFor(victim, pawn, sleeperWillBePrisoner: true, checkSocialProperness: false);
                                            if (building_Bed == null)
                                            {
                                                building_Bed = RestUtility.FindBedFor(victim, pawn, sleeperWillBePrisoner: true, checkSocialProperness: false, ignoreOtherReservations: true);
                                            }
                                            if (building_Bed != null)
                                            {
                                                Job job = JobMaker.MakeJob(JobDefOf.Capture, victim, building_Bed);
                                                job.count = 1;
                                                pawn.jobs.TryTakeOrderedJob(job);
                                                PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.Capturing, KnowledgeAmount.Total);
                                                if (victim.Faction != null && victim.Faction != Faction.OfPlayer && !victim.Faction.Hidden && !victim.Faction.HostileTo(Faction.OfPlayer) && !victim.IsPrisonerOfColony)
                                                {
                                                    Messages.Message("MessageCapturingWillAngerFaction".Translate(victim.Named("PAWN")).AdjustedFor(victim), victim, MessageTypeDefOf.CautionInput, historical: false);
                                                }
                                                victims.RemoveAt(num);
                                                break;
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                    TacticDefOf.TG_ArrestSFX.PlayOneShotOnCamera();
                }
            }

            var executeRect = new Rect(captureRect.xMax + 15, captureRect.y, Textures.Execute.width, Textures.Execute.height);

            GUI.DrawTexture(executeRect, Textures.Execute);
            TooltipHandler.TipRegion(executeRect, Strings.ExecuteTooltip);
            if (Mouse.IsOver(executeRect))
            {
                GUI.DrawTexture(executeRect, Textures.RescueTendHover);
                if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Event.current.clickCount == 1)
                {
                    var victims = this.colonistGroup.Map.mapPawns.AllPawns.Where(x => x.RaceProps.Humanlike && x.Downed && x.HostileTo(Faction.OfPlayer)).ToList();
                    foreach (var pawn in this.colonistGroup.ActivePawns)
                    {
                        if (!pawn.Dead && !pawn.Downed && pawn.health.capacities.CapableOf(PawnCapacityDefOf.Manipulation))
                        {
                            for (int num = victims.Count - 1; num >= 0; num--)
                            {
                                var victim = victims[num];
                                if (pawn.CanReserveAndReach(victim, PathEndMode.OnCell, Danger.Deadly, 1, -1, null, ignoreOtherReservations: true))
                                {
                                    Job job = JobMaker.MakeJob(TacticDefOf.TG_ExecuteDownedRaiders, victim);
                                    job.count = 1;
                                    pawn.jobs.TryTakeOrderedJob(job);
                                    victims.RemoveAt(num);
                                    break;
                                }
                            }
                        }
                    }
                    TacticDefOf.TG_ExecuteSFX.PlayOneShotOnCamera();
                }
                GUI.color = Color.white;
            }
        }