Example #1
0
                public static void DrawSearchBar(Rect rect)
                {
                    rect.height = Text.LineHeight * 6;

                    var baseRect = rect.AtZero();

                    baseRect.y     += Text.LineHeight;
                    baseRect.height = yHeigthCache;

                    Widgets.BeginScrollView(rect, ref searchpos, baseRect, false);
                    GUI.BeginGroup(baseRect);
                    listing.Begin(baseRect);

                    float yHeight = 0;

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

                    var count = 0;

                    foreach (var entry in cachedEntries)
                    {
                        count++;
                        if (count == 50)
                        {
                            break;
                        }

                        var r = listing.GetRect(Text.LineHeight);

                        if (Widgets.ButtonInvisible(r))
                        {
                            currentInput = entry;
                        }

                        Widgets.DrawBoxSolid(r, Analyzer.Settings.GraphCol);

                        r.width = 2000;
                        Widgets.Label(r, " " + entry);
                        listing.GapLine(0f);
                        yHeight += 4f;
                        yHeight += r.height;
                    }

                    listing.End();
                    yHeigthCache = yHeight;
                    GUI.EndGroup();

                    DubGUI.ResetFont();
                    Widgets.EndScrollView();
                }