Ejemplo n.º 1
0
        void DrawOrientation(float width)
        {
            QStyles.GetStyle(QStyles.GetStyleName(Style.GhostButton.Purple)).alignment = TextAnchor.MiddleRight;
            if (QUI.GhostButton("update orientation", QColors.Color.Purple, width, 32, 10))
            {
                UpdateOrientationInEditMode();
            }
            QStyles.GetStyle(QStyles.GetStyleName(Style.GhostButton.Purple)).alignment = TextAnchor.MiddleCenter;

            QUI.Space(-32);

            switch (orientationManager.CurrentOrientation)
            {
            case OrientationManager.Orientation.Landscape: QUI.DrawTexture(DUIResources.miniIconOrientationLandscape.texture, 160, 32); break;

            case OrientationManager.Orientation.Portrait: QUI.DrawTexture(DUIResources.miniIconOrientationPortrait.texture, 160, 32); break;

            case OrientationManager.Orientation.Unknown: QUI.DrawTexture(DUIResources.miniIconOrientationUnknown.texture, 160, 32); break;
            }

            QUI.Space(SPACE_2);

            QUI.SetGUIBackgroundColor(QUI.AccentColorPurple);
            QUI.PropertyField(onOrientationChange, true, new GUIContent("OnOrientationChange"), width);
            QUI.ResetColors();
        }
Ejemplo n.º 2
0
 private void DrawRightPage(Texture text, [NotNull] Action page, bool isBox, Action nextButton)  // 画任意 右边页面都使用这个
 {
     QUI.Space(5);
     if (isNeedTu)
     {
         QUI.DrawTexture(text, mWindowSettings.CurrentPageContentWidth, 620);
         QUI.Space(-620);
     }
     QUI.Space(2);
     if (isBox)
     {
         MyCreate.Box(page);
     }
     else
     {
         MyCreate.Box_Hei(page);
     }
     MyCreate.AddSpace();
     if (null != nextButton)
     {
         MyCreate.Heng(() =>
         {
             MyCreate.AddSpace();
             if (GUILayout.Button("", QStyles.GetStyle(Style.LinkButton.Unity), GUILayout.Width(80), GUILayout.Height(20)))
             {
                 nextButton();
             }
         });
     }
 }
Ejemplo n.º 3
0
 protected void DrawRightPage([NotNull] Action page, Action nextButton = null)
 {
     QUI.Space(7);
     MyCreate.Box(page);
     MyCreate.AddSpace();
     if (null != nextButton)
     {
         MyCreate.Heng(() =>
         {
             MyCreate.AddSpace();
             if (GUILayout.Button("", QStyles.GetStyle(Style.LinkButton.Unity), GUILayout.Width(80), GUILayout.Height(20)))
             {
                 nextButton();
             }
         });
     }
 }
Ejemplo n.º 4
0
        static void HierarchyCustomizer(int instanceID, Rect selectionRect)
        {
            if (DUI.DUISettings == null || !DUI.DUISettings.HierarchyManager_Enabled)
            {
                return;
            }

            QLabel = new QLabel("", Style.Text.Small);

            rect        = new Rect(selectionRect);
            rect.x      = rect.xMax - iconWidth;
            rect.width  = iconWidth;
            rect.height = iconHeight;

#if dUI_PlayMaker
            if (DUI.DUISettings.HierarchyManager_PlaymakerEventDispatcher_ShowIcon && playmakerEventDispatcherIDs.ContainsKey(instanceID) && playmakerEventDispatcherIDs[instanceID] != null)
            {
                GUI.Label(rect, DUIResources.iconPlayMakerEventDispatcher.texture); rect.x -= iconWidth;
            }
#endif
            if (DUI.DUISettings.HierarchyManager_UITrigger_ShowIcon && uiTriggerIDs.ContainsKey(instanceID) && uiTriggerIDs[instanceID] != null)
            {
                GUI.Label(rect, DUIResources.iconUITrigger.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_UIManager_ShowIcon && UIManagerID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconUIManager.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_Soundy_ShowIcon && SoundyID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconSoundy.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_UINotificationManager_ShowIcon && UINotificationManagerID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconUINotificationManager.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_OrientationManager_ShowIcon && OrientationManagerID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconOrientationManager.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_SceneLoader_ShowIcon && SceneLoaderID == instanceID)
            {
                GUI.Label(rect, DUIResources.iconSceneLoader.texture); rect.x -= iconWidth;
            }

            if (DUI.DUISettings.HierarchyManager_UICanvas_Enabled && uiCanvasIDs.ContainsKey(instanceID) && uiCanvasIDs[instanceID] != null)
            {
                if (DUI.DUISettings.HierarchyManager_UICanvas_ShowIcon)
                {
                    GUI.Label(rect, DUIResources.iconUICanvas.texture);
                }
                else
                {
                    rect.x += iconWidth;
                }
                uic          = uiCanvasIDs[instanceID];
                QLabel.text  = "";
                QLabel.style = Style.Text.Small;
                QLabel.text  = (DUI.DUISettings.HierarchyManager_UICanvas_ShowCanvasName ? "[ " + uic.canvasName + " ]" : "")
                               + (DUI.DUISettings.HierarchyManager_UICanvas_ShowSortingLayerNameAndOrder ? " " + uic.Canvas.sortingLayerName + " " + uic.Canvas.sortingOrder : "");
                if (!string.IsNullOrEmpty(QLabel.text))
                {
                    rect.x    -= QLabel.x;
                    rect.width = QLabel.x;
                    GUI.Label(rect, QLabel.text, QStyles.GetStyle(QStyles.GetStyleName(QLabel.style)));
                }
            }

            if (DUI.DUISettings.HierarchyManager_UIButton_Enabled && uiButtonIDs.ContainsKey(instanceID) && uiButtonIDs[instanceID] != null)
            {
                if (DUI.DUISettings.HierarchyManager_UIButton_ShowIcon)
                {
                    GUI.Label(rect, DUIResources.iconUIButton.texture);
                }
                else
                {
                    rect.x += iconWidth;
                }
                uib          = uiButtonIDs[instanceID];
                QLabel.text  = "";
                QLabel.style = Style.Text.Small;
                QLabel.text  = (DUI.DUISettings.HierarchyManager_UIButton_ShowButtonCategory ? "[ " + uib.buttonCategory + " ]" : "")
                               + (DUI.DUISettings.HierarchyManager_UIButton_ShowButtonName ? "[ " + uib.buttonName + " ]" : "");
                if (!string.IsNullOrEmpty(QLabel.text))
                {
                    rect.x    -= QLabel.x;
                    rect.width = QLabel.x;
                    GUI.Label(rect, QLabel.text, QStyles.GetStyle(QStyles.GetStyleName(QLabel.style)));
                }
            }

            if (DUI.DUISettings.HierarchyManager_UINotification_ShowIcon && uiNotificationIDs.ContainsKey(instanceID))
            {
                GUI.Label(rect, DUIResources.iconUINotification.texture); rect.x -= iconWidth;
            }
            if (DUI.DUISettings.HierarchyManager_UIElement_Enabled && uiElementIDs.ContainsKey(instanceID) && uiElementIDs[instanceID] != null)
            {
                if (DUI.DUISettings.HierarchyManager_UIElement_ShowIcon)
                {
                    GUI.Label(rect, DUIResources.iconUIElement.texture);
                }
                else
                {
                    rect.x += iconWidth;
                }
                uie          = uiElementIDs[instanceID];
                QLabel.text  = "";
                QLabel.style = Style.Text.Small;
                if (uie.linkedToNotification)
                {
                    QLabel.text = "linked to notification";
                }
                else
                {
                    QLabel.text = (DUI.DUISettings.HierarchyManager_UIElement_ShowElementCategory ? "[ " + uie.elementCategory + " ]" : "")
                                  + (DUI.DUISettings.HierarchyManager_UIElement_ShowElementName ? "[ " + uie.elementName + " ]" : "")
                                  + (DUI.DUISettings.HierarchyManager_UIElement_ShowSortingLayerNameAndOrder ? " " + uie.Canvas.sortingLayerName + " " + uie.Canvas.sortingOrder : "");
                }
                if (!string.IsNullOrEmpty(QLabel.text))
                {
                    rect.x    -= QLabel.x;
                    rect.width = QLabel.x;
                    GUI.Label(rect, QLabel.text, QStyles.GetStyle(QStyles.GetStyleName(QLabel.style)));
                }
            }

            if (DUI.DUISettings.HierarchyManager_UIEffect_Enabled && uiEffectIDs.ContainsKey(instanceID) && uiEffectIDs[instanceID] != null)
            {
                if (DUI.DUISettings.HierarchyManager_UIEffect_ShowIcon)
                {
                    GUI.Label(rect, DUIResources.iconUIEffect.texture);
                }
                else
                {
                    rect.x += iconWidth;
                }
                uief = uiEffectIDs[instanceID];
                if (DUI.DUISettings.HierarchyManager_UIEffect_ShowSortingLayerNameAndOrder)
                {
                    if (uief.targetUIElement != null)
                    {
                        if (uief.targetUIElement.linkedToNotification)
                        {
                            QLabel.text = "linked to notification";
                        }
                        else
                        {
                            QLabel.text = (uief.useCustomSortingLayerName
                                     ? uief.customSortingLayerName
                                     : uief.targetUIElement.Canvas.overrideSorting
                                       ? uief.targetUIElement.Canvas.sortingLayerName
                                       : uief.targetUIElement.Canvas.rootCanvas.sortingLayerName)
                                          + " " +
                                          (uief.useCustomOrderInLayer
                                     ? uief.customOrderInLayer
                                     : uief.targetUIElement.Canvas.overrideSorting
                                       ? uief.targetUIElement.Canvas.sortingOrder
                                       : uief.targetUIElement.Canvas.rootCanvas.sortingOrder);
                        }
                    }
                    else
                    {
                        QLabel.text = "DISABLED";
                    }
                    rect.x    -= QLabel.x;
                    rect.width = QLabel.x;
                    GUI.Label(rect, QLabel.text, QStyles.GetStyle(QStyles.GetStyleName(QLabel.style)));
                }
            }
        }
Ejemplo n.º 5
0
        void DrawModuleVersion(string moduleName, Page targetModule, EzModuleVersion emv, AnimBool show, float width)
        {
            if (QUI.GhostBar(moduleName + (emv == null ? " has not been installed!" : (" version " + emv.versionNumber)), emv == null ? QColors.Color.Gray : QColors.Color.Green, show, width, 24))
            {
                if (emv == null)
                {
                    show.target = false;
                    WindowSettings.currentPage = targetModule;
                }
                else
                {
                    show.target = !show.target;
                    if (selectedModuleToEdit == targetModule)
                    {
                        selectedModuleToEdit      = Page.None;
                        editModuleAnimBool.target = false;
                    }
                }
            }

            if (emv == null)
            {
                return;
            }

            if (QUI.BeginFadeGroup(show.faded))
            {
                QUI.BeginVertical(width);
                {
                    QUI.Space(-9);

                    QUI.BeginHorizontal(width);
                    {
                        EditorGUILayout.LabelField(emv.releaseNotes, QStyles.GetInfoMessageMessageStyle(Style.InfoMessage.Help));
                    }
                    QUI.EndHorizontal();

#if EZ_SOURCE
#pragma warning disable CS0162 // Unreachable code detected

                    QUI.Space(13);
                    QUI.Space(8 * (selectedModuleToEdit == targetModule ? editModuleAnimBool.faded : 0));
                    QUI.BeginHorizontal(width);
                    {
                        QUI.FlexibleSpace();
                        if (QUI.GhostButton("Edit Version", QColors.Color.Gray, 100, 16, selectedModuleToEdit == targetModule) ||
                            QUI.DetectKeyUp(Event.current, KeyCode.Escape))
                        {
                            if (selectedModuleToEdit == targetModule)
                            {
                                selectedModuleToEdit      = Page.None;
                                editModuleAnimBool.target = false;
                            }
                            else
                            {
                                selectedModuleToEdit      = targetModule;
                                editModuleAnimBool.target = true;
                            }
                        }

                        if (selectedModuleToEdit == targetModule && editModuleAnimBool.faded > 0.4f)
                        {
                            QUI.Space(SPACE_4 * editModuleAnimBool.faded);

                            if (QUI.GhostButton("Save Changes", QColors.Color.Green, 100 * editModuleAnimBool.faded, 16))
                            {
                                QUI.SetDirty(emv);
                                AssetDatabase.SaveAssets();
                                selectedModuleToEdit     = Page.None;
                                editModuleAnimBool.value = false;
                            }
                        }
                    }
                    QUI.EndHorizontal();


                    if (selectedModuleToEdit == targetModule)
                    {
                        if (QUI.BeginFadeGroup(editModuleAnimBool.faded))
                        {
                            QUI.BeginVertical(width);
                            {
                                QUI.BeginHorizontal(width);
                                {
                                    EditorGUILayout.LabelField("version", QStyles.GetStyle(QStyles.GetStyleName(Style.Text.Small)), GUILayout.Width(80));
                                    QUI.Space(SPACE_2);
                                    EditorGUILayout.LabelField("release notes", QStyles.GetStyle(QStyles.GetStyleName(Style.Text.Small)));
                                }
                                QUI.EndHorizontal();

                                QUI.Space(-SPACE_4);

                                QUI.BeginHorizontal(width);
                                {
                                    emv.versionNumber = EditorGUILayout.TextField(emv.versionNumber, GUILayout.Width(80));
                                    QUI.Space(SPACE_2);
                                    emv.releaseNotes = EditorGUILayout.TextArea(emv.releaseNotes);
                                }
                                QUI.EndHorizontal();

                                QUI.Space(SPACE_16);
                            }
                            QUI.EndVertical();
                        }
                        QUI.EndFadeGroup();
                    }
#endif
                    QUI.Space(9 + 16);
                }
                QUI.EndVertical();
            }
            QUI.EndFadeGroup();


#pragma warning restore CS0162 // Unreachable code detected
        }