public static void Draw(Listing_Standard listing)
 {
     DrawCategory(listing, PerformanceCategory.Optimizes, "settings.Optimizations".Tr());
     listing.GapLine();
     DrawCategory(listing, PerformanceCategory.Overrides, "settings.Overrides".Tr());
     listing.GapLine();
     DrawCategory(listing, PerformanceCategory.Removes, "settings.Disabling".Tr());
     listing.GapLine();
     FixPatches.Draw(listing);
 }
Example #2
0
        public static void Draw(Rect rect, bool settingsPage = false)
        {
            if (settingsPage)
            {
                currentTab = 0;
            }
            else
            {
                rect.y += 35;
                List <TabRecord> list = new List <TabRecord>();
                list.Add(new TabRecord("settings.performance".Translate(), delegate
                {
                    currentTab = 0;
                    Modbase.Settings.Write();
                }, currentTab == 0));
                list.Add(new TabRecord("settings.developer".Translate(), delegate
                {
                    currentTab = 1;
                    Modbase.Settings.Write();
                }, currentTab == 1));

                TabDrawer.DrawTabs(rect, list, 500f);
            }


            Rect view = rect.AtZero();

            view.height = rect.height;

            Widgets.BeginScrollView(rect, ref scrollPos, view, false);
            GUI.BeginGroup(view);
            view.height = 9999;
            listing.Begin(view.ContractedBy(10f));

            // Draw the github and discord textures / Icons

            Rect rec  = listing.GetRect(24f);
            Rect lrec = rec.LeftHalf();

            rec = rec.RightHalf();
            Widgets.DrawTextureFitted(lrec.LeftPartPixels(40f), ResourceCache.GUI.Support, 1f);
            lrec.x += 40;
            if (Widgets.ButtonText(lrec.LeftPartPixels(ResourceCache.Strings.settings_wiki.GetWidthCached()), ResourceCache.Strings.settings_wiki, false, true))
            {
                Application.OpenURL("https://github.com/Dubwise56/Dubs-Performance-Analyzer/wiki");
            }

            Widgets.DrawTextureFitted(rec.RightPartPixels(40f), ResourceCache.GUI.disco, 1f);
            rec.width -= 40;
            if (Widgets.ButtonText(rec.RightPartPixels(ResourceCache.Strings.settings_discord.GetWidthCached()), ResourceCache.Strings.settings_discord, false, true))
            {
                Application.OpenURL("https://discord.gg/Az5CnDW");
            }


            listing.GapLine(6f);

            switch (currentTab)
            {
            case 0:
                PerformancePatches.Draw(ref listing);
                FixPatches.Draw(listing);
                break;

            case 1:
                DrawDevOptions(rect.height);
                break;
            }

            listing.End();
            GUI.EndGroup();
            Widgets.EndScrollView();
        }