mirror of
https://github.com/overte-org/overte.git
synced 2025-08-10 05:23:09 +02:00
work around fb-21767 with a timer
This commit is contained in:
parent
4303dd589f
commit
84385e6061
1 changed files with 18 additions and 5 deletions
|
@ -463,6 +463,8 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
};
|
};
|
||||||
|
|
||||||
this.startEquipEntity = function (controllerData) {
|
this.startEquipEntity = function (controllerData) {
|
||||||
|
var _this = this;
|
||||||
|
|
||||||
this.dropGestureReset();
|
this.dropGestureReset();
|
||||||
this.clearEquipHaptics();
|
this.clearEquipHaptics();
|
||||||
Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand);
|
Controller.triggerHapticPulse(HAPTIC_PULSE_STRENGTH, HAPTIC_PULSE_DURATION, this.hand);
|
||||||
|
@ -505,17 +507,23 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
if (entityIsCloneable(grabbedProperties)) {
|
if (entityIsCloneable(grabbedProperties)) {
|
||||||
var cloneID = this.cloneHotspot(grabbedProperties, controllerData);
|
var cloneID = this.cloneHotspot(grabbedProperties, controllerData);
|
||||||
this.targetEntityID = cloneID;
|
this.targetEntityID = cloneID;
|
||||||
Entities.editEntity(this.targetEntityID, reparentProps);
|
|
||||||
controllerData.nearbyEntityPropertiesByID[this.targetEntityID] = grabbedProperties;
|
controllerData.nearbyEntityPropertiesByID[this.targetEntityID] = grabbedProperties;
|
||||||
isClone = true;
|
isClone = true;
|
||||||
} else if (!grabbedProperties.locked) {
|
} else if (grabbedProperties.locked) {
|
||||||
Entities.editEntity(this.targetEntityID, reparentProps);
|
|
||||||
} else {
|
|
||||||
this.grabbedHotspot = null;
|
this.grabbedHotspot = null;
|
||||||
this.targetEntityID = null;
|
this.targetEntityID = null;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// HACK -- when
|
||||||
|
// https://highfidelity.fogbugz.com/f/cases/21767/entity-edits-shortly-after-an-add-often-fail
|
||||||
|
// is resolved, this can just be an editEntity rather than a setTimeout.
|
||||||
|
this.editDelayTimeout = Script.setTimeout(function () {
|
||||||
|
_this.editDelayTimeout = null;
|
||||||
|
Entities.editEntity(_this.targetEntityID, reparentProps);
|
||||||
|
}, 100);
|
||||||
|
|
||||||
// we don't want to send startEquip message until the trigger is released. otherwise,
|
// we don't want to send startEquip message until the trigger is released. otherwise,
|
||||||
// guns etc will fire right as they are equipped.
|
// guns etc will fire right as they are equipped.
|
||||||
this.shouldSendStart = true;
|
this.shouldSendStart = true;
|
||||||
|
@ -526,7 +534,6 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"
|
joint: this.hand === RIGHT_HAND ? "RightHand" : "LeftHand"
|
||||||
}));
|
}));
|
||||||
|
|
||||||
var _this = this;
|
|
||||||
var grabEquipCheck = function() {
|
var grabEquipCheck = function() {
|
||||||
var args = [_this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID];
|
var args = [_this.hand === RIGHT_HAND ? "right" : "left", MyAvatar.sessionUUID];
|
||||||
Entities.callEntityMethod(_this.targetEntityID, "startEquip", args);
|
Entities.callEntityMethod(_this.targetEntityID, "startEquip", args);
|
||||||
|
@ -539,6 +546,12 @@ EquipHotspotBuddy.prototype.update = function(deltaTime, timestamp, controllerDa
|
||||||
};
|
};
|
||||||
|
|
||||||
this.endEquipEntity = function () {
|
this.endEquipEntity = function () {
|
||||||
|
|
||||||
|
if (this.editDelayTimeout) {
|
||||||
|
Script.clearTimeout(this.editDelayTimeout);
|
||||||
|
this.editDelayTimeout = null;
|
||||||
|
}
|
||||||
|
|
||||||
this.storeAttachPointInSettings();
|
this.storeAttachPointInSettings();
|
||||||
Entities.editEntity(this.targetEntityID, {
|
Entities.editEntity(this.targetEntityID, {
|
||||||
parentID: Uuid.NULL,
|
parentID: Uuid.NULL,
|
||||||
|
|
Loading…
Reference in a new issue