Пример #1
0
        public override void DoWindowContents(Rect rect)
        {
            base.DoWindowContents(rect);

            string[] tabs;
            if (prisoners.Count() > 0)
            {
                tabs = new string[] { "PrisonLabor_ColonistsOnlyShort".Translate(), "PrisonLabor_PrisonersOnlyShort".Translate() }
            }
            ;
            else
            {
                tabs = new string[] { "PrisonLabor_ColonistsOnlyShort".Translate() }
            };

            Text.Font = GameFont.Small;
            PrisonLaborWidgets.BeginTabbedView(rect, tabs, ref currentTabIndex);
            rect.height -= PrisonLaborWidgets.HorizontalSpacing - TopMargin;
            GUI.BeginGroup(new Rect(0, TopMargin, rect.width, rect.height));
            if (currentTabIndex == ColonistsTabIndex)
            {
                colonistTab.DoWindowContents(rect);
            }
            else if (currentTabIndex == PrisonersTabIndex)
            {
                prisonerTab.DoWindowContents(rect);
            }
            GUI.EndGroup();
            PrisonLaborWidgets.EndTabbedView();
        }
        public override void DoWindowContents(Rect rect)
        {
            string[] tabs;
            if (Prisoners.Count() > 0)
            {
                tabs = new string[] { "PrisonLabor_ColonistsOnlyShort".Translate(), "PrisonLabor_PrisonersOnlyShort".Translate() }
            }
            ;
            else
            {
                tabs = new string[] { "PrisonLabor_ColonistsOnlyShort".Translate() }
            };

            PrisonLaborWidgets.BeginTabbedView(rect, tabs, ref currentTabIndex);
            if (currentTabIndex == ColonistsTabIndex)
            {
                base.DoWindowContents(rect);
            }
            else if (currentTabIndex == PrisonersTabIndex)
            {
                SetInitialSizeAndPosition();
                prisonersTable.PawnTableOnGUI(new Vector2(rect.x, rect.y + this.ExtraTopSpace));
            }
            PrisonLaborWidgets.EndTabbedView();
        }