only set animation properties if they actually changed

This commit is contained in:
ZappoMan 2014-11-13 08:13:30 -08:00
parent 43f44f4131
commit ea0022501b

View file

@ -22,6 +22,8 @@ EntityPropertyDialogBox = (function () {
var dimensionZ; var dimensionZ;
var rescalePercentage; var rescalePercentage;
var editModelID = -1; var editModelID = -1;
var previousAnimationFrameIndex;
var previousAnimationSettings;
that.cleanup = function () { that.cleanup = function () {
}; };
@ -51,8 +53,10 @@ EntityPropertyDialogBox = (function () {
array.push({ label: "Animation FPS:", value: properties.animationFPS }); array.push({ label: "Animation FPS:", value: properties.animationFPS });
index++; index++;
array.push({ label: "Animation Frame:", value: properties.animationFrameIndex }); array.push({ label: "Animation Frame:", value: properties.animationFrameIndex });
previousAnimationFrameIndex = properties.animationFrameIndex;
index++; index++;
array.push({ label: "Animation Settings:", value: properties.animationSettings }); array.push({ label: "Animation Settings:", value: properties.animationSettings });
previousAnimationSettings = properties.animationSettings;
index++; index++;
array.push({ label: "Textures:", value: properties.textures }); array.push({ label: "Textures:", value: properties.textures });
index++; index++;
@ -241,8 +245,21 @@ EntityPropertyDialogBox = (function () {
properties.animationURL = array[index++].value; properties.animationURL = array[index++].value;
properties.animationIsPlaying = array[index++].value; properties.animationIsPlaying = array[index++].value;
properties.animationFPS = array[index++].value; properties.animationFPS = array[index++].value;
properties.animationFrameIndex = array[index++].value;
properties.animationSettings = array[index++].value; var newAnimationFrameIndex = array[index++].value;
var newAnimationSettings = array[index++].value;
if (previousAnimationFrameIndex != newAnimationFrameIndex) {
properties.animationFrameIndex = newAnimationFrameIndex;
} else {
delete properties.animationFrameIndex;
}
if (previousAnimationSettings != newAnimationSettings) {
properties.animationSettings = newAnimationSettings;
} else {
delete properties.animationSettings;
}
properties.textures = array[index++].value; properties.textures = array[index++].value;
index++; // skip textureNames label index++; // skip textureNames label
} }