Browse Source

Fix formatting on resource field layout, fix some typos, don't serialize animatedsprite2d root node

Josh Engebretson 10 years ago
parent
commit
263b721a72

+ 5 - 0
Script/AtomicEditor/ui/frames/inspector/DataBinding.ts

@@ -157,6 +157,11 @@ class DataBinding {
                 var parent = new Atomic.UILayout();
                 var o = InspectorUtils.createAttrEditFieldWithSelectButton("", parent);
 
+                parent.layoutSize = Atomic.UI_LAYOUT_SIZE_AVAILABLE;
+                parent.gravity = Atomic.UI_GRAVITY_LEFT_RIGHT;
+                parent.layoutDistribution = Atomic.UI_LAYOUT_DISTRIBUTION_GRAVITY;
+
+
                 var lp = new Atomic.UILayoutParams();
                 lp.width = 140;
                 o.editField.layoutParams = lp;

+ 1 - 1
Source/Atomic/Atomic2D/CollisionShape2D.cpp

@@ -285,7 +285,7 @@ void CollisionShape2D::OnNodeSet(Node* node)
             rigidBody_->AddCollisionShape2D(this);
         }
         else
-            LOGERROR("No right body component in node, can not create collision shape");
+            LOGERROR("No rigid body component in node, can not create collision shape");
     }
 }
 

+ 1 - 1
Source/Atomic/Atomic2D/Constraint2D.cpp

@@ -130,7 +130,7 @@ void Constraint2D::OnNodeSet(Node* node)
         ownerBody_ = node->GetComponent<RigidBody2D>();
         if (!ownerBody_)
         {
-            LOGERROR("No right body component in node, can not create constraint");
+            LOGERROR("No rigid body component in node, can not create constraint");
             return;
         }
     }

+ 14 - 0
Source/ToolCore/Assets/PrefabImporter.cpp

@@ -4,6 +4,7 @@
 #include <Atomic/Scene/Scene.h>
 #include <Atomic/Scene/PrefabEvents.h>
 #include <Atomic/Scene/PrefabComponent.h>
+#include <Atomic/Atomic2D/AnimatedSprite2D.h>
 #include <Atomic/IO/FileSystem.h>
 
 #include "Asset.h"
@@ -60,6 +61,7 @@ void PrefabImporter::HandlePrefabSave(StringHash eventType, VariantMap& eventDat
 
     Vector<SharedPtr<Component>> tempComponents;
     Vector<SharedPtr<Node>> tempChildren;
+    Vector<SharedPtr<Node>> filterNodes;
 
     for (unsigned i = 0; i < rootComponents.Size(); i++)
     {
@@ -67,11 +69,23 @@ void PrefabImporter::HandlePrefabSave(StringHash eventType, VariantMap& eventDat
         {
             rootComponents[i]->SetTemporary(false);
             tempComponents.Push(rootComponents[i]);
+
+            // Animated sprites contain a temporary node we don't want to save in the prefab
+            if (rootComponents[i]->GetType() == AnimatedSprite2D::GetTypeStatic())
+            {
+                AnimatedSprite2D* asprite = (AnimatedSprite2D*) rootComponents[i].Get();
+                if (asprite->GetNode())
+                    filterNodes.Push(SharedPtr<Node>(asprite->GetNode()));
+            }
+
         }
     }
 
     for (unsigned i = 0; i < children.Size(); i++)
     {
+        if (filterNodes.Contains(children[i]))
+            continue;
+
         if (children[i]->IsTemporary())
         {
             children[i]->SetTemporary(false);