mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 06:37:27 +02:00
Merge pull request #10945 from rickdaniels/jh21402
Address #21402 Added a handler to Sit.js script for the onLoadComplet…
This commit is contained in:
commit
1cb030992f
1 changed files with 12 additions and 0 deletions
|
@ -126,6 +126,16 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handler for user changing the avatar model while sitting. There's currently an issue with changing avatar models while override role animations are applied,
|
||||||
|
// so to avoid that problem, re-apply the role overrides once the model has finished changing.
|
||||||
|
this.modelURLChangeFinished = function () {
|
||||||
|
print("Sitter's model has FINISHED changing. Reapply anim role overrides.");
|
||||||
|
var roles = this.rolesToOverride();
|
||||||
|
for (i in roles) {
|
||||||
|
MyAvatar.overrideRoleAnimation(roles[i], ANIMATION_URL, ANIMATION_FPS, true, ANIMATION_FIRST_FRAME, ANIMATION_LAST_FRAME);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.sitDown = function() {
|
this.sitDown = function() {
|
||||||
if (this.checkSeatForAvatar()) {
|
if (this.checkSeatForAvatar()) {
|
||||||
print("Someone is already sitting in that chair.");
|
print("Someone is already sitting in that chair.");
|
||||||
|
@ -164,12 +174,14 @@
|
||||||
return { headType: 0 };
|
return { headType: 0 };
|
||||||
}, ["headType"]);
|
}, ["headType"]);
|
||||||
Script.update.connect(this, this.update);
|
Script.update.connect(this, this.update);
|
||||||
|
MyAvatar.onLoadComplete.connect(this, this.modelURLChangeFinished);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.standUp = function() {
|
this.standUp = function() {
|
||||||
print("Standing up (" + this.entityID + ")");
|
print("Standing up (" + this.entityID + ")");
|
||||||
MyAvatar.removeAnimationStateHandler(this.animStateHandlerID);
|
MyAvatar.removeAnimationStateHandler(this.animStateHandlerID);
|
||||||
Script.update.disconnect(this, this.update);
|
Script.update.disconnect(this, this.update);
|
||||||
|
MyAvatar.onLoadComplete.disconnect(this, this.modelURLChangeFinished);
|
||||||
|
|
||||||
if (MyAvatar.sessionUUID === this.getSeatUser()) {
|
if (MyAvatar.sessionUUID === this.getSeatUser()) {
|
||||||
this.setSeatUser(null);
|
this.setSeatUser(null);
|
||||||
|
|
Loading…
Reference in a new issue