Ejemplo n.º 1
0
        internal static void DisplayParametricPanel(CommandConsoleWindow window)
        {
            try
            {
                if (Event.current.type == EventType.MouseDown)
                {
                    window.Repaint();
                    window.Focus();
                    window.TabFrames = 10;
                }

                CommandConsoleWindow.RowHeight = new Rect(0, 0, 0, 0.55f);

                DisplayCommandInfo(window.CurrentExecution);

                Rect selectedRect = new Rect();
                if (window.CurrentExecution.Info.CommandParameterInfo.Count > 1)
                {
                    selectedRect = DisplayParameterTabs(window);
                }

                window.CheckSearch();

                if (window.CurrentExecution.CurrentParameterInfo != null)
                {
                    DisplayParameterPanel(window);
                }

                if (window.CurrentExecution.Info.CommandParameterInfo.Count > 1)
                {
                    DisplayTabLink(selectedRect);
                }

                DisplayBottomHelp(window);
            }
            catch (Exception e)
            {
                if (CommandConsoleWindow.LogExceptions)
                {
                    Debug.Log(e);
                }
                GUIUtility.ExitGUI();
            }
        }
Ejemplo n.º 2
0
        internal static void DisplayCommandPanel(CommandConsoleWindow window)
        {
            try
            {
                if (Event.current.type == EventType.MouseDown)
                {
                    window.Repaint();
                    window.Focus();
                    return;
                }

                DisplayCommandSearchPanel(window);

                if (CommandManager.Instance.IsLoading)
                {
                    LoadingNoticeDisplay.DisplayLoadingNotice(window);
                }
            }
            catch (Exception e)
            {
                if (CommandConsoleWindow.LogExceptions)
                {
                    Debug.LogWarning(e);
                }
                GUIUtility.ExitGUI();
            }

            window.CheckSearch();

            try
            {
                DisplayCommandResultPanel(window);
                DisplayCommandSearchHelp(window);
            }
            catch (Exception e)
            {
                if (CommandConsoleWindow.LogExceptions)
                {
                    Debug.LogWarning(e);
                }
                GUIUtility.ExitGUI();
            }
        }
Ejemplo n.º 3
0
        private static void DisplayAutoCompleteSection(CommandConsoleWindow window,
                                                       string controlName)
        {
            ParametricCommandExecution exec = window.CurrentExecution;

            GUILayout.BeginVertical(MonkeyStyle.Instance.SearchLabelGroupStyle);


            if (exec.IsArray && exec.CurrentTextEntered.IsNullOrEmpty() &&
                exec.CurrentAutoCompleteID == -1)
            {
                if (exec.HasNextVariable)
                {
                    GUILayout.Label("Press TAB or ENTER to go to the next variable",
                                    MonkeyStyle.Instance.VariableTypeTextStyle, GUILayout.ExpandWidth(true));
                }
                else
                {
                    GUILayout.Label("Press TAB or ENTER to go to execute the command",
                                    MonkeyStyle.Instance.VariableTypeTextStyle, GUILayout.ExpandWidth(true));
                }
            }

            GUILayout.BeginHorizontal(MonkeyStyle.Instance.SearchLabelStyle);
            GUILayout.BeginHorizontal(MonkeyStyle.Instance.AutoCompleteSearchLabelGroupStyle);

            DisplayInstructionOrDefault(window, exec);

            GUI.SetNextControlName(controlName);
            window.SearchTerms = EditorGUIExt.TextField(window.SearchTerms, controlName,
                                                        MonkeyStyle.Instance.SearchLabelStyle);

            if (!window.IsDocked || window.JustOpenedActiveMode ||
                window.PreventSearchMovement || window.Focused)
            {
                if (window.PreventSearchMovement)
                {
                    CommandConsoleWindow.ForceEditSearchAtEnd(window.SearchTerms);
                }
                window.Focus();

                GUI.FocusControl(controlName);
            }

            //    GUILayout.FlexibleSpace();

            GUILayout.EndHorizontal();

            GUILayout.EndHorizontal();

            ComputeDragAndDrop(window);

            GUILayout.BeginVertical(GUILayout.ExpandWidth(true));

            DisplayAutoCompleteOptions(window);

            GUILayout.EndVertical();

            GUILayout.FlexibleSpace();

            GUILayout.EndVertical();
        }