mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-17 03:30:30 +02:00
only set animation properties if they actually changed
This commit is contained in:
parent
43f44f4131
commit
ea0022501b
1 changed files with 19 additions and 2 deletions
|
@ -22,6 +22,8 @@ EntityPropertyDialogBox = (function () {
|
|||
var dimensionZ;
|
||||
var rescalePercentage;
|
||||
var editModelID = -1;
|
||||
var previousAnimationFrameIndex;
|
||||
var previousAnimationSettings;
|
||||
|
||||
that.cleanup = function () {
|
||||
};
|
||||
|
@ -51,8 +53,10 @@ EntityPropertyDialogBox = (function () {
|
|||
array.push({ label: "Animation FPS:", value: properties.animationFPS });
|
||||
index++;
|
||||
array.push({ label: "Animation Frame:", value: properties.animationFrameIndex });
|
||||
previousAnimationFrameIndex = properties.animationFrameIndex;
|
||||
index++;
|
||||
array.push({ label: "Animation Settings:", value: properties.animationSettings });
|
||||
previousAnimationSettings = properties.animationSettings;
|
||||
index++;
|
||||
array.push({ label: "Textures:", value: properties.textures });
|
||||
index++;
|
||||
|
@ -241,8 +245,21 @@ EntityPropertyDialogBox = (function () {
|
|||
properties.animationURL = array[index++].value;
|
||||
properties.animationIsPlaying = 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;
|
||||
index++; // skip textureNames label
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue