Пример #1
0
        public static void SwapTab(KeyValuePair <ProfileMode, Type> mode, UpdateMode updateMode)
        {
            if (State == CurrentState.Uninitialised)
            {
                Dialog_Analyzer.Reboot();
            }

            if (!(CurrentSideTabCategory == UpdateToSideTab(updateMode)))
            {
                CurrentSideTabCategory = UpdateToSideTab(updateMode);
                Analyzer.Settings.Write();
            }

            if (CurrentTab != null)
            {
                CurrentTab.SetActive(false);
            }

            mode.Key.SetActive(CurrentlyRunning);
            CurrentTab        = mode.Key;
            CurrentProfileKey = "Overview";
            ResetState();

            if (!mode.Key.IsPatched)
            {
                mode.Key.ProfilePatch();
            }
        }
        public static void TypesBox(Rect rect)
        {
            var speng = rect;

            speng.height = 25f;
            var glorph = speng.LeftPart(0.9f);

            speng = speng.RightPart(0.1f);

            var reod = false;
            var old1 = TypeSearch;

            TypeSearch = Widgets.TextField(glorph.LeftHalf(), TypeSearch);
            if (old1 != TypeSearch)
            {
                reod = true;
            }

            var old2 = MethSearch;

            MethSearch = Widgets.TextField(glorph.RightHalf(), MethSearch);
            if (old2 != MethSearch)
            {
                reod = true;
            }

            //if (Widgets.ButtonText(speng, "Search"))
            //{

            //}

            if (reod && (TypeSearch.Length > 2 || MethSearch.Length > 2))
            {
                GotMeth = Dialog_Analyzer.SearchFor().ToList();
            }


            rect.y      += 25f;
            rect.height -= 25f;

            var innyrek = rect.AtZero();

            innyrek.width -= 32f;
            innyrek.height = groaner;

            Widgets.BeginScrollView(rect, ref scrolpos, innyrek);

            GUI.BeginGroup(innyrek);

            listing.Begin(innyrek);

            float goat = 0;

            Text.Anchor = TextAnchor.MiddleLeft;
            Text.Font   = GameFont.Tiny;

            var coo = 0;

            foreach (var meth in GotMeth)
            {
                coo++;
                if (coo == 50)
                {
                    break;
                }

                var tp = meth.Name;

                var r = listing.GetRect(30f);

                if (Analyzer.Settings.Loggers == null)
                {
                    Analyzer.Settings.Loggers = new Dictionary <string, bool>();
                }

                if (Widgets.ButtonInvisible(r))
                {
                    if (!Analyzer.Settings.Loggers.ContainsKey(tp))
                    {
                        Analyzer.Settings.Loggers.Add(tp, true);
                    }
                    else
                    {
                        var bam = Analyzer.Settings.Loggers[tp];
                        Analyzer.Settings.Loggers[tp] = !bam;
                    }
                }

                if (Analyzer.Settings.Loggers.ContainsKey(tp))
                {
                    var bam = Analyzer.Settings.Loggers[tp];

                    r = r.LeftPartPixels(75);
                    Widgets.CheckboxDraw(r.x, r.y, bam, true);
                }
                else
                {
                    r = r.LeftPartPixels(75);
                    Widgets.CheckboxDraw(r.x, r.y, false, true);
                }

                r.x     = r.xMax;
                r.width = 2000;
                Widgets.Label(r, $"{meth.ReflectedType} {meth}");

                listing.GapLine(0f);
                goat += 4f;
                goat += r.height;
            }

            listing.End();
            groaner = goat;
            GUI.EndGroup();

            Text.Font   = GameFont.Small;
            Text.Anchor = TextAnchor.UpperLeft;
            Widgets.EndScrollView();
        }