Esempio n. 1
0
        public Listing_StandardExpanding BeginSection(float height, bool hidesection = false, int type = 0, int sectionBorder = 4, int bottomBorder = 4, Listing_StandardExpanding parent = null)
        {
            Rect rect = this.GetRect(height + sectionBorder + bottomBorder);

            this.frameRect = rect;
            if (parent != null)
            {
                parent.listingRect.height += rect.height;
            }
            if (!hidesection)
            {
                switch (type)
                {
                case 1:
                    Widgets.DrawWindowBackground(rect);
                    break;

                case 2:
                    Widgets.DrawWindowBackgroundTutor(rect);
                    break;

                case 3:
                    Widgets.DrawOptionUnselected(rect);
                    break;

                case 4:
                    Widgets.DrawOptionSelected(rect);
                    break;

                default:
                    Widgets.DrawMenuSection(rect);
                    break;
                }
            }
            Listing_StandardExpanding listing_Standard = new Listing_StandardExpanding();
            Rect rect2 = new Rect(rect.x + sectionBorder, rect.y + sectionBorder, rect.width - sectionBorder * 2f, rect.height - (sectionBorder + bottomBorder));

            listing_Standard.Begin(rect2);
            return(listing_Standard);
        }
Esempio n. 2
0
        public Listing_StandardExpanding BeginSection(float height, out Rect frane, out Rect contents, bool hidesection = false, int type = 0, int sectionBorder = 4, int bottomBorder = 4, Listing_StandardExpanding parent = null, bool extend = false)
        {
            frane          = this.GetRect(height + sectionBorder + bottomBorder, null, extend);
            this.frameRect = frane;
            if (parent != null)
            {
                parent.curY += frane.height;
            }
            if (!hidesection)
            {
                switch (type)
                {
                case 1:
                    Widgets.DrawWindowBackground(frane);
                    break;

                case 2:
                    Widgets.DrawWindowBackgroundTutor(frane);
                    break;

                case 3:
                    Widgets.DrawOptionUnselected(frane);
                    break;

                case 4:
                    Widgets.DrawOptionSelected(frane);
                    break;

                default:
                    Widgets.DrawMenuSection(frane);
                    break;
                }
            }
            Listing_StandardExpanding listing_Standard = new Listing_StandardExpanding();

            contents = new Rect(frane.x + sectionBorder, frane.y + sectionBorder, frane.width - sectionBorder * 2f, frane.height - (sectionBorder + bottomBorder));

            listing_Standard.Begin(contents);
            return(listing_Standard);
        }