Пример #1
0
        private Rect    DrawSampleTabs(Rect r)
        {
            ConsoleSettings settings = HQ.Settings.Get <ConsoleSettings>();

            r.height = Constants.SingleLineHeight;

            // Switch stream
            if (settings.inputsManager.Check("Navigation", ConsoleConstants.SwitchNextStreamCommand) == true)
            {
                this.currentVars.workingStream += 1;
                if (this.currentVars.workingStream >= this.streams.Count)
                {
                    this.currentVars.workingStream = 0;
                }

                Event.current.Use();
            }
            if (settings.inputsManager.Check("Navigation", ConsoleConstants.SwitchPreviousStreamCommand) == true)
            {
                this.currentVars.workingStream -= 1;
                if (this.currentVars.workingStream < 0)
                {
                    this.currentVars.workingStream = this.streams.Count - 1;
                }

                Event.current.Use();
            }

            GUILayout.BeginArea(r);
            {
                GUILayout.BeginHorizontal();
                {
                    for (int i = 0; i < this.streams.Count; i++)
                    {
                        r = this.streams[i].OnTabGUI(r, i);
                    }

                    if (GUILayout.Button("+", HQ.Settings.Get <GeneralSettings>().MenuButtonStyle) == true)
                    {
                        MainModuleSettings mainSettings = HQ.Settings.Get <MainModuleSettings>();
                        SampleStream       stream       = new SampleStream();

                        stream.Init(this.console, this);

                        foreach (ILogFilter filter in mainSettings.GenerateFilters())
                        {
                            stream.groupFilters.filters.Add(filter);
                        }

                        this.streams.Add(stream);

                        if (this.streams.Count == 1)
                        {
                            this.currentVars.workingStream = 0;
                        }

                        if (this.StreamAdded != null)
                        {
                            this.StreamAdded(stream);
                        }

                        stream.RefreshFilteredRows();
                    }

                    GUILayout.FlexibleSpace();
                }
                GUILayout.EndHorizontal();
            }
            GUILayout.EndArea();

            r.y += r.height + 2F;

            return(r);
        }
Пример #2
0
 public virtual void     Init(SampleStream sampleLog)
 {
     this.sampleLog = sampleLog;
 }