Browse Source

Remove the custom sound UI code as data bindings now handle this

Josh Engebretson 10 years ago
parent
commit
a5a6d51b3d
1 changed files with 0 additions and 48 deletions
  1. 0 48
      Script/AtomicEditor/ui/frames/inspector/ComponentInspector.ts

+ 0 - 48
Script/AtomicEditor/ui/frames/inspector/ComponentInspector.ts

@@ -135,10 +135,6 @@ class ComponentInspector extends Atomic.UISection {
             this.addModelUI(attrsVerticalLayout, component.typeName);
         }
 
-        if (component.typeName == "SoundSource" || component.typeName == "SoundSource3D") {
-            this.addSoundSourceUI(attrsVerticalLayout, component.typeName);
-        }
-
         if (component.typeName == "StaticSprite2D" || component.typeName == "AnimatedSprite2D") {
             this.addSpriteUI(attrsVerticalLayout, component.typeName);
         }
@@ -382,50 +378,6 @@ class ComponentInspector extends Atomic.UISection {
     }
 
 
-    addSoundSourceUI(layout: Atomic.UILayout, typeName: string) {
-
-        var sndSource = <Atomic.SoundSource> this.component;
-
-        var o = InspectorUtils.createAttrEditFieldWithSelectButton("Sound", layout);
-        var field = o.editField;
-        field.readOnly = true;
-        field.text = sndSource.sound ? sndSource.sound.name : "";
-
-        var select = o.selectButton;
-
-        select.onClick = () => {
-
-            EditorUI.getModelOps().showResourceSelection("Select Sound", "AudioImporter", function(asset: ToolCore.Asset) {
-
-                sndSource.sound = <Atomic.Sound> Atomic.cache.getResource("Sound", asset.path);
-                if (sndSource.sound)
-                    field.text = sndSource.sound.name;
-
-            });
-
-        }
-
-        // handle dropping of component on field
-        field.subscribeToEvent(field, "DragEnded", (ev: Atomic.DragEndedEvent) => {
-
-            if (ev.target == field) {
-
-                var importer = this.acceptAssetDrag("AudioImporter", ev);
-
-                if (importer) {
-
-                    sndSource.sound = <Atomic.Sound> Atomic.cache.getResource("Sound", importer.asset.path);
-                    if (sndSource.sound)
-                        field.text = sndSource.sound.name;
-
-                }
-            }
-
-        });
-
-
-    }
-
     addSpriteUI(layout: Atomic.UILayout, typeName: string) {
 
         var spriteComponent = <Atomic.StaticSprite2D> this.component;