|
@@ -11,6 +11,24 @@ History = function ( editor ) {
|
|
this.lastCmdTime = new Date();
|
|
this.lastCmdTime = new Date();
|
|
this.idCounter = 0;
|
|
this.idCounter = 0;
|
|
|
|
|
|
|
|
+ this.historyDisabled = false;
|
|
|
|
+
|
|
|
|
+ // signals
|
|
|
|
+
|
|
|
|
+ var scope = this;
|
|
|
|
+
|
|
|
|
+ this.editor.signals.startPlayer.add( function () {
|
|
|
|
+
|
|
|
|
+ scope.historyDisabled = true;
|
|
|
|
+
|
|
|
|
+ } );
|
|
|
|
+
|
|
|
|
+ this.editor.signals.stopPlayer.add( function () {
|
|
|
|
+
|
|
|
|
+ scope.historyDisabled = false;
|
|
|
|
+
|
|
|
|
+ } );
|
|
|
|
+
|
|
};
|
|
};
|
|
|
|
|
|
History.prototype = {
|
|
History.prototype = {
|
|
@@ -61,6 +79,13 @@ History.prototype = {
|
|
|
|
|
|
undo: function () {
|
|
undo: function () {
|
|
|
|
|
|
|
|
+ if ( this.historyDisabled ) {
|
|
|
|
+
|
|
|
|
+ alert("Undo/Redo disabled while scene is playing.");
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
var cmd = undefined;
|
|
var cmd = undefined;
|
|
|
|
|
|
if ( this.undos.length > 0 ) {
|
|
if ( this.undos.length > 0 ) {
|
|
@@ -93,6 +118,13 @@ History.prototype = {
|
|
|
|
|
|
redo: function () {
|
|
redo: function () {
|
|
|
|
|
|
|
|
+ if ( this.historyDisabled ) {
|
|
|
|
+
|
|
|
|
+ alert("Undo/Redo disabled while scene is playing.");
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
var cmd = undefined;
|
|
var cmd = undefined;
|
|
|
|
|
|
if ( this.redos.length > 0 ) {
|
|
if ( this.redos.length > 0 ) {
|
|
@@ -214,6 +246,13 @@ History.prototype = {
|
|
|
|
|
|
goToState: function ( id ) {
|
|
goToState: function ( id ) {
|
|
|
|
|
|
|
|
+ if ( this.historyDisabled ) {
|
|
|
|
+
|
|
|
|
+ alert("Undo/Redo disabled while scene is playing.");
|
|
|
|
+ return;
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
this.editor.signals.sceneGraphChanged.active = false;
|
|
this.editor.signals.sceneGraphChanged.active = false;
|
|
this.editor.signals.historyChanged.active = false;
|
|
this.editor.signals.historyChanged.active = false;
|
|
|
|
|