Esempio n. 1
0
        private static void     DrawInputCommand(InputCommand command)
        {
            EditorGUILayout.Space();

            EditorGUILayout.BeginHorizontal();
            {
                GUILayout.Label(LC.G("Input_" + command.name), GeneralStyles.Title1, GUILayoutOptionPool.ExpandWidthFalse);

                if (ConsoleSettingsEditor.registeringCommand == command)
                {
                    if (Event.current.type == EventType.KeyUp)
                    {
                        if (Event.current.keyCode == KeyCode.LeftControl || Event.current.keyCode == KeyCode.RightControl)
                        {
                            command.modifiers ^= InputCommand.Control;
                        }
                        else if (Event.current.keyCode == KeyCode.LeftShift || Event.current.keyCode == KeyCode.RightShift)
                        {
                            command.modifiers ^= InputCommand.Shift;
                        }
                        else if (Event.current.keyCode == KeyCode.LeftAlt || Event.current.keyCode == KeyCode.RightAlt)
                        {
                            command.modifiers ^= InputCommand.Alt;
                        }
                        else
                        {
                            command.keyCode = Event.current.keyCode;
                        }

                        Event.current.Use();
                    }
                    else if (Event.current.shift == true)
                    {
                        ConsoleSettingsEditor.shiftPressed = true;
                    }
                    else if (ConsoleSettingsEditor.shiftPressed == true)
                    {
                        command.modifiers ^= InputCommand.Shift;
                        ConsoleSettingsEditor.shiftPressed = false;
                    }

                    if (GUILayout.Button(LC.G("Stop"), GUILayoutOptionPool.MaxWidth(80F)) == true)
                    {
                        registeringCommand = null;
                    }

                    GUILayout.Label(LC.G("ConsoleSettings_PressAny"));

                    // Force repaint to handle shift input.
                    //ConsoleSettingsEditor.Repaint();
                }
                else if (GUILayout.Button(LC.G("Edit"), GUILayoutOptionPool.MaxWidth(80F)) == true)
                {
                    Utility.content.text = LC.G("InputsWizard_PressAnythingToEditCommand");
                    registeringCommand   = command;
                    ConsoleSettingsEditor.shiftPressed = false;
                }
            }
            EditorGUILayout.EndHorizontal();

            string description = LC.G("Input_" + command.name + InputCommand.DescriptionLocalizationSuffix);

            if (string.IsNullOrEmpty(description) == false)
            {
                EditorGUILayout.LabelField(description, GeneralStyles.WrapLabel);
            }

            EditorGUILayout.BeginHorizontal();
            {
                command.keyCode = (KeyCode)EditorGUILayout.EnumPopup(command.keyCode, GUILayoutOptionPool.Width(130F));

                EditorGUI.BeginChangeCheck();
                GUILayout.Toggle((command.modifiers & InputCommand.Control) != 0, "Ctrl", ConsoleSettingsEditor.menuButtonStyle, GUILayoutOptionPool.Width(50F));
                if (EditorGUI.EndChangeCheck() == true)
                {
                    command.modifiers ^= InputCommand.Control;
                }

                EditorGUI.BeginChangeCheck();
                GUILayout.Toggle((command.modifiers & InputCommand.Shift) != 0, "Shift", ConsoleSettingsEditor.menuButtonStyle, GUILayoutOptionPool.Width(50F));
                if (EditorGUI.EndChangeCheck() == true)
                {
                    command.modifiers ^= InputCommand.Shift;
                }

                EditorGUI.BeginChangeCheck();
                GUILayout.Toggle((command.modifiers & InputCommand.Alt) != 0, "Alt", ConsoleSettingsEditor.menuButtonStyle, GUILayoutOptionPool.Width(50F));
                if (EditorGUI.EndChangeCheck() == true)
                {
                    command.modifiers ^= InputCommand.Alt;
                }
            }
            EditorGUILayout.EndHorizontal();
        }
Esempio n. 2
0
        public override void    OnGUI(Rect r)
        {
            this.currentVars = this.perWindowVars.Get(RowUtility.drawingWindow);

            float yOrigin   = r.y;
            float maxHeight = r.height;

            r.y     += 2F;
            r.height = Constants.SingleLineHeight + 2F;             // Layout is requiring 2 more pixels.
            GUILayout.BeginArea(r);
            {
                GUILayout.BeginHorizontal(GeneralStyles.Toolbar);
                {
                    if (GUILayout.Button("Clear", GeneralStyles.ToolbarButton) == true)
                    {
                        this.Clear();
                    }

                    List <NGServerInstance> servers = ConnectionsManager.Servers;

                    lock (ConnectionsManager.Servers)
                    {
                        EditorGUI.BeginDisabledGroup(this.connectingThread != null || servers.Count == 0);
                        {
                            if (servers.Count == 0)
                            {
                                Utility.content.text = "No server";
                            }
                            else if (servers.Count == 1)
                            {
                                Utility.content.text = "1 server";
                            }
                            else
                            {
                                Utility.content.text = servers.Count + " servers";
                            }

                            Rect r2 = GUILayoutUtility.GetRect(Utility.content, GeneralStyles.ToolbarDropDown);

                            if (GUI.Button(r2, Utility.content, GeneralStyles.ToolbarDropDown) == true)
                            {
                                PopupWindow.Show(new Rect(0F, 16F, 0F, 0F), new ServersSelectorWindow(this));
                            }
                        }
                        EditorGUI.EndDisabledGroup();
                    }

                    EditorGUI.BeginDisabledGroup(this.connectingThread != null || this.IsClientConnected());
                    {
                        if (this.tcpClientProviderNames.Length > 1)
                        {
                            EditorGUI.BeginChangeCheck();
                            this.selectedTcpClientProvider = EditorGUILayout.Popup(this.selectedTcpClientProvider, this.tcpClientProviderNames, GeneralStyles.ToolbarDropDown);
                            if (EditorGUI.EndChangeCheck() == true)
                            {
                                this.console.SaveModules();
                            }
                        }

                        EditorGUI.BeginChangeCheck();
                        this.address = EditorGUILayout.TextField(this.address, GUILayoutOptionPool.MinWidth(50F));
                        if (EditorGUI.EndChangeCheck() == true)
                        {
                            this.console.SaveModules();
                        }

                        if (string.IsNullOrEmpty(this.address) == true)
                        {
                            Rect r2 = GUILayoutUtility.GetLastRect();
                            EditorGUI.LabelField(r2, LC.G("RemoteModule_Address"), GeneralStyles.TextFieldPlaceHolder);
                        }

                        string port = this.port.ToString();
                        if (port == "0")
                        {
                            port = string.Empty;
                        }
                        EditorGUI.BeginChangeCheck();
                        port = EditorGUILayout.TextField(port, GUILayoutOptionPool.MaxWidth(40F));
                        if (EditorGUI.EndChangeCheck() == true)
                        {
                            try
                            {
                                if (string.IsNullOrEmpty(port) == false)
                                {
                                    this.port = Mathf.Clamp(int.Parse(port), 0, UInt16.MaxValue - 1);
                                }
                                else
                                {
                                    this.port = 0;
                                }
                            }
                            catch
                            {
                                this.port = 0;
                                GUI.FocusControl(null);
                            }

                            this.console.SaveModules();
                        }

                        if ((port == string.Empty || port == "0") && this.port == 0)
                        {
                            Rect r2 = GUILayoutUtility.GetLastRect();
                            EditorGUI.LabelField(r2, LC.G("RemoteModule_Port"), GeneralStyles.TextFieldPlaceHolder);
                        }
                    }
                    EditorGUI.EndDisabledGroup();

                    GUILayout.FlexibleSpace();

                    if (this.IsClientConnected() == true)
                    {
                        if (GUILayout.Button(LC.G("RemoteModule_Disconnect"), GeneralStyles.ToolbarButton, GUILayoutOptionPool.Width(80F)) == true)
                        {
                            this.CloseClient();
                        }

                        if (string.IsNullOrEmpty(this.servicesWarning) == false)
                        {
                            Rect r2 = GUILayoutUtility.GetRect(0F, 16F, GUILayoutOptionPool.Width(16F));

                            r2.x += 4F;
                            r2.y += 2F;
                            GUI.DrawTexture(r2, UtilityResources.WarningIcon);
                            if (Event.current.type == EventType.MouseDown &&
                                r2.Contains(Event.current.mousePosition) == true)
                            {
                                this.showServicesWarning = !this.showServicesWarning;
                                Event.current.Use();
                            }
                        }
                    }
                    else
                    {
                        if (this.connectingThread == null)
                        {
                            if (GUILayout.Button(LC.G("RemoteModule_Connect"), GeneralStyles.ToolbarButton, GUILayoutOptionPool.Width(80F)) == true)
                            {
                                this.Connect(this.address, this.port);
                            }
                        }
                        else
                        {
                            Utility.content.text  = "Connecting";
                            Utility.content.image = GeneralStyles.StatusWheel.image;
                            GUILayout.Label(Utility.content, GeneralStyles.ToolbarButton, GUILayoutOptionPool.Width(90F));
                            Utility.content.image = null;
                            this.console.Repaint();

                            if (GUILayout.Button("X", GeneralStyles.ToolbarButton, GUILayoutOptionPool.Width(16F)) == true)
                            {
                                this.connectingThread.Abort();
                                this.connectingThread.Join(0);
                                this.connectingThread = null;
                            }
                        }
                    }
                }
                GUILayout.EndHorizontal();
            }
            GUILayout.EndArea();
            r.y     += r.height;
            r.height = Constants.SingleLineHeight;

            if (this.showServicesWarning == true &&
                string.IsNullOrEmpty(this.servicesWarning) == false)
            {
                r.height = Constants.SingleLineHeight + Constants.SingleLineHeight;
                EditorGUI.HelpBox(r, this.servicesWarning, MessageType.Warning);

                Rect r2 = r;
                r2.xMin = r.xMax - 20F;
                r2.yMin = r.yMax - 15F;

                if (GUI.Button(r2, "X") == true)
                {
                    this.showServicesWarning = false;
                }

                r.y     += r.height;
                r.height = Constants.SingleLineHeight;
            }

            r = this.DrawStreamTabs(r);

            if (this.currentVars.workingStream < 0)
            {
                return;
            }

            if (this.IsClientConnected() == true)
            {
                float streamHeight = maxHeight - (r.y - yOrigin) - Constants.SingleLineHeight;
                float xMin         = r.xMin;

                r.xMin = 0F;
                r.y   += streamHeight;

                // Draw CLI before rows.
                r.height = Constants.SingleLineHeight;
                this.DrawCLI(r);
                // Shit of a hack to handle input for completion and its drawing.
                this.parser.PostGUI(r, ref this.command);

                r.xMin   = xMin;
                r.y     -= streamHeight;
                r.height = streamHeight;

                this.streams[this.currentVars.workingStream].OnGUI(r);
                r.y += streamHeight;

                // Redraw again to display in front.
                this.parser.PostGUI(r, ref this.command);
            }
            else
            {
                r.height = maxHeight - (r.y - yOrigin);
                this.streams[this.currentVars.workingStream].OnGUI(r);
            }
        }
Esempio n. 3
0
        private void    DrawSelection()
        {
            if (Selection.activeGameObject != this.selectionTarget)
            {
                this.selectionTarget = Selection.activeGameObject;

                if (Selection.activeGameObject != null)
                {
                    this.Diagnose(Selection.activeGameObject);
                }
                else
                {
                    this.target = null;
                }
            }

            if (this.target == null)
            {
                if (this.selectionTarget == null)
                {
                    GUILayout.Label("Select a prefab (or an instance of it) to diagnose", GeneralStyles.BigCenterText, GUILayoutOptionPool.ExpandHeightTrue);
                }
                else
                {
                    GUILayout.Label("No diagnostic available", GeneralStyles.BigCenterText, GUILayoutOptionPool.ExpandHeightTrue);
                }
                return;
            }

            if (this.selectedMissing >= 0)
            {
                EditorGUILayout.BeginHorizontal(GeneralStyles.Toolbar);
                {
                    EditorGUI.BeginDisabledGroup(this.selectedMissing <= 0);
                    {
                        if (GUILayout.Button("<<", GeneralStyles.ToolbarButton, GUILayoutOptionPool.MaxWidth(100F)) == true)
                        {
                            --this.selectedMissing;
                            this.Diagnose(this.missings[this.selectedMissing].gameObject);
                        }
                    }
                    EditorGUI.EndDisabledGroup();

                    NGEditorGUILayout.PingObject(this.missings[this.selectedMissing].path, this.missings[this.selectedMissing].gameObject, GeneralStyles.ToolbarButton);

                    EditorGUI.BeginDisabledGroup(this.selectedMissing >= this.missings.Count - 1);
                    {
                        if (GUILayout.Button(">>", GeneralStyles.ToolbarButton, GUILayoutOptionPool.MaxWidth(100F)) == true)
                        {
                            ++this.selectedMissing;
                            this.Diagnose(this.missings[this.selectedMissing].gameObject);
                        }
                    }
                    EditorGUI.EndDisabledGroup();
                }
                EditorGUILayout.EndHorizontal();
            }
            else
            {
                Utility.content.text  = this.target.name;
                Utility.content.image = Utility.GetIcon(this.target.GetInstanceID());
                EditorGUILayout.LabelField(Utility.content);
                Utility.content.image = null;
            }

            this.scrollPosition = EditorGUILayout.BeginScrollView(this.scrollPosition);
            {
                for (int i = 0; i < this.rawComponents.Count; i++)
                {
                    this.rawComponents[i].Draw(this);
                }
            }
            EditorGUILayout.EndScrollView();
        }
Esempio n. 4
0
        protected virtual void  OnGUI()
        {
            Rect r = this.position;

            r.x = 0F;
            r.y = 0F;

            if (this.prefManagers.Length > 0)
            {
                r.height = Constants.SingleLineHeight;
                GUILayout.BeginArea(r);
                {
                    EditorGUILayout.BeginHorizontal(GeneralStyles.Toolbar);
                    {
                        EditorGUI.BeginChangeCheck();
                        this.currentManager = EditorGUILayout.Popup(this.currentManager, this.prefManagerNames, GeneralStyles.ToolbarDropDown);
                        if (EditorGUI.EndChangeCheck() == true)
                        {
                            this.LoadCurrentPreferences();
                            return;
                        }

                        if (GUILayout.Button(this.showAdd == true ? "˄" : "˅", GeneralStyles.ToolbarDropDown, GUILayoutOptionPool.Width(24F)) == true)
                        {
                            this.showAdd = !this.showAdd;
                            return;
                        }

                        EditorGUI.BeginChangeCheck();
                        this.searchKeywords = EditorGUILayout.TextField(this.searchKeywords, GeneralStyles.ToolbarSearchTextField);
                        if (EditorGUI.EndChangeCheck() == true)
                        {
                            this.searchPatterns = Utility.SplitKeywords(this.searchKeywords, ' ');
                            this.UpdateFilteredIndexes();
                            return;
                        }

                        if (GUILayout.Button("", GeneralStyles.ToolbarSearchCancelButton) == true)
                        {
                            this.searchKeywords = string.Empty;
                            this.searchPatterns = Utility.SplitKeywords(this.searchKeywords, ' ');
                            GUI.FocusControl(null);
                            this.UpdateFilteredIndexes();
                            return;
                        }

                        if (GUILayout.Button(LC.G("NGPrefs_Refresh"), GeneralStyles.ToolbarButton, GUILayoutOptionPool.MaxWidth(100F)))
                        {
                            this.LoadCurrentPreferences();
                            GUI.FocusControl(null);
                            return;
                        }

                        if (string.IsNullOrEmpty(this.searchKeywords) == true)
                        {
                            if (GUILayout.Button(LC.G("NGPrefs_ClearAll"), GeneralStyles.ToolbarButton, GUILayoutOptionPool.MaxWidth(100F)) &&
                                ((Event.current.modifiers & Constants.ByPassPromptModifier) != 0 || EditorUtility.DisplayDialog(LC.G("NGPrefs_ClearAll"), LC.G("NGPrefs_ClearAllConfirm"), LC.G("Yes"), LC.G("No")) == true))
                            {
                                try
                                {
                                    this.prefManagers[this.currentManager].DeleteAll();
                                }
                                catch (Exception ex)
                                {
                                    this.errorPopup.exception = ex;
                                }
                                return;
                            }
                        }
                        else
                        {
                            if (GUILayout.Button(LC.G("NGPrefs_ClearList"), GeneralStyles.ToolbarButton, GUILayoutOptionPool.MaxWidth(100F)) &&
                                ((Event.current.modifiers & Constants.ByPassPromptModifier) != 0 || EditorUtility.DisplayDialog(LC.G("NGPrefs_ClearList"), LC.G("NGPrefs_ClearListConfirm"), LC.G("Yes"), LC.G("No")) == true))
                            {
                                try
                                {
                                    for (int k = 0; k < this.filteredIndexes.Count; k++)
                                    {
                                        int i = this.filteredIndexes[k];

                                        this.prefManagers[this.currentManager].DeleteKey(this.prefManagers[this.currentManager].keys[i]);
                                    }

                                    for (int k = 0; k < this.filteredIndexes.Count; k++)
                                    {
                                        int i = this.filteredIndexes[k];

                                        this.prefManagers[this.currentManager].DeleteIndex(i - k);
                                    }

                                    this.filteredIndexes.Clear();
                                }
                                catch (Exception ex)
                                {
                                    this.errorPopup.exception = ex;
                                }
                                return;
                            }
                        }
                    }
                    EditorGUILayout.EndHorizontal();
                }
                GUILayout.EndArea();

                if (this.showAdd == true)
                {
                    r.y += r.height;
                    GUILayout.BeginArea(r);
                    {
                        EditorGUILayout.BeginHorizontal(GeneralStyles.Toolbar);
                        {
                            using (LabelWidthRestorer.Get(60F))
                            {
                                this.prefType = (PrefType)EditorGUILayout.EnumPopup(LC.G("NGPrefs_Type"), this.prefType, GeneralStyles.ToolbarDropDown, GUILayoutOptionPool.ExpandWidthFalse);
                                this.newKey   = EditorGUILayout.TextField(LC.G("NGPrefs_Key"), this.newKey, GeneralStyles.ToolbarTextField, GUILayoutOptionPool.ExpandWidthTrue);

                                switch (this.prefType)
                                {
                                case PrefType.Int:
                                    this.newValueInt = EditorGUILayout.IntField(LC.G("NGPrefs_Value"), this.newValueInt, GeneralStyles.ToolbarTextField, GUILayoutOptionPool.ExpandWidthTrue);
                                    break;

                                case PrefType.Float:
                                    this.newValueFloat = EditorGUILayout.FloatField(LC.G("NGPrefs_Value"), this.newValueFloat, GeneralStyles.ToolbarTextField, GUILayoutOptionPool.ExpandWidthTrue);
                                    break;

                                case PrefType.String:
                                    this.newValueString = EditorGUILayout.TextField(LC.G("NGPrefs_Value"), this.newValueString, GeneralStyles.ToolbarTextField, GUILayoutOptionPool.ExpandWidthTrue);
                                    break;
                                }

                                EditorGUI.BeginDisabledGroup(string.IsNullOrEmpty(this.newKey));
                                {
                                    if (GUILayout.Button(LC.G("NGPrefs_Add"), GeneralStyles.ToolbarButton, GUILayoutOptionPool.MaxWidth(100F)))
                                    {
                                        switch (this.prefType)
                                        {
                                        case PrefType.Int:
                                            this.prefManagers[this.currentManager].SetInt(this.newKey, this.newValueInt);
                                            break;

                                        case PrefType.Float:
                                            this.prefManagers[this.currentManager].SetFloat(this.newKey, this.newValueFloat);
                                            break;

                                        case PrefType.String:
                                            this.prefManagers[this.currentManager].SetString(this.newKey, this.newValueString);
                                            break;
                                        }

                                        this.LoadCurrentPreferences();
                                        return;
                                    }
                                }
                                EditorGUI.EndDisabledGroup();
                            }
                        }
                        EditorGUILayout.EndHorizontal();
                    }
                    GUILayout.EndArea();
                }
            }

            r.y += r.height;

            if (this.errorPopup.exception != null)
            {
                r.height = this.errorPopup.boxHeight;
                this.errorPopup.OnGUIRect(r);
                r.y += r.height;

                r.height = Constants.SingleLineHeight;
            }

            if (this.OSXPListMissing == true)
            {
                r.height = 32F;
                EditorGUI.HelpBox(r, "NG Tools seems to be initializing for the first time. " + NGPrefsWindow.Title + " can not work on first initialization, because it needs the preferences file generated by Unity, which does not exist at this moment.", MessageType.Warning);
                r.y += r.height;

                EditorGUI.HelpBox(r, "To force Unity to generate it, I suggest you to use EditorPrefs or PlayerPrefs from a custom script then restart Unity.", MessageType.Info);
                r.y += r.height;

                r.height = Constants.SingleLineHeight;
            }

            if (this.currentManager < 0)
            {
                return;
            }

            r.y += 1F;

            this.labelWidth = Mathf.Clamp(this.labelWidth, NGPrefsWindow.MinLabelWidth, this.position.width - NGPrefsWindow.MinValueWidth);
            r.width         = this.labelWidth;
            EditorGUI.LabelField(r, LC.G("NGPrefs_Key"), GeneralStyles.CenterText);

            r.x    += r.width + 20F;
            r.width = 2F;
            EditorGUI.DrawRect(r, Color.grey);

            r.x     -= 1F;
            r.width += 2F;
            EditorGUIUtility.AddCursorRect(r, MouseCursor.ResizeHorizontal);

            if (this.draggingSplitterBar == true &&
                Event.current.type == EventType.MouseDrag)
            {
                if (Mathf.Abs(r.y - Event.current.mousePosition.y) > NGPrefsWindow.AutoRestoreLabelWidthThreshold)
                {
                    this.labelWidth = this.originLabelWidth;
                }
                else
                {
                    this.labelWidth = Mathf.Clamp(this.originLabelWidth - this.originPositionX + Event.current.mousePosition.x, NGPrefsWindow.MinLabelWidth, this.position.width - NGPrefsWindow.MinValueWidth);
                }
                Event.current.Use();
            }
            else if (Event.current.type == EventType.MouseDown &&
                     r.Contains(Event.current.mousePosition) == true)
            {
                this.originPositionX     = Event.current.mousePosition.x;
                this.originLabelWidth    = this.labelWidth;
                this.draggingSplitterBar = true;
                Event.current.Use();
            }
            else if (this.draggingSplitterBar == true &&
                     Event.current.type == EventType.MouseUp)
            {
                // Auto adjust height on left click or double click.
                if (r.Contains(Event.current.mousePosition) == true &&
                    (Event.current.button == 1 ||
                     (this.lastClick + Constants.DoubleClickTime > EditorApplication.timeSinceStartup &&
                      Mathf.Abs(this.originPositionX - Event.current.mousePosition.x) < 5F)))
                {
                    this.labelWidth = EditorGUIUtility.labelWidth;
                }
                this.lastClick           = EditorApplication.timeSinceStartup;
                this.draggingSplitterBar = false;
                Event.current.Use();
            }

            r.width = this.position.width - r.x;
            EditorGUI.LabelField(r, LC.G("NGPrefs_Value"), GeneralStyles.CenterText);

            r.x     = 0F;
            r.y    += r.height + 1F;
            r.width = this.position.width;

            r.height = 1F;
            EditorGUI.DrawRect(r, NGPrefsWindow.ColumnHeaderBackgroundColor);

            r.y     += 3F;
            r.height = this.position.height - r.y;

            this.bodyRect = r;

            Rect viewRect = new Rect();

            viewRect.height = this.filteredIndexes.Count * Constants.SingleLineHeight;
            viewRect.width  = r.width - (viewRect.height >= this.bodyRect.height ? 15F : 0F);

            using (LabelWidthRestorer.Get(this.labelWidth))
            {
                this.scrollPosition = GUI.BeginScrollView(r, this.scrollPosition, viewRect);
                {
                    r.y      = 0F;
                    r.height = Constants.SingleLineHeight;
                    r.width -= viewRect.height >= this.bodyRect.height ? 15F : 0F;

                    this.OnGUIPreferences(r);
                }
                GUI.EndScrollView();
            }
        }
Esempio n. 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();
        }