mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
fix bad css merge, add particle property debounce
This commit is contained in:
parent
5c1972e3f4
commit
a88678fb70
2 changed files with 19 additions and 3 deletions
|
@ -1107,7 +1107,7 @@ body#entity-list-body {
|
|||
position: relative; /* New positioning context. */
|
||||
}
|
||||
|
||||
#search-area {
|
||||
#filter-area {
|
||||
padding-right: 168px;
|
||||
padding-bottom: 24px;
|
||||
}
|
||||
|
|
|
@ -1304,6 +1304,7 @@ const JSON_EDITOR_ROW_DIV_INDEX = 2;
|
|||
var elGroups = {};
|
||||
var properties = {};
|
||||
var colorPickers = {};
|
||||
var particlePropertyUpdates = {};
|
||||
var selectedEntityProperties;
|
||||
var lastEntityID = null;
|
||||
|
||||
|
@ -1534,9 +1535,23 @@ function updateProperty(originalPropertyName, propertyValue) {
|
|||
} else {
|
||||
propertyUpdate[originalPropertyName] = propertyValue;
|
||||
}
|
||||
updateProperties(propertyUpdate);
|
||||
// queue up particle property changes with the debounced sync to avoid
|
||||
// causing particle emitting to reset each frame when updating values
|
||||
if (properties[originalPropertyName].isParticleProperty) {
|
||||
Object.keys(propertyUpdate).forEach(function (propertyUpdateKey) {
|
||||
particlePropertyUpdates[propertyUpdateKey] = propertyUpdate[propertyUpdateKey];
|
||||
});
|
||||
particleSyncDebounce();
|
||||
} else {
|
||||
updateProperties(propertyUpdate);
|
||||
}
|
||||
}
|
||||
|
||||
var particleSyncDebounce = _.debounce(function () {
|
||||
updateProperties(particlePropertyUpdates);
|
||||
particlePropertyUpdates = {};
|
||||
}, DEBOUNCE_TIMEOUT);
|
||||
|
||||
function updateProperties(propertiesToUpdate) {
|
||||
EventBridge.emitWebEvent(JSON.stringify({
|
||||
id: lastEntityID,
|
||||
|
@ -2717,7 +2732,8 @@ function loaded() {
|
|||
let property = {
|
||||
data: propertyData,
|
||||
elementID: propertyElementID,
|
||||
name: propertyName,
|
||||
name: propertyName,
|
||||
isParticleProperty: group.id.includes("particles"),
|
||||
elProperty: elProperty
|
||||
};
|
||||
properties[propertyID] = property;
|
||||
|
|
Loading…
Reference in a new issue