Esempio n. 1
0
    /// <summary>
    /// Rendering controls at the end of the main panel
    /// </summary>
    protected override void RenderExtendedOptions()
    {
        base.RenderExtendedOptions();

        ///* panel start */
        LoginSettingsVisible = _panelRenderer.RenderStart(_panelHeader, LoginSettingsVisible);
        // NOTE: in eDriven.Gui 1.6 PanelRenderer.RenderStart is not public. Will be fixed in 1.7

        if (LoginSettingsVisible)
        {
            LabelWidth.intValue       = EditorGUILayout.IntField("Label Width", LabelWidth.intValue);
            Username.stringValue      = EditorGUILayout.TextField("Username", Username.stringValue);
            Password.stringValue      = EditorGUILayout.TextField("Password", Password.stringValue);
            UsernameLabel.stringValue = EditorGUILayout.TextField("Username Label", UsernameLabel.stringValue);
            PasswordLabel.stringValue = EditorGUILayout.TextField("Password Label", PasswordLabel.stringValue);
            SubmitText.stringValue    = EditorGUILayout.TextField("Submit text", SubmitText.stringValue);
            SendMode.enumValueIndex   = (int)(SendMode)EditorGUILayout.EnumPopup(
                "SendMode",
                (SendMode)Enum.GetValues(typeof(SendMode)).GetValue(SendMode.enumValueIndex)
                );

            EditorGUILayout.Space();

            /* panel end */
            _panelRenderer.RenderEnd();
            // NOTE: in eDriven.Gui 1.6 PanelRenderer.RenderEnd is not public. Will be fixed in 1.7
        }
    }
Esempio n. 2
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            //DrawHeader();

            InspectorContentWrapper.Start();

            /*EditorSettings.ComponentDescriptorMainExpanded =*/

            Expanded = _mainPanelRenderer.RenderStart(GuiContentCache.Instance.FontMapperEditor, Expanded);

            if (Expanded)
            {
                DrawDefaultInspector();
                _mainPanelRenderer.RenderEnd();
            }

            /**
             * The order of applying the propertis MUST be as follows:
             * 1. Applying modified properties by inspector (serializedObject.ApplyModifiedProperties())
             * 2. Applying changes made in play mode
             * This is because serializedObject.ApplyModifiedProperties() re-applies the properties when back from play mode
             * */
            serializedObject.ApplyModifiedProperties();
            //PersistenceManager.Instance.CallApplyChanges();
            //PersistenceManager.Instance.ApplyChanges();

            InspectorContentWrapper.End();

            if (Event.current.type == EventType.MouseMove)
            {
                Repaint();
            }
        }
Esempio n. 3
0
// ReSharper disable UnusedMember.Local
        void OnGUI()
        {
// ReSharper restore UnusedMember.Local
            //GUILayout.Space(-5);

            DialogContentWrapper.Start();

            _panelRenderer.ChromeStyle = StyleCache.Instance.PanelChromeSquared; // only OnGUI

            _panelRenderer.RenderStart(new GUIContent("Add Child", TextureCache.Instance.Add), true);
            ShowHelp = _panelRenderer.ClickedTools.Contains("help");
            EditorSettings.ShowAddChildOptions = _panelRenderer.ClickedTools.Contains("options");

            Toolbox.Instance.Render();

            _panelRenderer.RenderEnd();

            //GUILayout.Space(3);
            DialogContentWrapper.End();

            if (Event.current.type == EventType.MouseMove)
            {
                Repaint();
            }
        }
Esempio n. 4
0
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            InspectorContentWrapper.Start();

            /*EditorSettings.ComponentDescriptorMainExpanded =*/
            Expanded = _mainPanelRenderer.RenderStart(EditorPanelTitle, Expanded);

            if (Expanded)
            {
                RenderMainOptions();
                _mainPanelRenderer.RenderEnd();
            }
            else
            {
                BlankCallback();
            }

            RenderExtendedOptions();

            /**
             * The order of applying the propertis MUST be as follows:
             * 1. Applying modified properties by inspector (serializedObject.ApplyModifiedProperties())
             * 2. Applying changes made in play mode
             * This is because serializedObject.ApplyModifiedProperties() re-applies the properties when back from play mode
             * */
            serializedObject.ApplyModifiedProperties();
            //PersistenceManager.Instance.CallApplyChanges();
            //PersistenceManager.Instance.ApplyChanges();

            if (AutoConfigure)
            {
                if (GUI.changed)
                {
#if DEBUG
                    if (DebugMode)
                    {
                        Debug.Log("GUI.changed: " + GUI.changed + " target: " + target);
                    }
#endif
                    Apply();
                }
            }

            InspectorContentWrapper.End();

            if (Event.current.type == EventType.MouseMove)
            {
                Repaint();
            }
        }
// ReSharper disable UnusedMember.Local
        void OnGUI()
        {
// ReSharper restore UnusedMember.Local

            DialogContentWrapper.Start();

            /**
             * 1. Panel start
             * */
            //_panelRenderer.RenderStart(GuiContentCache.Instance.CreateEventHandler, true);
            _panelRenderer.RenderStart(new GUIContent(_titles[_step], TextureCache.Instance.EventHandlerAddMapping), true);

            ShowHelp = _panelRenderer.ClickedTools.Contains("help");

            //GUILayout.Space(3);

            /**
             * 1a. Render breadcrumbs
             * */
            GUI.enabled = false;
            _breadcrumbs.Render();
            GUI.enabled = true;

            GUILayout.Space(6);

            /**
             * 2. Render current step
             * */
            _renderers[_step].Render();

            /**
             * 3. Render buttons
             * */
            RenderButtons();

            GUILayout.Space(3);

            /**
             * 4. Panel end
             * */
            _panelRenderer.RenderEnd();

            DialogContentWrapper.End();

            if (Event.current.type == EventType.MouseMove)
            {
                Repaint();
            }
        }
        public override void OnInspectorGUI()
        {
            serializedObject.Update();

            //DrawHeader();

            InspectorContentWrapper.Start();

            /*EditorSettings.ComponentDescriptorMainExpanded =*/

            Expanded = _mainPanelRenderer.RenderStart(GuiContentCache.Instance.AudioPlayerMapperEditor, Expanded);

            if (Expanded)
            {
                Default.boolValue = EditorGUILayout.Toggle("Default", Default.boolValue);

                Id.stringValue = EditorGUILayout.TextField("Id", Id.stringValue);

                PlayAtMainCamera.boolValue = EditorGUILayout.Toggle("PlayAtMainCamera", PlayAtMainCamera.boolValue);

                SoundEnabled.boolValue = EditorGUILayout.Toggle("SoundEnabled", SoundEnabled.boolValue);

                Volume.floatValue = EditorGUILayout.Slider("Volume", Volume.floatValue, 0, 1);
                ProgressBar(Volume.floatValue, "Volume");

                Pitch.floatValue = EditorGUILayout.Slider("Pitch", Pitch.floatValue, 0, 10);

                PitchRandomness.floatValue = EditorGUILayout.Slider("PitchRandomness", PitchRandomness.floatValue, 0, 1);

                /**
                 * The order of applying the propertis MUST be as follows:
                 * 1. Applying modified properties by inspector (serializedObject.ApplyModifiedProperties())
                 * 2. Applying changes made in play mode
                 * This is because serializedObject.ApplyModifiedProperties() re-applies the properties when back from play mode
                 * */
                serializedObject.ApplyModifiedProperties();

                _mainPanelRenderer.RenderEnd();
            }

            InspectorContentWrapper.End();

            if (Event.current.type == EventType.MouseMove)
            {
                Repaint();
            }
        }
// ReSharper disable UnusedMember.Local
// ReSharper disable once InconsistentNaming
        void OnGUI()
// ReSharper restore UnusedMember.Local
        {
            EditorWindowContentWrapper.Start();

            if (null == PanelRenderer.ChromeStyle)
            {
                PanelRenderer.ChromeStyle = StyleCache.Instance.PanelChromeSquared;
            }

            PanelRenderer.RenderStart(GuiContentCache.Instance.ReferencePanelTitle, true);

            PanelContentWrapper.Start();

            ShowHelp = PanelRenderer.ClickedTools.Count > 0 && PanelRenderer.ClickedTools.Contains("help");

            if (ShowHelp)
            {
                EditorGUILayout.HelpBox(Help.ReferenceWindow, MessageType.Info, true);
            }

            switch (EditorSettings.ReferenceTabIndex)
            {
            case 0:
                RenderSearch();
                break;

            case 1:
                RenderDescription();
                break;
            }

            PanelContentWrapper.End();

            PanelRenderer.RenderEnd();

            GUILayout.Space(2);

            EditorWindowContentWrapper.End();
        }
// ReSharper disable UnusedMember.Local
// ReSharper disable InconsistentNaming
        void OnGUI()
        {
// ReSharper restore InconsistentNaming
// ReSharper restore UnusedMember.Local

            DialogContentWrapper.Start();

            /**
             * 1. Panel start
             * */
            _panelRenderer.RenderStart(new GUIContent(_titles[_step], TextureCache.Instance.StyleDeclarationAdd), true);

            ShowHelp = _panelRenderer.ClickedTools.Contains("help");

            /**
             * 2. Render the current step
             * */
            _renderers[_step].Render();

            /**
             * 3. Render buttons
             * */
            RenderButtons();

            GUILayout.Space(3);

            /**
             * 4. Panel end
             * */
            _panelRenderer.RenderEnd();

            DialogContentWrapper.End();

            if (Event.current.type == EventType.MouseMove)
            {
                Repaint();
            }
        }
Esempio n. 9
0
// ReSharper disable UnusedMember.Local
        void OnGUI()
        {
// ReSharper restore UnusedMember.Local

            DialogContentWrapper.Start();

            if (null == _panelRenderer.ChromeStyle)
            {
                _panelRenderer.ChromeStyle = StyleCache.Instance.PanelChromeSquared; // only OnGUI
            }
            _panelRenderer.RenderStart(GuiContentCache.Instance.OptionsPanelTitle, true);

            OptionsBox.Instance.Render();

            _panelRenderer.RenderEnd();

            DialogContentWrapper.End();

            if (Event.current.type == EventType.MouseMove)
            {
                Repaint();
            }
        }
Esempio n. 10
0
// ReSharper disable UnusedMember.Local
// ReSharper disable InconsistentNaming
        void OnGUI()
        {
// ReSharper restore InconsistentNaming
// ReSharper restore UnusedMember.Local

            DialogContentWrapper.Start();

            bool changed = false;

            if (_renderers.Count == 0)
            {
                _panelRenderer.RenderStart(new GUIContent("No new updates", TextureCache.Instance.CheckForUpdates), true);

                if (_categories.Count > 1)
                {
                    changed = RenderCategories();
                }

                EditorGUILayout.BeginVertical(StyleCache.Instance.ScrollviewBackground, GUILayout.ExpandWidth(true));

                GUILayout.Label(GuiContentCache.Instance.NoUpdatesFound, StyleCache.Instance.CenteredLabel, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));

                EditorGUILayout.EndVertical();  // panel chrome

                //GUILayout.Space(3);

                _panelRenderer.RenderEnd();
            }

            else
            {
//                if (_step > _renderers.Count-1)
//                    return;

                /**
                 * 1. Panel start
                 * */
                _panelRenderer.RenderStart(new GUIContent(_titles[_step], TextureCache.Instance.CheckForUpdates), true);

                if (_categories.Count > 1)
                {
                    changed = RenderCategories();
                }

                //GUILayout.Space(3);

                /**
                 * 2. Render current step
                 * */
                _renderers[_step].Render();

                /**
                 * 3. Render buttons
                 * */
                if (_renderers.Count > 0)
                {
                    RenderButtons();
                }

                GUILayout.Space(3);

                /**
                 * 4. Panel end
                 * */
                _panelRenderer.RenderEnd();

                //GUILayout.Label("Max: " + _maxMessageId);
            }

            DialogContentWrapper.End();

            if (Event.current.type == EventType.MouseMove)
            {
                Repaint();
            }

            if (changed)
            {
                //Debug.Log("Category changed");
                UpdateDisplay();
            }
        }
Esempio n. 11
0
        protected override void RenderExtendedOptions()
        {
            if (!IsHidden(SIZING))
            {
                EditorSettings.ComponentDescriptorSizingExpanded = _sizingPanelRenderer.RenderStart(GuiContentCache.Instance.PanelPositionAndSizingTitle, EditorSettings.ComponentDescriptorSizingExpanded);

                if (EditorSettings.ComponentDescriptorSizingExpanded)
                {
                    if (!AdapterAnalysis.ParentHasAbsoluteLayout)
                    {
                        EditorGUILayout.HelpBox("Note: Positioning (X, Y) has no effect unless the parent container has absolute layout", MessageType.Info);
                    }

                    UseX.boolValue = _insetXRenderer.RenderStart("X", UseX.boolValue);

                    if (UseX.boolValue)
                    {
                        EditorGUILayout.BeginHorizontal();
                        //GUILayout.Label("X", GUILayout.MinWidth(80));
                        X.intValue = EditorGUILayout.IntSlider(string.Empty, X.intValue, 0, 2000);
                        EditorGUILayout.EndHorizontal();
                        _insetXRenderer.RenderEnd();
                    }
                    //EditorGUILayout.EndToggleGroup();

                    UseY.boolValue = _insetYRenderer.RenderStart("Y", UseY.boolValue);
                    if (UseY.boolValue)
                    {
                        EditorGUILayout.BeginHorizontal();
                        //GUILayout.Label("Y", GUILayout.MinWidth(80));
                        Y.intValue = EditorGUILayout.IntSlider(string.Empty, Y.intValue, 0, 2000);
                        EditorGUILayout.EndHorizontal();
                        _insetYRenderer.RenderEnd();
                    }

                    //EditorGUILayout.EndToggleGroup();

                    EditorGUILayout.Space();

                    EditorGUI.indentLevel = 0;

                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Label("Min Width", GUILayout.MinWidth(80));
                    MinWidth.intValue = EditorGUILayout.IntSlider(string.Empty, MinWidth.intValue, 0, GlobalMaxWidth);
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Label("Max Width", GUILayout.MinWidth(80));
                    MaxWidth.intValue = EditorGUILayout.IntSlider(string.Empty, MaxWidth.intValue, 0, GlobalMaxWidth);
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.Space();

                    UseWidth.boolValue = _insetExplicitWidthRenderer.RenderStart("Explicit Width", UseWidth.boolValue);
                    //UseWidth.boolValue = GUILayout.Toggle(UseWidth.boolValue,
                    //                                 new GUIContent("Explicit Width", "Explicit Width"),
                    //                                 StyleCache.Instance.GreenToggle, GUILayout.Height(24));

                    //UseWidth.boolValue = EditorGUILayout.BeginToggleGroup("Explicit Width", UseWidth.boolValue);
                    if (UseWidth.boolValue)
                    {
                        //EditorGUILayout.BeginVertical(StyleCache.Instance.InsetHeaderCollapsed);

                        EditorGUI.indentLevel = 1;
                        EditorGUILayout.BeginHorizontal();
                        GUILayout.Label("Use % of the parent", GUILayout.ExpandWidth(false));
                        UsePercentWidth.boolValue = EditorGUILayout.Toggle(string.Empty, UsePercentWidth.boolValue, GUILayout.MinWidth(80));
                        EditorGUILayout.EndHorizontal();

                        EditorGUILayout.BeginHorizontal();
                        GUILayout.Label(UsePercentWidth.boolValue ? "Percent Width" : "Width", GUILayout.MinWidth(80));
                        Width.intValue = EditorGUILayout.IntSlider(string.Empty, Width.intValue, 0, UsePercentWidth.boolValue ? 100 : GlobalMaxWidth);
                        EditorGUILayout.EndHorizontal();

                        EditorGUI.indentLevel = 0;

                        //EditorGUILayout.EndVertical();

                        _insetYRenderer.RenderEnd();
                    }
                    //EditorGUILayout.EndToggleGroup();

                    EditorGUILayout.Space();

                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Label("Min Height", GUILayout.MinWidth(80));
                    MinHeight.intValue = EditorGUILayout.IntSlider(string.Empty, MinHeight.intValue, 0, GlobalMaxHeight);
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.BeginHorizontal();
                    GUILayout.Label("Max Height", GUILayout.MinWidth(80));
                    MaxHeight.intValue = EditorGUILayout.IntSlider(string.Empty, MaxHeight.intValue, 0, GlobalMaxHeight);
                    EditorGUILayout.EndHorizontal();

                    EditorGUILayout.Space();

                    UseHeight.boolValue = _insetExplicitHeightRenderer.RenderStart("Explicit Height", UseHeight.boolValue);
                    //UseHeight.boolValue = GUILayout.Toggle(UseHeight.boolValue,
                    //                                 new GUIContent("Explicit Height", "Explicit Height"),
                    //                                 StyleCache.Instance.GreenToggle, GUILayout.Height(24));
                    //UseHeight.boolValue = EditorGUILayout.BeginToggleGroup("Explicit Height", UseHeight.boolValue);
                    if (UseHeight.boolValue)
                    {
                        //EditorGUILayout.BeginVertical(StyleCache.Instance.InsetHeaderCollapsed);

                        EditorGUI.indentLevel = 1;
                        EditorGUILayout.BeginHorizontal();
                        GUILayout.Label("Use % of the parent", GUILayout.ExpandWidth(false));
                        UsePercentHeight.boolValue = EditorGUILayout.Toggle(string.Empty, UsePercentHeight.boolValue);
                        EditorGUILayout.EndHorizontal();

                        EditorGUILayout.BeginHorizontal();
                        GUILayout.Label(UsePercentHeight.boolValue ? "Percent Height" : "Height", GUILayout.MinWidth(80));
                        Height.intValue = EditorGUILayout.IntSlider(string.Empty, Height.intValue, 0, UsePercentHeight.boolValue ? 100 : GlobalMaxHeight);
                        EditorGUILayout.EndHorizontal();

                        EditorGUI.indentLevel = 0;

                        //EditorGUILayout.EndVertical();

                        _insetExplicitHeightRenderer.RenderEnd();
                    }
                    //EditorGUILayout.EndToggleGroup();

                    //EditorGUILayout.Space();
                    GUILayout.Space(1);

                    _sizingPanelRenderer.RenderEnd();
                }
                EditorGUI.indentLevel = 0;
            }

            if (!IsHidden(CONSTRAINS))
            {
                EditorSettings.ComponentDescriptorConstrainsExpanded = _constrainsPanelRenderer.RenderStart(GuiContentCache.Instance.PanelConstrainsTitle, EditorSettings.ComponentDescriptorConstrainsExpanded);

                //_showSizing.boolValue = EditorGUILayout.Foldout(_showSizing.boolValue, "Position and sizing");
                if (EditorSettings.ComponentDescriptorConstrainsExpanded)
                {
                    //Debug.Log("_containerHasAbsoluteLayout: " + _containerHasAbsoluteLayout);
                    if (!AdapterAnalysis.ParentHasAbsoluteLayout)
                    {
                        EditorGUILayout.HelpBox("Note: Constrains have no effect unless the parent container has absolute layout", MessageType.Info);
                    }

                    UseLeft.boolValue = _insetLeftRenderer.RenderStart("Left", UseLeft.boolValue);
                    //UseLeft.boolValue = GUILayout.Toggle(UseLeft.boolValue,
                    //                                 new GUIContent("Left", "Constrain to left"),
                    //                                 StyleCache.Instance.GreenToggle, GUILayout.Height(24));

                    //UseLeft.boolValue = EditorGUILayout.BeginToggleGroup("Left", UseLeft.boolValue);
                    if (UseLeft.boolValue)
                    {
                        //EditorGUILayout.BeginVertical(StyleCache.Instance.InsetHeaderCollapsed);

                        //EditorGUI.indentLevel = 1;
                        Left.intValue = EditorGUILayout.IntSlider(Left.intValue, -GlobalMaxWidth / 2, GlobalMaxWidth / 2);
                        //EditorGUI.indentLevel = 0;

                        //EditorGUILayout.EndVertical();

                        _insetLeftRenderer.RenderEnd();
                    }
                    //EditorGUILayout.EndToggleGroup();

                    UseRight.boolValue = _insetRightRenderer.RenderStart("Right", UseRight.boolValue);
                    //UseRight.boolValue = GUILayout.Toggle(UseRight.boolValue,
                    //                                 new GUIContent("Right", "Constrain to right"),
                    //                                 StyleCache.Instance.GreenToggle, GUILayout.Height(24));
                    //UseRight.boolValue = EditorGUILayout.BeginToggleGroup("Right", UseRight.boolValue);
                    if (UseRight.boolValue)
                    {
                        //EditorGUILayout.BeginVertical(StyleCache.Instance.InsetHeaderCollapsed);

                        //EditorGUI.indentLevel = 1;
                        Right.intValue = EditorGUILayout.IntSlider(Right.intValue, -GlobalMaxWidth / 2, GlobalMaxWidth / 2);
                        //EditorGUI.indentLevel = 0;

                        //EditorGUILayout.EndVertical();

                        _insetRightRenderer.RenderEnd();
                    }
                    //EditorGUILayout.EndToggleGroup();

                    UseTop.boolValue = _insetTopRenderer.RenderStart("Top", UseTop.boolValue);
                    //UseTop.boolValue = GUILayout.Toggle(UseTop.boolValue,
                    //                                 new GUIContent("Top", "Constrain to top"),
                    //                                 StyleCache.Instance.GreenToggle, GUILayout.Height(24));
                    //UseTop.boolValue = EditorGUILayout.BeginToggleGroup("Top", UseTop.boolValue);
                    if (UseTop.boolValue)
                    {
                        //EditorGUILayout.BeginVertical(StyleCache.Instance.InsetHeaderCollapsed);

                        //EditorGUI.indentLevel = 1;
                        Top.intValue = EditorGUILayout.IntSlider(Top.intValue, -GlobalMaxHeight / 2, GlobalMaxHeight / 2);
                        //EditorGUI.indentLevel = 0;

                        //EditorGUILayout.EndVertical();
                        _insetTopRenderer.RenderEnd();
                    }
                    //EditorGUILayout.EndToggleGroup();

                    UseBottom.boolValue = _insetBottomRenderer.RenderStart("Bottom", UseBottom.boolValue);
                    //UseBottom.boolValue = GUILayout.Toggle(UseBottom.boolValue,
                    //                                 new GUIContent("Bottom", "Constrain to bottom"),
                    //                                 StyleCache.Instance.GreenToggle, GUILayout.Height(24));
                    //UseBottom.boolValue = EditorGUILayout.BeginToggleGroup("Bottom", UseBottom.boolValue);
                    if (UseBottom.boolValue)
                    {
                        //EditorGUILayout.BeginVertical(StyleCache.Instance.InsetHeaderCollapsed);

                        //EditorGUI.indentLevel = 1;
                        Bottom.intValue = EditorGUILayout.IntSlider(Bottom.intValue, -GlobalMaxHeight / 2, GlobalMaxHeight / 2);
                        //EditorGUI.indentLevel = 0;

                        //EditorGUILayout.EndVertical();
                        _insetBottomRenderer.RenderEnd();
                    }
                    //EditorGUILayout.EndToggleGroup();

                    UseHorizontalCenter.boolValue = _insetHorizontalCenterRenderer.RenderStart("Horizontal center", UseHorizontalCenter.boolValue);
                    //UseHorizontalCenter.boolValue = GUILayout.Toggle(UseHorizontalCenter.boolValue,
                    //                                 new GUIContent("Horizontal center", "Horizontal center"),
                    //                                 StyleCache.Instance.GreenToggle, GUILayout.Height(24));
                    //UseHorizontalCenter.boolValue = EditorGUILayout.BeginToggleGroup("Horizontal center", UseHorizontalCenter.boolValue);
                    if (UseHorizontalCenter.boolValue)
                    {
                        //EditorGUILayout.BeginVertical(StyleCache.Instance.InsetHeaderCollapsed);

                        //EditorGUI.indentLevel = 1;
                        HorizontalCenter.intValue = EditorGUILayout.IntSlider(HorizontalCenter.intValue, -GlobalMaxWidth / 2, GlobalMaxWidth / 2);
                        //EditorGUI.indentLevel = 0;

                        //EditorGUILayout.EndVertical();
                        _insetHorizontalCenterRenderer.RenderEnd();
                    }
                    //EditorGUILayout.EndToggleGroup();

                    UseVerticalCenter.boolValue = _insetVerticalCenterRenderer.RenderStart("Vertical center", UseVerticalCenter.boolValue);
                    //UseVerticalCenter.boolValue = GUILayout.Toggle(UseVerticalCenter.boolValue,
                    //                                 new GUIContent("Vertical center", "Vertical center"),
                    //                                 StyleCache.Instance.GreenToggle, GUILayout.Height(24));
                    //UseVerticalCenter.boolValue = EditorGUILayout.BeginToggleGroup("Vertical center", UseVerticalCenter.boolValue);
                    if (UseVerticalCenter.boolValue)
                    {
                        //EditorGUILayout.BeginVertical(StyleCache.Instance.InsetHeaderCollapsed);

                        //EditorGUI.indentLevel = 1;
                        VerticalCenter.intValue = EditorGUILayout.IntSlider(VerticalCenter.intValue, -GlobalMaxHeight / 2, GlobalMaxHeight / 2);
                        //EditorGUI.indentLevel = 0;

                        //EditorGUILayout.EndVertical();

                        _insetVerticalCenterRenderer.RenderEnd();
                    }
                    //EditorGUILayout.EndToggleGroup();
                    GUILayout.Space(1);

                    _constrainsPanelRenderer.RenderEnd();
                }
                EditorGUI.indentLevel = 0;
            }

            /*if (!IsHidden(PADDING))
             * {
             *  EditorSettings.ComponentDescriptorPaddingExpanded = _paddingPanelRenderer.RenderStart(GuiContentCache.Instance.PanelPaddingTitle, EditorSettings.ComponentDescriptorPaddingExpanded);
             *
             *  if (EditorSettings.ComponentDescriptorPaddingExpanded && AdapterAnalysis.HasAbsoluteLayout)
             *      EditorGUILayout.HelpBox("Note: Padding has no effect if the container has absolute layout", MessageType.Info);
             *
             *  if (EditorSettings.ComponentDescriptorPaddingExpanded)
             *  {
             *      SynchronizedBlock.Render(SyncPadding, PaddingLeft, PaddingRight, PaddingTop, PaddingBottom, ref _prevPaddingLeft, ref _prevPaddingRight, ref _prevPaddingTop, ref _prevPaddingBottom);
             *      EditorGUILayout.Space();
             *      _paddingPanelRenderer.RenderEnd();
             *  }
             * }*/

            /*if (!IsHidden(MARGINS))
             * {
             *  _showMargins.boolValue = EditorGUILayout.Foldout(_showMargins.boolValue, "Margins");
             *  if (_showMargins.boolValue)
             *  {
             *      SynchronizedBlock.Render(SyncMargins, MarginLeft, MarginRight, MarginTop, MarginBottom, ref _prevMarginLeft, ref _prevMarginRight, ref _prevMarginTop, ref _prevMarginBottom);
             *      EditorGUILayout.Space();
             *  }
             * }*/
        }
Esempio n. 12
0
        void OnGUI()
// ReSharper restore UnusedMember.Local
        {
            // Note: properties have to be commited prior to Render
            // or else, we get the "ArgumentException: Getting control 2's position in a group with only 2 controls when doing Repaint" error
            if (_propertiesInvalidated)
            {
                CommitProperties();
            }

            EditorWindowContentWrapper.Start();

            if (null == PanelRenderer.ChromeStyle)
            {
                PanelRenderer.ChromeStyle = StyleCache.Instance.PanelChromeSquared;
            }

            PanelRenderer.RenderStart(GuiContentCache.Instance.MainPanelTitle, true);

            if (PanelRenderer.ClickedTools.Count > 0)
            {
                if (PanelRenderer.ClickedTools.Contains("info"))
                {
                    PanelRenderer.ClickedTools.Remove("info");
                    AboutDialog.Instance.ShowUtility(); //ShowAuxWindow();
                }
                if (PanelRenderer.ClickedTools.Contains("options"))
                {
                    PanelRenderer.ClickedTools.Remove("options");
                    OptionsDialog.Instance.ShowUtility();
                }
            }

            #region Handling bounds

// ReSharper disable CompareOfFloatsByEqualityOperator
            if (_bounds.width != position.width || _bounds.height != position.height)
// ReSharper restore CompareOfFloatsByEqualityOperator
            {
                HandleBounds(position);
                _bounds = position;
                //Toolbox.Instance.Width = position.width;
            }

            #endregion

            /**
             * 1. Help
             * */
            if (PanelRenderer.ClickedTools.Contains("help"))
            {
                // info image
                EditorGUILayout.BeginHorizontal();
                GUILayout.FlexibleSpace();
                GUILayout.Label(new GUIContent(TextureCache.Instance.PlayModeGameViewInfo), GUILayout.ExpandWidth(false));
                GUILayout.FlexibleSpace();
                EditorGUILayout.EndHorizontal();

                GUILayout.Space(1);

                EditorGUILayout.HelpBox(Help.Main, MessageType.Info, true);
            }

            /**
             * 2. Toolbar with buttons
             * */
            Toolbar.Instance.Render();
            GUILayout.Space(5);

            /**
             * 3. Breadcrumbs
             * */
            if (null != Selection.activeGameObject)
            {
                BreadcrumbsMain.Instance.Render();
                GUILayout.Space(5);
            }

            /**
             * 4. Tabs
             * */
            MainTabBar.Instance.Render();

            /**
             * 5. Display
             * */
            EditorGUILayout.BeginVertical(StyleCache.Instance.TabBackground, GUILayout.ExpandHeight(true));

            if (_showLogo)
            {
                _logoScrollPosition = EditorGUILayout.BeginScrollView(_logoScrollPosition);
                GUILayout.Label(TextureCache.Instance.Logo, StyleCache.Instance.CenteredLabel, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
                EditorGUILayout.EndScrollView();
            }
            else
            {
                switch (MainTabBar.Instance.TabIndex)
                {
                case ORDER_DISPLAY:
                    OrderDisplay.Instance.Render();
                    break;

                case LAYOUT_DISPLAY:
                    LayoutDisplay.Instance.Render();
                    break;

                case EVENTS_DISPLAY:
                    EventDisplay.Instance.Render();
                    break;
                }
            }

            EditorGUILayout.EndVertical();
            GUILayout.Space(2);

            PanelRenderer.RenderEnd();

            EditorWindowContentWrapper.End();

            if (GUI.changed && _showLogo)
            {
                _showLogo = false;
            }

            if (UpdateCheck.Instance.DataReady)
            {
                UpdateCheck.Instance.ShowDialog();
            }
        }
Esempio n. 13
0
// ReSharper disable UnusedMember.Local
        void OnGUI()
// ReSharper restore UnusedMember.Local
        {
            if (_doFocusOut)
            {
                _doFocusOut = false;
                GUIUtility.keyboardControl = 0;
            }

            EditorWindowContentWrapper.Start();

            if (null == PanelRenderer.ChromeStyle)
            {
                PanelRenderer.ChromeStyle = StyleCache.Instance.PanelChromeSquared;
            }

            PanelRenderer.RenderStart(GuiContentCache.Instance.PersistenceDebuggerPanelTitle, true);

            PanelContentWrapper.Start();

            if (PanelRenderer.ClickedTools.Count > 0)
            {
                if (PanelRenderer.ClickedTools.Contains("options"))
                {
                    PanelRenderer.ClickedTools.Remove("options");
                }
                ShowHelp = PanelRenderer.ClickedTools.Contains("help");
            }
            else
            {
                ShowHelp = false;
            }

            if (ShowHelp)
            {
                EditorGUILayout.HelpBox(Help.PersistenceDebugWindow, MessageType.Info, true);
            }

            EditorGUILayout.BeginHorizontal(StyleCache.Instance.Toolbar, GUILayout.Height(35));

            #region Refresh

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            if (GUILayout.Button(GuiContentCache.Instance.Refresh, StyleCache.Instance.Button,
                                 GUILayout.ExpandWidth(false), GUILayout.Height(30)))
            {
                GUIUtility.keyboardControl = 0;
                ProcessInfo();
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            #region Abandon chages

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            if (GUILayout.Button(GuiContentCache.Instance.AbandonChanges, StyleCache.Instance.Button,
                                 GUILayout.ExpandWidth(false), GUILayout.Height(30)))
            {
                PersistenceManager.Instance.AbandonChanges();
                HierarchyChangeProcessor.Instance.Reset();
                ProcessInfo();
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            #region Copy

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            if (GUILayout.Button(GuiContentCache.Instance.CopyToClipboard, StyleCache.Instance.Button,
                                 GUILayout.ExpandWidth(false), GUILayout.Height(30)))
            {
                GUIUtility.keyboardControl = 0;
                TextEditor te = new TextEditor {
                    content = new GUIContent(_text)
                };
                te.SelectAll();
                te.Copy();
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            GUILayout.FlexibleSpace();

            #region Auto-update

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            bool oldAutoUpdate = GUILayout.Toggle(EditorSettings.PersistenceWindowAutoUpdate,
                                                  EditorSettings.PersistenceWindowAutoUpdate ? GuiContentCache.Instance.AutoUpdateOn : GuiContentCache.Instance.AutoUpdateOff,
                                                  StyleCache.Instance.Toggle,
                                                  GUILayout.ExpandWidth(false), GUILayout.Height(30));

            if (EditorSettings.PersistenceWindowAutoUpdate != oldAutoUpdate)
            {
                GUIUtility.keyboardControl = 0;
                EditorSettings.PersistenceWindowAutoUpdate = oldAutoUpdate;
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            #region Write to log

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            bool oldWriteToLog = GUILayout.Toggle(EditorSettings.PersistenceWindowWriteToLog,
                                                  GuiContentCache.Instance.WriteToLog, StyleCache.Instance.GreenToggle,
                                                  GUILayout.ExpandWidth(false), GUILayout.Height(30));

            if (EditorSettings.PersistenceWindowWriteToLog != oldWriteToLog)
            {
                GUIUtility.keyboardControl = 0;
                EditorSettings.PersistenceWindowWriteToLog = oldWriteToLog;
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            EditorGUILayout.EndHorizontal();

            GUILayout.Space(1);

            _scrollPosition = GUILayout.BeginScrollView(_scrollPosition, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            //GUILayout.Label(_text, StyleCache.Instance.NormalLabel, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));

            GUI.SetNextControlName(TextAreaControlName);
            _textToDisplay = EditorGUILayout.TextArea(_textToDisplay, StyleCache.Instance.RichTextLabel, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));

            bool isInFocus = GUI.GetNameOfFocusedControl() == TextAreaControlName;
            _textToDisplay = isInFocus ? _text : _richText;

            GUILayout.EndScrollView();

            RenderStatus(
                EditorSettings.WatchChanges ?
                (EditorApplication.isPlaying ? "Monitoring..." : "Will monitor in play mode.") :
                "Not monitoring.",
                EditorSettings.WatchChanges && EditorApplication.isPlaying
                );

            PanelContentWrapper.End();

            PanelRenderer.RenderEnd();

            //GUILayout.Space(3);
            EditorWindowContentWrapper.End();
        }
Esempio n. 14
0
// ReSharper disable UnusedMember.Local
        void OnGUI()
// ReSharper restore UnusedMember.Local
        {
            if (_doFocusOut)
            {
                _doFocusOut = false;
                GUIUtility.keyboardControl = 0;
            }

            EditorWindowContentWrapper.Start();

            if (null == PanelRenderer.ChromeStyle)
            {
                PanelRenderer.ChromeStyle = StyleCache.Instance.PanelChromeSquared;
            }

            PanelRenderer.RenderStart(GuiContentCache.Instance.HierarchyDebuggerPanelTitle, true);

            PanelContentWrapper.Start();

            if (PanelRenderer.ClickedTools.Count > 0)
            {
                if (PanelRenderer.ClickedTools.Contains("options"))
                {
                    PanelRenderer.ClickedTools.Remove("options");
                }
                ShowHelp = PanelRenderer.ClickedTools.Contains("help");
            }
            else
            {
                ShowHelp = false;
            }

            if (ShowHelp)
            {
                EditorGUILayout.HelpBox(Help.HierarchyDebugWindow, MessageType.Info, true);
            }

            EditorGUILayout.BeginHorizontal(StyleCache.Instance.Toolbar, GUILayout.Height(35));

            #region Refresh

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            if (GUILayout.Button(GuiContentCache.Instance.Refresh, StyleCache.Instance.Button,
                                 GUILayout.ExpandWidth(false), GUILayout.Height(30)))
            {
                GUIUtility.keyboardControl = 0;
                ProcessInfo();
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            #region Fix

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            /*bool oldEnabled = GUI.enabled;
             * GUI.enabled = !Application.isPlaying;*/
            if (GUILayout.Button(GuiContentCache.Instance.FixHierarchy, StyleCache.Instance.GreenToggle,
                                 GUILayout.ExpandWidth(false), GUILayout.Height(30)))
            {
                var text =
                    @"eDriven will look for adapters present in the hierarchy but not listed in any of the order lists, and add them as list children.

It will also remove adapters not present in the hierarchy from all of the order lists.";

                if (EditorApplication.isPlaying)
                {
                    text += @"

Note: The play mode will be stopped in order to fix the hierarchy.";
                }

                text += @"

Are you sure you want to do this?";

                if (EditorUtility.DisplayDialog("Fix hierarchy?", text, "OK", "Cancel"))
                {
                    if (EditorApplication.isPlaying)
                    {
                        // 1. delay fixing to after the stop
                        EditorState.ShouldFixHierarchyAfterStop = true;
                        // 2. stop the play mode
                        EditorApplication.isPlaying = false;
                    }
                    else // fix immediatelly
                    {
                        FixHierarchy();
                    }
                }
            }
            /*GUI.enabled = oldEnabled;*/

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            #region Copy

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            if (GUILayout.Button(GuiContentCache.Instance.CopyToClipboard, StyleCache.Instance.Button,
                                 GUILayout.ExpandWidth(false), GUILayout.Height(30)))
            {
                GUIUtility.keyboardControl = 0;
                TextEditor te = new TextEditor {
                    content = new GUIContent(_description)
                };
                te.SelectAll();
                te.Copy();
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            GUILayout.FlexibleSpace();

            #region Auto-update

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            bool oldAutoUpdate = GUILayout.Toggle(EditorSettings.HierarchyWindowAutoUpdate,
                                                  EditorSettings.HierarchyWindowAutoUpdate ? GuiContentCache.Instance.AutoUpdateOn : GuiContentCache.Instance.AutoUpdateOff,
                                                  StyleCache.Instance.Toggle,
                                                  GUILayout.ExpandWidth(false), GUILayout.Height(30));

            if (EditorSettings.HierarchyWindowAutoUpdate != oldAutoUpdate)
            {
                GUIUtility.keyboardControl = 0;
                EditorSettings.HierarchyWindowAutoUpdate = oldAutoUpdate;
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            #region Write to log

            EditorGUILayout.BeginVertical(GUILayout.ExpandHeight(false));
            GUILayout.FlexibleSpace();

            bool oldWriteToLog = GUILayout.Toggle(EditorSettings.HierarchyWindowWriteToLog,
                                                  GuiContentCache.Instance.WriteToLog, StyleCache.Instance.GreenToggle,
                                                  GUILayout.ExpandWidth(false), GUILayout.Height(30));

            if (EditorSettings.HierarchyWindowWriteToLog != oldWriteToLog)
            {
                GUIUtility.keyboardControl = 0;
                EditorSettings.HierarchyWindowWriteToLog = oldWriteToLog;
            }

            GUILayout.FlexibleSpace();
            EditorGUILayout.EndVertical();

            #endregion

            EditorGUILayout.EndHorizontal();

            GUILayout.Space(1);

            _scrollPosition = GUILayout.BeginScrollView(_scrollPosition, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            //GUILayout.Label(HierarchyState.Instance.State, StyleCache.Instance.NormalLabel, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            //EditorGUILayout.TextArea("<color=#00ff00>miki</color>" + _description, StyleCache.Instance.RichTextLabel, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            EditorGUILayout.TextArea(_descriptionRich, StyleCache.Instance.RichTextLabel, GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            GUILayout.EndScrollView();

            PanelContentWrapper.End();

            PanelRenderer.RenderEnd();

            //GUILayout.Space(3);
            EditorWindowContentWrapper.End();
        }