Пример #1
0
        private static void     SetAsCategory(object data)
        {
            StackTraceSettings stackTrace = HQ.Settings.Get <StackTraceSettings>();
            string             frame      = data as string;

            // Fetch "namespace.class[:.]method(".
            int n = frame.IndexOf("(");

            if (n == -1)
            {
                return;
            }

            string method      = frame.Substring(0, n);
            string placeholder = "Category Name";

            for (int i = 0; i < stackTrace.categories.Count; i++)
            {
                if (stackTrace.categories[i].method == method)
                {
                    placeholder = stackTrace.categories[i].category;
                    break;
                }
            }

            PromptWindow.Start(placeholder, RowUtility.SetCategory, method);
        }
Пример #2
0
            private void    PrepareSetNote(object data)
            {
                Action <object, string> SetNote = delegate(object data2, string content)
                {
                    if (data2 is LogNote)
                    {
                        ((LogNote)data2).note = content;
                    }
                    // Add a new note.
                    else if (data2 is Row)
                    {
                        LogNote note = new LogNote()
                        {
                            row  = (Row)data2,
                            note = content
                        };
                        this.notes.Add(note);
                    }

                    this.console.SaveModules();
                };

                for (int i = 0; i < this.notes.Count; i++)
                {
                    if (this.notes[i].row == data)
                    {
                        PromptWindow.Start(this.notes[i].note, SetNote, this.notes[i]);
                        return;
                    }
                }

                PromptWindow.Start(string.Empty, SetNote, data);
            }
Пример #3
0
 private void    ChangeStreamName()
 {
     PromptWindow.Start(this.name, this.RenameStream, null);
 }
Пример #4
0
 private void    ChangeStreamName(object data)
 {
     PromptWindow.Start(this.folders[(int)data].name, this.RenameStream, data);
 }
Пример #5
0
        public void     DrawBatch()
        {
            this.bodyRect.y      = Constants.SingleLineHeight;        // Header
            this.bodyRect.width  = this.position.width;
            this.bodyRect.height = this.position.height;
            this.viewRect.height = this.Hierarchy.Client.batchedPackets.Count * Constants.SingleLineHeight;
            this.r.x             = 0F;
            this.r.y             = Constants.SingleLineHeight;
            this.r.height        = Constants.SingleLineHeight;
            this.r.width         = this.position.width;

            GUILayout.BeginArea(this.r);
            {
                EditorGUILayout.BeginHorizontal();
                {
                    if (GUILayout.Button(LC.G("Execute")) == true)
                    {
                        this.Hierarchy.Client.ExecuteBatch();
                    }

                    if (GUILayout.Button(LC.G("Save"), GUILayoutOptionPool.MaxWidth(100F)) == true)
                    {
                        PromptWindow.Start("Noname", this.PromptSaveBatch, null);
                    }
                }
                EditorGUILayout.EndHorizontal();
                this.bodyRect.y += Constants.SingleLineHeight;
            }
            GUILayout.EndArea();

            if (this.Hierarchy.Client.BatchNames.Length > 0)
            {
                this.r.y += this.r.height;
                GUILayout.BeginArea(this.r);
                {
                    EditorGUILayout.BeginHorizontal();
                    {
                        this.selectedBatch = EditorGUILayout.Popup(this.selectedBatch, this.Hierarchy.Client.BatchNames);
                        if (GUILayout.Button(LC.G("Load"), GUILayoutOptionPool.MaxWidth(100F)) == true)
                        {
                            this.Hierarchy.Client.LoadBatch(this.selectedBatch);
                        }
                    }
                    EditorGUILayout.EndHorizontal();
                    this.bodyRect.y      += Constants.SingleLineHeight;
                    this.bodyRect.height -= this.bodyRect.y;
                }
                GUILayout.EndArea();
            }

            this.scrollBatchPosition = GUI.BeginScrollView(this.bodyRect, this.scrollBatchPosition, this.viewRect);
            {
                if (this.viewRect.height >= this.bodyRect.height)
                {
                    this.r.width -= 16F;
                }

                this.r.y      = 0F;
                this.r.height = Constants.SingleLineHeight;

                for (int i = 0; i < this.Hierarchy.Client.batchedPackets.Count; i++)
                {
                    GUILayout.BeginArea(r);
                    {
                        GUILayout.BeginHorizontal();
                        {
                            IGUIPacket clientPacket = this.Hierarchy.Client.batchedPackets[i].packet as IGUIPacket;

                            if (clientPacket != null)
                            {
                                clientPacket.OnGUI(this.Hierarchy);
                            }

                            if (GUILayout.Button("X", GUILayoutOptionPool.Width(20F)) == true)
                            {
                                this.Hierarchy.Client.batchedPackets.RemoveAt(i);
                                return;
                            }
                        }
                        GUILayout.EndHorizontal();
                    }
                    GUILayout.EndArea();

                    this.r.y += this.r.height;
                }
            }
            GUI.EndScrollView();
        }