mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 15:29:32 +02:00
Style formatting, updating comments
This commit is contained in:
parent
92acbdbbd7
commit
6f6a9b2c64
1 changed files with 10 additions and 6 deletions
|
@ -16,7 +16,8 @@
|
||||||
(function() { // BEGIN LOCAL_SCOPE
|
(function() { // BEGIN LOCAL_SCOPE
|
||||||
|
|
||||||
|
|
||||||
var EMOTE_ANIMATIONS = ['Crying', 'Surprised', 'Dancing', 'Cheering', 'Waving', 'Fall', 'Pointing', 'Clapping', 'Sit1', 'Sit2', 'Sit3', 'Love'];
|
var EMOTE_ANIMATIONS =
|
||||||
|
['Crying', 'Surprised', 'Dancing', 'Cheering', 'Waving', 'Fall', 'Pointing', 'Clapping', 'Sit1', 'Sit2', 'Sit3', 'Love'];
|
||||||
var ANIMATIONS = Array();
|
var ANIMATIONS = Array();
|
||||||
|
|
||||||
var eventMappingName = "io.highfidelity.away"; // restoreAnimation on hand controller button events, too
|
var eventMappingName = "io.highfidelity.away"; // restoreAnimation on hand controller button events, too
|
||||||
|
@ -80,17 +81,17 @@ function onWebEventReceived(event) {
|
||||||
var emoteName = event.data;
|
var emoteName = event.data;
|
||||||
|
|
||||||
if (emoteName === "Sit"){
|
if (emoteName === "Sit"){
|
||||||
emoteName = event.data + randSit; // "Sit1, Sit2, Sit3"
|
emoteName = event.data + randSit; // Sit1, Sit2, Sit3
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ANIMATIONS[emoteName].resource.state == FINISHED) {
|
if (ANIMATIONS[emoteName].resource.state =+= FINISHED) {
|
||||||
|
|
||||||
if (activeTimer !== false) {
|
if (activeTimer !== false) {
|
||||||
Script.clearTimeout(activeTimer);
|
Script.clearTimeout(activeTimer);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the activeEmote is different from the chosen emote, then play the new emote. Other wise,
|
// If the activeEmote is different from the chosen emote, then play the new emote
|
||||||
// This is a second click on the same emote as the activeEmote, and we will just stop it.
|
// This is a second click on the same emote as the activeEmote, and we will just stop it
|
||||||
if (activeEmote !== emoteName) {
|
if (activeEmote !== emoteName) {
|
||||||
activeEmote = emoteName;
|
activeEmote = emoteName;
|
||||||
|
|
||||||
|
@ -98,6 +99,7 @@ function onWebEventReceived(event) {
|
||||||
// Sit is the only animation currently that plays and then ends at the last frame
|
// Sit is the only animation currently that plays and then ends at the last frame
|
||||||
if (emoteName.match(/^Sit.*$/)) {
|
if (emoteName.match(/^Sit.*$/)) {
|
||||||
|
|
||||||
|
// If user provides input during a sit, the avatar animation state should be restored
|
||||||
Controller.keyPressEvent.connect(restoreAnimation);
|
Controller.keyPressEvent.connect(restoreAnimation);
|
||||||
MyAvatar.overrideAnimation(ANIMATIONS[emoteName].url, FPS, false, 0, frameCount);
|
MyAvatar.overrideAnimation(ANIMATIONS[emoteName].url, FPS, false, 0, frameCount);
|
||||||
|
|
||||||
|
@ -124,9 +126,11 @@ function onWebEventReceived(event) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If a user provides input, end the emote animation and restore the navigation animation states (idle, walk, run)
|
// Restore the navigation animation states (idle, walk, run)
|
||||||
function restoreAnimation() {
|
function restoreAnimation() {
|
||||||
MyAvatar.restoreAnimation();
|
MyAvatar.restoreAnimation();
|
||||||
|
|
||||||
|
// Make sure the input is disconnected after animations are restored so it doesn't affect any emotes other than sit
|
||||||
Controller.keyPressEvent.disconnect(restoreAnimation);
|
Controller.keyPressEvent.disconnect(restoreAnimation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue