mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 20:23:06 +02:00
Merge pull request #16102 from RebeccaStankus/emoteTimeout
Restore emote indicator after reaction emote
This commit is contained in:
commit
5edf251714
1 changed files with 21 additions and 2 deletions
|
@ -150,7 +150,7 @@ function getClapPosition() {
|
||||||
var validLeftJoints = ["LeftHandMiddle2", "LeftHand", "LeftArm"];
|
var validLeftJoints = ["LeftHandMiddle2", "LeftHand", "LeftArm"];
|
||||||
var leftPosition = getValidJointPosition(validLeftJoints);
|
var leftPosition = getValidJointPosition(validLeftJoints);
|
||||||
|
|
||||||
var validRightJoints = ["RightHandMiddle2", "RightHand", "RightArm"];;
|
var validRightJoints = ["RightHandMiddle2", "RightHand", "RightArm"];
|
||||||
var rightPosition = getValidJointPosition(validRightJoints);
|
var rightPosition = getValidJointPosition(validRightJoints);
|
||||||
|
|
||||||
var centerPosition = Vec3.sum(leftPosition, rightPosition);
|
var centerPosition = Vec3.sum(leftPosition, rightPosition);
|
||||||
|
@ -193,10 +193,19 @@ function toggleReaction(reaction) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function maybeDeleteRemoteIndicatorTimeout() {
|
||||||
|
if (restoreEmoteIndicatorTimeout) {
|
||||||
|
Script.clearTimeout(restoreEmoteIndicatorTimeout);
|
||||||
|
restoreEmoteIndicatorTimeout = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var reactionsBegun = [];
|
var reactionsBegun = [];
|
||||||
var pointReticle = null;
|
var pointReticle = null;
|
||||||
var mouseMoveEventsConnected = false;
|
var mouseMoveEventsConnected = false;
|
||||||
function beginReactionWrapper(reaction) {
|
function beginReactionWrapper(reaction) {
|
||||||
|
maybeDeleteRemoteIndicatorTimeout();
|
||||||
|
|
||||||
reactionsBegun.forEach(function(react) {
|
reactionsBegun.forEach(function(react) {
|
||||||
endReactionWrapper(react);
|
endReactionWrapper(react);
|
||||||
});
|
});
|
||||||
|
@ -287,13 +296,22 @@ function mouseMoveEvent(event) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var WAIT_TO_RESTORE_EMOTE_INDICATOR_ICON_MS = 2000;
|
||||||
|
var restoreEmoteIndicatorTimeout;
|
||||||
function triggerReactionWrapper(reaction) {
|
function triggerReactionWrapper(reaction) {
|
||||||
|
maybeDeleteRemoteIndicatorTimeout();
|
||||||
|
|
||||||
reactionsBegun.forEach(function(react) {
|
reactionsBegun.forEach(function(react) {
|
||||||
endReactionWrapper(react);
|
endReactionWrapper(react);
|
||||||
});
|
});
|
||||||
|
|
||||||
MyAvatar.triggerReaction(reaction);
|
MyAvatar.triggerReaction(reaction);
|
||||||
updateEmoteIndicatorIcon("images/" + reaction + "_Icon.svg");
|
updateEmoteIndicatorIcon("images/" + reaction + "_Icon.svg");
|
||||||
|
|
||||||
|
restoreEmoteIndicatorTimeout = Script.setTimeout(function() {
|
||||||
|
updateEmoteIndicatorIcon("images/emote_Icon.svg");
|
||||||
|
restoreEmoteIndicatorTimeout = null;
|
||||||
|
}, WAIT_TO_RESTORE_EMOTE_INDICATOR_ICON_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
function maybeClearReticleUpdateLimiterTimeout() {
|
function maybeClearReticleUpdateLimiterTimeout() {
|
||||||
|
@ -326,7 +344,6 @@ function endReactionWrapper(reaction) {
|
||||||
mouseMoveEventsConnected = false;
|
mouseMoveEventsConnected = false;
|
||||||
}
|
}
|
||||||
maybeClearReticleUpdateLimiterTimeout();
|
maybeClearReticleUpdateLimiterTimeout();
|
||||||
intersectedEntityOrAvatarID = null;
|
|
||||||
deleteOldReticles();
|
deleteOldReticles();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -538,6 +555,7 @@ var EmojiAPI = Script.require("./emojiApp/simplifiedEmoji.js");
|
||||||
var emojiAPI = new EmojiAPI();
|
var emojiAPI = new EmojiAPI();
|
||||||
var keyPressSignalsConnected = false;
|
var keyPressSignalsConnected = false;
|
||||||
var emojiCodeMap;
|
var emojiCodeMap;
|
||||||
|
var customEmojiCodeMap;
|
||||||
function init() {
|
function init() {
|
||||||
deleteOldReticles();
|
deleteOldReticles();
|
||||||
|
|
||||||
|
@ -599,6 +617,7 @@ function shutdown() {
|
||||||
emojiAPI.unload();
|
emojiAPI.unload();
|
||||||
maybeClearClapSoundInterval();
|
maybeClearClapSoundInterval();
|
||||||
maybeClearReticleUpdateLimiterTimeout();
|
maybeClearReticleUpdateLimiterTimeout();
|
||||||
|
maybeDeleteRemoteIndicatorTimeout();
|
||||||
|
|
||||||
Window.minimizedChanged.disconnect(onWindowMinimizedChanged);
|
Window.minimizedChanged.disconnect(onWindowMinimizedChanged);
|
||||||
Window.geometryChanged.disconnect(onGeometryChanged);
|
Window.geometryChanged.disconnect(onGeometryChanged);
|
||||||
|
|
Loading…
Reference in a new issue