Example #1
0
 public static QSettings GetSettings(HttpRequest request)
 {
     QSettings settings = new QSettings();
     if (request.QueryString["SiteUrl"] != null)
         settings.SiteUrl = request.QueryString["SiteUrl"].ToString();
     if (request.QueryString["ListId"] != null)
         settings.ListId = Guid.Parse(request.QueryString["ListId"].ToString());
     if (request.QueryString["Type"] != null)
     {
         switch (request.QueryString["Type"].ToLower())
         {
             case "file":
                 settings.Type = SPDeploymentObjectType.File;
                 break;
             case "folder":
                 settings.Type = SPDeploymentObjectType.Folder;
                 break;
             case "list":
                 settings.Type = SPDeploymentObjectType.List;
                 break;
             case "listitem":
                 settings.Type = SPDeploymentObjectType.ListItem;
                 break;
             case "site":
                 settings.Type = SPDeploymentObjectType.Site;
                 break;
             case "web":
                 settings.Type = SPDeploymentObjectType.Web;
                 break;
             default:
                 settings.Type = SPDeploymentObjectType.Invalid;
                 break;
         }
     }
     return settings;
 }
Example #2
0
 // PRIVATE
 private void settingsChanged()
 {
     enabled = QSettings.getInstance().get <bool>(QSetting.ShowColorComponent);
     showComponentDuringPlayMode = QSettings.getInstance().get <bool>(QSetting.ShowColorComponentDuringPlayMode);
 }
Example #3
0
 protected override bool WriteProperties(QSettings qs, string prefix)
 {
     return((bool)interceptor.Invoke("writeProperties#$", "writeProperties(QSettings&, const QString&) const", typeof(bool), typeof(QSettings), qs, typeof(string), prefix));
 }
Example #4
0
 // PRIVATE
 private void settingsChanged()
 {
     enabled = QSettings.getInstance().get <bool>(QSetting.ShowTreeMapComponent);
 }
 // PRIVATE
 private void settingsChanged()
 {
     showRowShading = QSettings.getInstance().get <bool>(QSetting.ShowRowShading);
     enabled        = QSettings.getInstance().get <bool>(QSetting.ShowSeparatorComponent);
 }
 // PRIVATE
 private void settingsChanged()
 {
     showModifierWarning         = QSettings.getInstance().get <bool>(QSetting.ShowModifierWarning);
     enabled                     = QSettings.getInstance().get <bool>(QSetting.ShowLockComponent);
     showComponentDuringPlayMode = QSettings.getInstance().get <bool>(QSetting.ShowLockComponentDuringPlayMode);
 }
 // PRIVATE
 private void settingsChanged()
 {
     enabled = QSettings.getInstance().get <bool>(QSetting.ColorShow);
     showComponentDuringPlayMode = QSettings.getInstance().get <bool>(QSetting.ColorShowDuringPlayMode);
     inactiveColor = QSettings.getInstance().getColor(QSetting.AdditionalInactiveColor);
 }
        // PUBLIC
        public void draw(Rect rect, string[] componentIds)
        {
            Event currentEvent = Event.current;

            int currentMouseIndex = Mathf.Clamp(Mathf.RoundToInt((currentEvent.mousePosition.y - dragOffset - rect.y) / 18), 0, componentIds.Length - 1);

            if (dragAndDrop && currentEvent.type == EventType.MouseUp)
            {
                dragAndDrop = false;
                window.Repaint();

                if (currentMouseIndex != originalDragIndex)
                {
                    string newIconOrder = "";
                    for (int j = 0; j < componentIds.Length; j++)
                    {
                        if (j == currentMouseIndex)
                        {
                            if (j > originalDragIndex)
                            {
                                newIconOrder += componentIds[j] + ";";
                                newIconOrder += componentIds[originalDragIndex] + ";";
                            }
                            else
                            {
                                newIconOrder += componentIds[originalDragIndex] + ";";
                                newIconOrder += componentIds[j] + ";";
                            }
                        }
                        else if (j != originalDragIndex)
                        {
                            newIconOrder += componentIds[j] + ";";
                        }
                    }

                    newIconOrder = newIconOrder.TrimEnd(';');
                    QSettings.getInstance().set(QSetting.ComponentsOrder, newIconOrder);
                    componentIds = newIconOrder.Split(';');
                }
            }
            else if (dragAndDrop && currentEvent.type == EventType.MouseDrag)
            {
                window.Repaint();
            }

            for (int i = 0; i < componentIds.Length; i++)
            {
                QHierarchyComponentEnum type = (QHierarchyComponentEnum)int.Parse(componentIds[i]);

                Rect curRect = new Rect(rect.x, rect.y + 18 * i, rect.width, 16);

                if (!dragAndDrop && currentEvent.type == EventType.MouseDown && curRect.Contains(currentEvent.mousePosition))
                {
                    dragAndDrop       = true;
                    originalDragIndex = i;
                    dragOffset        = currentEvent.mousePosition.y - curRect.y;
                    Event.current.Use();
                }

                if (dragAndDrop)
                {
                    if (originalDragIndex != i)
                    {
                        if (i < originalDragIndex && currentMouseIndex <= i)
                        {
                            curRect.y += 18;
                        }
                        else if (i > originalDragIndex && currentMouseIndex >= i)
                        {
                            curRect.y -= 18;
                        }

                        drawComponentLabel(curRect, type);
                    }
                }
                else
                {
                    drawComponentLabel(curRect, type);
                }
            }

            if (dragAndDrop)
            {
                float curY = currentEvent.mousePosition.y - dragOffset;
                curY = Mathf.Clamp(curY, rect.y, rect.y + rect.height - 16);
                drawComponentLabel(new Rect(rect.x, curY, rect.width, rect.height), (QHierarchyComponentEnum)int.Parse(componentIds[originalDragIndex]), true);
            }
        }
 private void settingsChanged()
 {
     showObjectList = QSettings.getInstance().get <bool>(QSetting.AdditionalShowHiddenQHierarchyObjectList);
     preventSelectionOfLockedObjects = QSettings.getInstance().get <bool>(QSetting.LockShow) && QSettings.getInstance().get <bool>(QSetting.LockPreventSelectionOfLockedObjects);
     preventSelectionOfLockedObjectsDuringPlayMode = preventSelectionOfLockedObjects && QSettings.getInstance().get <bool>(QSetting.LockShowDuringPlayMode);
 }
Example #10
0
 private void settingsChanged()
 {
     showObjectList = QSettings.getInstance().get <bool>(QSetting.ShowHiddenQHierarchyObjectList);
     preventSelectionOfLockedObjects = QSettings.getInstance().get <bool>(QSetting.ShowLockComponent) && QSettings.getInstance().get <bool>(QSetting.PreventSelectionOfLockedObjects);
     preventSelectionOfLockedObjectsDuringPlayMode = preventSelectionOfLockedObjects && QSettings.getInstance().get <bool>(QSetting.ShowLockComponentDuringPlayMode);
 }
        public override void eventHandler(GameObject gameObject, QObjectList objectList, Event currentEvent)
        {
            if (currentEvent.isMouse && currentEvent.button == 0 && rect.Contains(currentEvent.mousePosition))
            {
                if (currentEvent.type == EventType.MouseDown)
                {
                    targetVisibilityState = ((!gameObject.activeSelf) == true ? 1 : 0);
                }
                else if (currentEvent.type == EventType.MouseDrag && targetVisibilityState != -1)
                {
                    if (targetVisibilityState == (gameObject.activeSelf == true ? 1 : 0))
                    {
                        return;
                    }
                }
                else
                {
                    targetVisibilityState = -1;
                    return;
                }

                bool showWarning = QSettings.getInstance().get <bool>(QSetting.AdditionalShowModifierWarning);

                List <GameObject> targetGameObjects = new List <GameObject>();
                if (currentEvent.control || currentEvent.command)
                {
                    if (currentEvent.shift)
                    {
                        if (!showWarning || EditorUtility.DisplayDialog("Change edit-time visibility", "Are you sure you want to turn " + (gameObject.activeSelf ? "off" : "on") + " the edit-time visibility of this GameObject and all its children? (You can disable this warning in the settings)", "Yes", "Cancel"))
                        {
                            getGameObjectListRecursive(gameObject, ref targetGameObjects);
                        }
                    }
                    else if (currentEvent.alt)
                    {
                        if (gameObject.transform.parent != null)
                        {
                            if (!showWarning || EditorUtility.DisplayDialog("Change edit-time visibility", "Are you sure you want to turn " + (gameObject.activeSelf ? "off" : "on") + " the edit-time visibility this GameObject and its siblings? (You can disable this warning in the settings)", "Yes", "Cancel"))
                            {
                                getGameObjectListRecursive(gameObject.transform.parent.gameObject, ref targetGameObjects, 1);
                                targetGameObjects.Remove(gameObject.transform.parent.gameObject);
                            }
                        }
                        else
                        {
                            Debug.Log("This action for root objects is supported for Unity3d 5.3.3 and above");
                            return;
                        }
                    }
                    else
                    {
                        getGameObjectListRecursive(gameObject, ref targetGameObjects, 0);
                    }
                }
                else if (currentEvent.shift)
                {
                    if (!showWarning || EditorUtility.DisplayDialog("Change visibility", "Are you sure you want to turn " + (gameObject.activeSelf ? "off" : "on") + " the visibility of this GameObject and all its children? (You can disable this warning in the settings)", "Yes", "Cancel"))
                    {
                        getGameObjectListRecursive(gameObject, ref targetGameObjects);
                    }
                }
                else if (currentEvent.alt)
                {
                    if (gameObject.transform.parent != null)
                    {
                        if (!showWarning || EditorUtility.DisplayDialog("Change visibility", "Are you sure you want to turn " + (gameObject.activeSelf ? "off" : "on") + " the visibility this GameObject and its siblings? (You can disable this warning in the settings)", "Yes", "Cancel"))
                        {
                            getGameObjectListRecursive(gameObject.transform.parent.gameObject, ref targetGameObjects, 1);
                            targetGameObjects.Remove(gameObject.transform.parent.gameObject);
                        }
                    }
                    else
                    {
                        Debug.Log("This action for root objects is supported for Unity3d 5.3.3 and above");
                        return;
                    }
                }
                else
                {
                    if (Selection.Contains(gameObject))
                    {
                        targetGameObjects.AddRange(Selection.gameObjects);
                    }
                    else
                    {
                        getGameObjectListRecursive(gameObject, ref targetGameObjects, 0);
                    };
                }

                setVisibility(targetGameObjects, objectList, !gameObject.activeSelf, currentEvent.control || currentEvent.command);
                currentEvent.Use();
            }
        }
        private void drawTagLayerComponentSettings()
        {
            if (drawComponentCheckBox(QSetting.ShowTagLayerComponent, "Tag And Layer"))
            {
                Rect rect = getControlRect(0, 16);
                drawBackground(rect.x, rect.y, rect.width, 18 * 6 + 5);
                rect.x     += 31;
                rect.width -= 31 + 6;

                drawCheckBoxRight(rect, QSetting.ShowTagLayerComponentDuringPlayMode, "Show Component During Play Mode");
                drawSpace(5);

                // SHOW
                QHierarchyTagAndLayerType tagAndLayerType = (QHierarchyTagAndLayerType)QSettings.getInstance().get <int>(QSetting.TagAndLayerType);
                QHierarchyTagAndLayerType newTagAndLayerType;
                if ((newTagAndLayerType = (QHierarchyTagAndLayerType)EditorGUI.EnumPopup(getControlRect(0, 16, 31, 6), "Show Tag And Layer", tagAndLayerType)) != tagAndLayerType)
                {
                    QSettings.getInstance().set(QSetting.TagAndLayerType, (int)newTagAndLayerType);
                }
                drawSpace(2);

                // LABEL SIZE
                QHierarchyTagAndLayerLabelSize tagAndLayerLabelSize = (QHierarchyTagAndLayerLabelSize)QSettings.getInstance().get <int>(QSetting.TagAndLayerLabelSize);
                QHierarchyTagAndLayerLabelSize newTagAndLayerLabelSize;
                if ((newTagAndLayerLabelSize = (QHierarchyTagAndLayerLabelSize)EditorGUI.EnumPopup(getControlRect(0, 16, 31, 6), "Label Size", tagAndLayerLabelSize)) != tagAndLayerLabelSize)
                {
                    QSettings.getInstance().set(QSetting.TagAndLayerLabelSize, (int)newTagAndLayerLabelSize);
                }
                drawSpace(2);

                // SIZE TYPE
                QHierarchyTagAndLayerSizeType tagAndLayerSizeValueType = (QHierarchyTagAndLayerSizeType)QSettings.getInstance().get <int>(QSetting.TagAndLayerSizeValueType);
                QHierarchyTagAndLayerSizeType newTagAndLayerSizeValueType;
                if ((newTagAndLayerSizeValueType = (QHierarchyTagAndLayerSizeType)EditorGUI.EnumPopup(getControlRect(0, 16, 31, 6), "Unit Of Width", tagAndLayerSizeValueType)) != tagAndLayerSizeValueType)
                {
                    QSettings.getInstance().set(QSetting.TagAndLayerSizeValueType, (int)newTagAndLayerSizeValueType);
                }
                drawSpace(2);

                // SIZE
                if (newTagAndLayerSizeValueType == QHierarchyTagAndLayerSizeType.Pixel)
                {
                    int tagAndLayerSizeValue = QSettings.getInstance().get <int>(QSetting.TagAndLayerSizeValuePixel);
                    int newLayerSizeValue    = EditorGUI.IntSlider(getControlRect(0, 16, 31, 6), "Width In Pixels", tagAndLayerSizeValue, 1, 250);
                    if (newLayerSizeValue != tagAndLayerSizeValue)
                    {
                        QSettings.getInstance().set(QSetting.TagAndLayerSizeValuePixel, newLayerSizeValue);
                    }
                }
                else
                {
                    float tagAndLayerSizeValuePercent    = QSettings.getInstance().get <float>(QSetting.TagAndLayerSizeValuePercent);
                    float newtagAndLayerSizeValuePercent = EditorGUI.Slider(getControlRect(0, 16, 31, 6), "Percentage Width", tagAndLayerSizeValuePercent, 0, 0.5f);
                    if (tagAndLayerSizeValuePercent != newtagAndLayerSizeValuePercent)
                    {
                        QSettings.getInstance().set(QSetting.TagAndLayerSizeValuePercent, newtagAndLayerSizeValuePercent);
                    }
                }
                drawSpace(2);

                // ALIGNMENT
                QHierarchyTagAndLayerAligment tagAndLayerAligment = (QHierarchyTagAndLayerAligment)QSettings.getInstance().get <int>(QSetting.TagAndLayerAligment);
                QHierarchyTagAndLayerAligment newTagAndLayerAligment;
                if ((newTagAndLayerAligment = (QHierarchyTagAndLayerAligment)EditorGUI.EnumPopup(getControlRect(0, 16, 31, 6), "Alignment", tagAndLayerAligment)) != tagAndLayerAligment)
                {
                    QSettings.getInstance().set(QSetting.TagAndLayerAligment, (int)newTagAndLayerAligment);
                }
                drawSpace(3);
            }
        }
        // ORDER
        private void drawOrderSettings()
        {
            indentLevel += 8;

            string componentOrder = QSettings.getInstance().get <string>(QSetting.ComponentOrder);

            string[] componentIds = componentOrder.Split(';');

            for (int i = 0; i < componentIds.Length; i++)
            {
                QHierarchyComponentEnum type = (QHierarchyComponentEnum)int.Parse(componentIds[i]);

                Rect rect = getControlRect(14, 17);

                if (i > 0)
                {
                    if (GUI.Button(rect, orderUp, GUIStyle.none))
                    {
                        string newIconOrder = "";
                        for (int j = 0; j < componentIds.Length; j++)
                        {
                            if (j == i - 1)
                            {
                                newIconOrder += componentIds[i] + ";";
                            }
                            else if (j == i)
                            {
                                newIconOrder += componentIds[i - 1] + ";";
                            }
                            else
                            {
                                newIconOrder += componentIds[j] + ";";
                            }
                        }
                        newIconOrder = newIconOrder.TrimEnd(';');
                        QSettings.getInstance().set(QSetting.ComponentOrder, newIconOrder);
                    }
                }

                rect.x += 17;

                if (i < componentIds.Length - 1)
                {
                    if (GUI.Button(rect, orderDown, GUIStyle.none))
                    {
                        string newIconOrder = "";
                        for (int j = 0; j < componentIds.Length; j++)
                        {
                            if (j == i)
                            {
                                newIconOrder += componentIds[i + 1] + ";";
                            }
                            else if (j == i + 1)
                            {
                                newIconOrder += componentIds[i] + ";";
                            }
                            else
                            {
                                newIconOrder += componentIds[j] + ";";
                            }
                        }
                        newIconOrder = newIconOrder.TrimEnd(';');
                        QSettings.getInstance().set(QSetting.ComponentOrder, newIconOrder);
                    }
                }

                rect.x     += 19;
                rect.y     -= 1;
                rect.width  = 200;
                rect.height = 22;
                GUI.Label(rect, getTextWithSpaces(type.ToString()));
            }

            indentLevel -= 8;
        }
        public override void draw(GameObject gameObject, Rect selectionRect, Rect curRect)
        {
            int    layer = gameObject.layer;
            string tag   = getTagName(gameObject);

            EditorGUI.DrawRect(curRect, backgroundColor);

            if (showAlways || (tag != "Untagged" || layer != 0))
            {
                curRect.height = 17;
                curRect.y     -= 2;
                curRect.width -= 4;
                curRect.x     += 2;

                int aligment = QSettings.getInstance().get <int>(QSetting.TagAndLayerAligment);
                if (aligment == (int)QHierarchyTagAndLayerAligment.Left)
                {
                    labelStyle.alignment = TextAnchor.UpperLeft;
                }
                else if (aligment == (int)QHierarchyTagAndLayerAligment.Center)
                {
                    labelStyle.alignment = TextAnchor.UpperCenter;
                }
                else if (aligment == (int)QHierarchyTagAndLayerAligment.Right)
                {
                    labelStyle.alignment = TextAnchor.UpperRight;
                }

                if (layer == 0 && tag != "Untagged" && !showAlways)
                {
                    if (labelSize == QHierarchyTagAndLayerLabelSize.Small)
                    {
                        labelStyle.fontSize = 8;
                    }
                    else
                    {
                        labelStyle.fontSize = 9;
                    }

                    curRect.y += 5;
                    labelStyle.normal.textColor = greyLightColor;
                    EditorGUI.LabelField(curRect, tag, labelStyle);
                }
                else if (layer != 0 && tag == "Untagged" && !showAlways)
                {
                    if (labelSize == QHierarchyTagAndLayerLabelSize.Small)
                    {
                        labelStyle.fontSize = 8;
                    }
                    else
                    {
                        labelStyle.fontSize = 9;
                    }

                    curRect.y += 5;
                    labelStyle.normal.textColor = greyLightColor;
                    EditorGUI.LabelField(curRect, getLayerName(layer), labelStyle);
                }
                else
                {
                    if (labelSize == QHierarchyTagAndLayerLabelSize.Normal)
                    {
                        labelStyle.fontSize = 9;
                    }
                    else
                    {
                        labelStyle.fontSize = 8;
                    }

                    labelStyle.normal.textColor = tag == "Untagged" ? greyColor : greyLightColor;
                    EditorGUI.LabelField(curRect, tag, labelStyle);
                    curRect.y += 8;
                    labelStyle.normal.textColor = layer == 0 ? greyColor : greyLightColor;
                    EditorGUI.LabelField(curRect, getLayerName(layer), labelStyle);
                }
            }
        }
Example #15
0
 public void SetSettings(HttpContext context)
 {
     settings = Helper.GetSettings(context.Request);
     if (!string.IsNullOrEmpty(settings.SiteUrl))
         ExportManager.SiteUrl = settings.SiteUrl;
 }