only set animationIsPlaying if it changed

This commit is contained in:
ZappoMan 2014-11-13 08:37:54 -08:00
parent 09a06c9d82
commit 55c177594b

View file

@ -22,6 +22,7 @@ EntityPropertyDialogBox = (function () {
var dimensionZ;
var rescalePercentage;
var editModelID = -1;
var previousAnimationIsPlaying;
var previousAnimationFrameIndex;
var previousAnimationSettings;
@ -49,6 +50,7 @@ EntityPropertyDialogBox = (function () {
array.push({ label: "Animation URL:", value: properties.animationURL });
index++;
array.push({ label: "Animation is playing:", value: properties.animationIsPlaying });
previousAnimationIsPlaying = properties.animationIsPlaying;
index++;
array.push({ label: "Animation FPS:", value: properties.animationFPS });
index++;
@ -243,18 +245,24 @@ EntityPropertyDialogBox = (function () {
if (properties.type == "Model") {
properties.modelURL = array[index++].value;
properties.animationURL = array[index++].value;
properties.animationIsPlaying = array[index++].value;
var newAnimationIsPlaying = array[index++].value;
if (previousAnimationIsPlaying != newAnimationIsPlaying) {
properties.animationIsPlaying = newAnimationIsPlaying;
} else {
delete properties.animationIsPlaying;
}
properties.animationFPS = array[index++].value;
var newAnimationFrameIndex = array[index++].value;
var newAnimationSettings = array[index++].value;
if (previousAnimationFrameIndex != newAnimationFrameIndex) {
properties.animationFrameIndex = newAnimationFrameIndex;
} else {
delete properties.animationFrameIndex;
}
var newAnimationSettings = array[index++].value;
if (previousAnimationSettings != newAnimationSettings) {
properties.animationSettings = newAnimationSettings;
} else {