Commit 02bcee6d authored by Nathan Chambron's avatar Nathan Chambron
Browse files

modified UI and tweaked save interaction

parent ccf5ef33
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -36,7 +36,6 @@ namespace Assets.ETSI.ARF.ARF_World_Storage_API.Editor.Graph
            doubleClickManipulator.activators.Clear();
            doubleClickManipulator.activators.Add(new ManipulatorActivationFilter { button = MouseButton.LeftMouse, clickCount = 2 });
            this.AddManipulator(doubleClickManipulator);
            style.color = new Color(239, 239, 239);
        }

        public void Clicked()
+59 −42
Original line number Diff line number Diff line
@@ -50,9 +50,11 @@ namespace ETSI.ARF.WorldStorage.UI
            //deleSection
            deleteSelection += DeleteFunc;


            this.AddManipulator(new ContentDragger());
            this.AddManipulator(new SelectionDragger());
            this.AddManipulator(new RectangleSelector());

        }

        //method called when an element is deleted from the graphview
@@ -105,7 +107,10 @@ namespace ETSI.ARF.WorldStorage.UI
                    {
                        edgeLink.input.Disconnect(edgeLink);
                        edgeLink.output.Disconnect(edgeLink);
                        if (SaveInfo.instance.linkIds.Contains(edgeLink.GUID))
                        {
                            SaveInfo.instance.elemsToRemove.Add(edgeLink.GUID, typeof(WorldLink));
                        }
                        RemoveElement(elt);
                        continue;
                    }
@@ -120,7 +125,18 @@ namespace ETSI.ARF.WorldStorage.UI
            Vector2 localMousePos = evt.localMousePosition;
            Vector2 actualGraphPosition = viewTransform.matrix.inverse.MultiplyPoint(localMousePos);

            if (!(evt.target is ARFNode || evt.target is Group || evt.target is ARFEdgeLink))
            {
                evt.menu.AppendSeparator();
                evt.menu.AppendAction("Save graph", delegate
                {
                    if (ServerAndLocalDifferent())
                    {
                        SaveInServer();
                    }/*
                    Reload();
                    SaveInfo.instance.toReFrame = true;*/
                }, (DropdownMenuAction a) => DropdownMenuAction.Status.Normal);
                evt.menu.AppendAction("Reload graph", delegate
                {
                    if (ServerAndLocalDifferent() && EditorUtility.DisplayDialog("Saving node positions", "The World Graph has been modified. \nWould you like to push the modifications to the server ?", "Yes", "No"))
@@ -174,6 +190,7 @@ namespace ETSI.ARF.WorldStorage.UI
                    CreateAnchorNode(anchor, actualGraphPosition.x, actualGraphPosition.y);

                }, (DropdownMenuAction a) => DropdownMenuAction.Status.Normal);
            }
            evt.menu.AppendSeparator();
            if (evt.target is ARFNode || evt.target is Group || evt.target is ARFEdgeLink)
            {
+6 −0
Original line number Diff line number Diff line
@@ -95,6 +95,12 @@ namespace ETSI.ARF.WorldStorage.UI
            return node.InstantiatePort(Orientation.Horizontal, portDirection, capacity, typeof(int)); // dummy
        }

        //override the BuildContextualMenu method to prevent the "disconnect" option from appearing in the contextual menu
        public override void BuildContextualMenu(ContextualMenuPopulateEvent evt)
        {
        }

        public abstract ObjectType GetElemType();

    }
}
 No newline at end of file
+3 −3
Original line number Diff line number Diff line
@@ -48,18 +48,18 @@ namespace ETSI.ARF.WorldStorage.UI
            var colorRectangle = new VisualElement();
            colorRectangle.style.height = 160;
            colorRectangle.style.height = 5;
            colorRectangle.style.backgroundColor = new Color(0.9f, 0.78f, 0.54f, 0.9f);
            colorRectangle.style.backgroundColor = new Color(1, 0.31f, 0.31f, 0.9f);
            mainContainer.Insert(1, colorRectangle);

            /*PORTS*/
            var portIn = GeneratePort(this, Direction.Input, Port.Capacity.Multi);
            portIn.portColor = new Color(0.77f, 0.77f, 0.77f, 0.77f);
            portIn.portColor = new Color(0.66f, 0.39f, 1, 0.77f);
            portIn.portName = "Target"; // "Input"
            //portIn.AddManipulator(new EdgeConnector<ARFEdgeLink>(new WorldLinkListener()));
            inputContainer.Add(portIn);

            var portOut = GeneratePort(this, Direction.Output, Port.Capacity.Multi);
            portOut.portColor = new Color(0.77f, 0.77f, 0.77f, 0.77f);
            portOut.portColor = new Color(0.66f, 0.39f, 1, 0.77f);
            portOut.portName = "Source"; // "Output";
            //portOut.AddManipulator(new EdgeConnector<ARFEdgeLink>(new WorldLinkListener())); ;
            outputContainer.Add(portOut);
+3 −3
Original line number Diff line number Diff line
@@ -48,18 +48,18 @@ namespace ETSI.ARF.WorldStorage.UI
            var colorRectangle = new VisualElement();
            colorRectangle.style.height = 160;
            colorRectangle.style.height = 5;
            colorRectangle.style.backgroundColor = new Color(0.76f, 0.9f, 0.46f, 0.9f);
            colorRectangle.style.backgroundColor = new Color(1, 0.7f, 0, 0.9f);
            mainContainer.Insert(1, colorRectangle);

            /*PORTS*/
            var portIn = GeneratePort(this, Direction.Input, Port.Capacity.Multi);
            portIn.portColor = new Color(0.77f,0.77f,0.77f, 0.77f);
            portIn.portColor = new Color(0.66f, 0.39f, 1, 0.77f);
            portIn.portName = "Target"; // "Input";
            //portIn.AddManipulator(new EdgeConnector<ARFEdgeLink>(new WorldLinkListener()));
            inputContainer.Add(portIn);

            var portOut = GeneratePort(this, Direction.Output, Port.Capacity.Multi);
            portOut.portColor = new Color(0.77f, 0.77f, 0.77f, 0.77f);
            portOut.portColor = new Color(0.66f, 0.39f, 1, 0.77f);
            portOut.portName = "Source"; // "Output";
            //portOut.AddManipulator(new EdgeConnector<ARFEdgeLink>(new WorldLinkListener()));
            outputContainer.Add(portOut);
Loading