Exemplo n.º 1
0
        public override void DoWindowContents(Rect inRect)
        {
            this.BaseDoWindowContents(inRect);
            Text.Font = GameFont.Small;
            float num  = inRect.width / 2f;
            float num2 = 0f;
            float num3 = 0f;

            for (int i = 0; i < this.desPanelsCached.Count; i++)
            {
                Rect rect = new Rect(num2 * num, num3 * 32f, num, 32f);
                rect.height += 1f;
                if (num2 == 0f)
                {
                    rect.width += 1f;
                }
                if (WidgetsSubtle.ButtonSubtle(rect, this.desPanelsCached[i].def.LabelCap, 0f, 8f, SoundDefOf.MouseoverButtonCategory))
                {
                    this.ClickedCategory(this.desPanelsCached[i]);
                }
                num2 += 1f;
                if (num2 > 1f)
                {
                    num2  = 0f;
                    num3 += 1f;
                }
            }
        }
Exemplo n.º 2
0
        private void DoTabButton(MainTabDef def, float posX, float width)
        {
            Text.Font = GameFont.Small;
            Rect     rect = new Rect(posX, (float)(Screen.height - 35), width, 35f);
            SoundDef mouseoverButtonCategory = SoundDefOf.MouseoverButtonCategory;

            if (WidgetsSubtle.ButtonSubtle(rect, def.LabelCap, def.Window.TabButtonBarPercent, -1f, mouseoverButtonCategory))
            {
                this.ToggleTab(def, true);
            }
            if (!def.tutorHighlightTag.NullOrEmpty())
            {
                TutorUIHighlighter.HighlightOpportunity(def.tutorHighlightTag, rect);
            }
            if (!def.description.NullOrEmpty())
            {
                TooltipHandler.TipRegion(rect, def.description);
            }
        }