more turn restriction stuff, and checkboxes, and a bunch of little fixes
[potlatch2.git] / net / systemeD / potlatch2 / controller / SelectedWayNode.as
index c87ac54f978321f3bd1aa087de717ef465805806..3e3411e236d0017408d43b7119363744054e5d00 100644 (file)
@@ -20,18 +20,18 @@ package net.systemeD.potlatch2.controller {
             if ( way == selectedWay && node == selectedNode )
                 return;
 
-            clearSelection();
+            clearSelection(this);
             controller.setSelectedEntity(node);
-            controller.map.setHighlight(way, { showNodes: true, nodeSelected: node.id });
+            controller.map.setHighlight(way, { hover: false, showNodes: true, nodeSelected: node.id });
             selectedWay = way; initWay = way;
                        selectedIndex = index; initIndex = index;
             selectedNode = node;
         }
                 
-        override protected function clearSelection():void {
+        override protected function clearSelection(newState:ControllerState):void {
             if ( selectedNode != null ) {
                controller.map.setHighlight(selectedWay, { selected: false, showNodes: false, nodeSelected: null });
-                controller.setSelectedEntity(null);
+                if (!newState.isSelectionState()) { controller.setSelectedEntity(null); }
                 selectedNode = null;
                                selectedWay = null;
             }
@@ -75,9 +75,9 @@ package net.systemeD.potlatch2.controller {
             selectNode(initWay,initIndex);
                        Globals.vars.root.addDebug("**** -> "+this);
         }
-               override public function exitState():void {
+               override public function exitState(newState:ControllerState):void {
                        controller.clipboards['node']=selectedNode.getTagsCopy();
-            clearSelection();
+            clearSelection(newState);
                        Globals.vars.root.addDebug("**** <- "+this);
         }