public static void DoAllowedAreaSelectors(Rect rect, ref Area areaRestriction, AllowedAreaMode mode, IEnumerable <Pawn> pawns) { List <Area> allAreas = Find.AreaManager.AllAreas; int num = 1; for (int i = 0; i < allAreas.Count; i++) { if (allAreas[i].AssignableAsAllowed(mode)) { num++; } } float num2 = rect.width / (float)num; Text.WordWrap = false; Text.Font = GameFont.Tiny; Rect rect2 = new Rect(rect.x, rect.y, num2, rect.height); AreaAllowedGUI.DoAreaSelector(rect2, ref areaRestriction, null, pawns); int num3 = 1; for (int j = 0; j < allAreas.Count; j++) { if (allAreas[j].AssignableAsAllowed(mode)) { float num4 = (float)num3 * num2; Rect rect3 = new Rect(rect.x + num4, rect.y, num2, rect.height); AreaAllowedGUI.DoAreaSelector(rect3, ref areaRestriction, allAreas[j], pawns); num3++; } } Text.WordWrap = true; }
protected override void DrawPawnRow(Rect rect, Pawn p) { GUI.BeginGroup(rect); Rect rect2 = new Rect(175f, 4f, 24f, 24f); if (Widgets.ImageButton(rect2, TexButton.Copy)) { this.CopyFrom(p); SoundDefOf.TickHigh.PlayOneShotOnCamera(); } TooltipHandler.TipRegion(rect2, "Copy".Translate()); if (this.clipboard != null) { Rect rect3 = rect2; rect3.x = rect2.xMax + 2f; if (Widgets.ImageButton(rect3, TexButton.Paste)) { this.PasteTo(p); SoundDefOf.TickLow.PlayOneShotOnCamera(); } TooltipHandler.TipRegion(rect3, "Paste".Translate()); } float num = 227f; this.hourWidth = 20.83333f; for (int i = 0; i < 24; i++) { Rect rect4 = new Rect(num, 0f, this.hourWidth, rect.height); this.DoTimeAssignment(rect4, p, i); num += this.hourWidth; } GUI.color = Color.white; num += 6f; Rect rect5 = new Rect(num, 0f, rect.width - num, rect.height); AreaAllowedGUI.DoAllowedAreaSelectors(rect5, p, AllowedAreaMode.Humanlike); GUI.EndGroup(); }
protected void DrawSquadRow(Rect rect) { float num = 3f; GUI.DrawTexture(rect, MainTabWindow_PawnListWithSquads.SquadRowBackground); GUI.BeginGroup(rect); Rect rect2 = new Rect(175f, 4f, 24f, 24f); if (this.clipboard != null) { Rect rect3 = rect2; rect3.x = rect2.xMax + 2f; if (Widgets.ImageButton(rect3, TexButton.Paste)) { foreach (Pawn current in this.pawns) { this.PasteTo(current); } SoundDefOf.TickLow.PlayOneShotOnCamera(); } TooltipHandler.TipRegion(rect3, "Paste".Translate()); } float num2 = 227f; this.hourWidth = 20.83333f; for (int i = 0; i < 24; i++) { Rect rect4 = new Rect(num2, 0f, this.hourWidth, rect.height - num); this.DoTimeAssignment(rect4, i); num2 += this.hourWidth; } GUI.color = Color.white; num2 += 6f; Rect rect5 = new Rect(num2, 0f, rect.width - num2, rect.height - num); AreaAllowedGUI.DoAllowedAreaSelectors(rect5, ref this.areaRestriction, AllowedAreaMode.Humanlike, this.pawns); GUI.color = new Color(1f, 1f, 1f, 0.2f); Widgets.DrawLineHorizontal(0f, 0f, rect.width); GUI.color = new Color(1f, 1f, 1f, 0.35f); Widgets.DrawLineHorizontal(0f, base.SquadRowHeight - 3f, rect.width); Widgets.DrawLineHorizontal(0f, base.SquadRowHeight - 2f, rect.width); Text.Font = GameFont.Small; Text.Anchor = TextAnchor.MiddleLeft; Text.WordWrap = false; Rect rect6 = new Rect(0f, 0f, 175f, 30f); rect6.xMin += 15f; GUI.color = new Color(1f, 1f, 1f, 1f); if (base.SquadFilteringEnabled && SquadManager.Instance.SquadFilter != null) { Widgets.Label(rect6, SquadManager.Instance.SquadFilter.Name); } else { Widgets.Label(rect6, "EdB.Squads.AllColonistsSquadName".Translate()); } Text.Anchor = TextAnchor.UpperLeft; Text.WordWrap = true; GUI.color = Color.white; GUI.EndGroup(); }