소스 검색

Hide instead of skip UI element internal vars in AttributeEditor so that indexing works for user-added UI element variables (subindex 0 must always be found in current implementation.) Closes #1788.

Lasse Öörni 8 년 전
부모
커밋
171896ddb4
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      bin/Data/Scripts/Editor/AttributeEditor.as

+ 5 - 3
bin/Data/Scripts/Editor/AttributeEditor.as

@@ -524,11 +524,13 @@ UIElement@ CreateAttributeEditor(ListView@ list, Array<Serializable@>@ serializa
         for (uint i = 0; i < keys.length; ++i)
         for (uint i = 0; i < keys.length; ++i)
         {
         {
             String varName = GetVarName(keys[i]);
             String varName = GetVarName(keys[i]);
+            bool shouldHide = false;
+
             if (varName.empty)
             if (varName.empty)
             {
             {
-                // UIElements will contain internal vars, which do not have known mappings. Skip these
+                // UIElements will contain internal vars, which do not have known mappings. Hide these
                 if (cast<UIElement>(serializables[0]) !is null)
                 if (cast<UIElement>(serializables[0]) !is null)
-                    continue;
+                    shouldHide = true;
                 // Else, for scene nodes, show as hexadecimal hashes if nothing else is available
                 // Else, for scene nodes, show as hexadecimal hashes if nothing else is available
                 varName = keys[i].ToString();
                 varName = keys[i].ToString();
             }
             }
@@ -544,7 +546,7 @@ UIElement@ CreateAttributeEditor(ListView@ list, Array<Serializable@>@ serializa
             {
             {
                 parent.vars["Key"] = keys[i].value;
                 parent.vars["Key"] = keys[i].value;
                 // If variable name is not registered (i.e. it is an editor internal variable) then hide it
                 // If variable name is not registered (i.e. it is an editor internal variable) then hide it
-                if (varName.empty)
+                if (varName.empty || shouldHide)
                     parent.visible = false;
                     parent.visible = false;
             }
             }
         }
         }