Browse Source

Editor: Notify editor has been cleared.

Mr.doob 10 years ago
parent
commit
2d85150bf0
3 changed files with 12 additions and 0 deletions
  1. 1 0
      editor/index.html
  2. 4 0
      editor/js/Editor.js
  3. 7 0
      editor/js/Menubar.Add.js

+ 1 - 0
editor/index.html

@@ -169,6 +169,7 @@
 
 				var signals = editor.signals;
 
+				signals.editorCleared.add( saveState );
 				signals.geometryChanged.add( saveState );
 				signals.objectAdded.add( saveState );
 				signals.objectChanged.add( saveState );

+ 4 - 0
editor/js/Editor.js

@@ -22,6 +22,8 @@ var Editor = function () {
 
 		// notifications
 
+		editorCleared: new SIGNALS.Signal(),
+
 		savingStarted: new SIGNALS.Signal(),
 		savingFinished: new SIGNALS.Signal(),
 
@@ -381,6 +383,8 @@ Editor.prototype = {
 
 		this.deselect();
 
+		this.signals.editorCleared.dispatch();
+
 	},
 
 	//

+ 7 - 0
editor/js/Menubar.Add.js

@@ -21,6 +21,13 @@ Menubar.Add = function ( editor ) {
 	var meshCount = 0;
 	var lightCount = 0;
 
+	editor.signals.editorCleared.add( function () {
+
+		meshCount = 0;
+		lightCount = 0;
+
+	} );
+
 	// Group
 
 	var option = new UI.Panel();