Browse Source

fix double adding tag from scene

MonkeyFirst 10 years ago
parent
commit
ff24dc3a12
1 changed files with 6 additions and 2 deletions
  1. 6 2
      bin/Data/Scripts/Editor/EditorInspectorWindow.as

+ 6 - 2
bin/Data/Scripts/Editor/EditorInspectorWindow.as

@@ -745,8 +745,12 @@ void HandleTagsSelect(StringHash eventType, VariantMap& eventData)
         for (int i =0; i < sceneTags.length; i++)
         for (int i =0; i < sceneTags.length; i++)
         {
         {
             bool isHasTag = editNode.HasTag(sceneTags[i]);
             bool isHasTag = editNode.HasTag(sceneTags[i]);
-            String taggedIndicator = (isHasTag ? Indicator : "");
-            actions.Push(CreateContextMenuItem(taggedIndicator + sceneTags[i], "HandleTagsMenuSelection", sceneTags[i]));
+            // Add this tag into menu if only Node not tadded with it yet, otherwise it showed on step 1.
+            if (!isHasTag)
+            {
+                String taggedIndicator = (isHasTag ? Indicator : "");
+                actions.Push(CreateContextMenuItem(taggedIndicator + sceneTags[i], "HandleTagsMenuSelection", sceneTags[i]));
+            }
         }
         }
 
 
         // 3. Add default tags
         // 3. Add default tags