Exemplo n.º 1
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();
            }
        }
Exemplo n.º 2
0
        private void OnGUI()
        {
            if (isDockedInfo == null)
            {
                return;
            }

            if (SearchTerms == "`" ||
                (MonKeyInternalSettings.Instance.UseCustomConsoleKey &&
                 SearchTerms == MonKeyInternalSettings.Instance.MonkeyConsoleOverrideHotKey))
            {
                ResetSearchTerms();

                /*if (!JustOpenedActiveMode)
                 *  CloseOrSetInactive();*/
            }

            HotKeysManager.CheckCustomHotKey();

            HandleMouse();

            MonkeyStyle.Instance.InitDefaultStyle();
            GUI.skin = MonkeyStyle.Instance.DefaultStyle;

            if (TabFrames > 0)
            {
                TabFrames--;
                Focus();
            }

            if (!CurrentPanel)
            {
                //   ToggleMonkeyPanel();
                //not sure why needed now, tbc
                return;
            }

            if (!Focused)
            {
                if ((!IsDocked && !MonKeyInternalSettings.Instance.PreventFocusOnPopup) ||
                    (isActiveMode && MonKeyInternalSettings.Instance.ForceFocusOnDocked))
                {
                    Focus();
                }
            }

            if (!isActiveMode)
            {
                if (Event.current.type == EventType.MouseDown)
                {
                    Event.current.Use();
                    ToggleMonkeyPanel();
                    Repaint();
                    return;
                }

                try
                {
                    SleepingMonkeyPanelDisplay.DisplaySleepingMonkey();
                    // OnGUIActiveMode();
                    if (CommandManager.Instance.IsLoading)
                    {
                        LoadingNoticeDisplay.DisplayLoadingNotice(this);
                    }
                }
                catch (Exception e)
                {
                    if (LogExceptions)
                    {
                        Debug.Log(e);
                    }
                    GUIUtility.ExitGUI();
                }

                return;
            }

            OnGUIActiveMode();
        }