Browse Source

Set CSComponent inspector title to class name

Matt Benic 9 years ago
parent
commit
3b5747f31d
1 changed files with 14 additions and 1 deletions
  1. 14 1
      Script/AtomicEditor/ui/frames/inspector/SelectionInspector.ts

+ 14 - 1
Script/AtomicEditor/ui/frames/inspector/SelectionInspector.ts

@@ -168,6 +168,8 @@ class CSComponentSection extends ComponentSection {
 
         super(editType, inspector);
 
+        this.updateTextFromClassAttr();
+
         this.hasDynamicAttr = true;
 
         this.subscribeToEvent(this, "AttributeEditResourceChanged", (ev) => this.handleAttributeEditResourceChanged(ev));
@@ -187,7 +189,7 @@ class CSComponentSection extends ComponentSection {
 
           var attrInfos = csc.getAttributes();
           this.updateDynamicAttrInfos(attrInfos);
-
+          this.updateTextFromClassAttr();
         }
 
     }
@@ -205,6 +207,17 @@ class CSComponentSection extends ComponentSection {
 
     }
 
+    private updateTextFromClassAttr() {
+        this.text = this.editType.typeName;
+
+        var object = this.editType.getFirstObject();
+        if (object) {
+            var value = object.getAttribute("Class");
+            if (value)
+                this.text = value;
+        }
+    }
+
 }
 
 // Node Inspector + Component Inspectors