mirror of
https://github.com/overte-org/overte.git
synced 2025-06-25 06:29:50 +02: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. */
|
position: relative; /* New positioning context. */
|
||||||
}
|
}
|
||||||
|
|
||||||
#search-area {
|
#filter-area {
|
||||||
padding-right: 168px;
|
padding-right: 168px;
|
||||||
padding-bottom: 24px;
|
padding-bottom: 24px;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1304,6 +1304,7 @@ const JSON_EDITOR_ROW_DIV_INDEX = 2;
|
||||||
var elGroups = {};
|
var elGroups = {};
|
||||||
var properties = {};
|
var properties = {};
|
||||||
var colorPickers = {};
|
var colorPickers = {};
|
||||||
|
var particlePropertyUpdates = {};
|
||||||
var selectedEntityProperties;
|
var selectedEntityProperties;
|
||||||
var lastEntityID = null;
|
var lastEntityID = null;
|
||||||
|
|
||||||
|
@ -1534,9 +1535,23 @@ function updateProperty(originalPropertyName, propertyValue) {
|
||||||
} else {
|
} else {
|
||||||
propertyUpdate[originalPropertyName] = propertyValue;
|
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) {
|
function updateProperties(propertiesToUpdate) {
|
||||||
EventBridge.emitWebEvent(JSON.stringify({
|
EventBridge.emitWebEvent(JSON.stringify({
|
||||||
id: lastEntityID,
|
id: lastEntityID,
|
||||||
|
@ -2717,7 +2732,8 @@ function loaded() {
|
||||||
let property = {
|
let property = {
|
||||||
data: propertyData,
|
data: propertyData,
|
||||||
elementID: propertyElementID,
|
elementID: propertyElementID,
|
||||||
name: propertyName,
|
name: propertyName,
|
||||||
|
isParticleProperty: group.id.includes("particles"),
|
||||||
elProperty: elProperty
|
elProperty: elProperty
|
||||||
};
|
};
|
||||||
properties[propertyID] = property;
|
properties[propertyID] = property;
|
||||||
|
|
Loading…
Reference in a new issue