mirror of
https://github.com/overte-org/overte.git
synced 2025-07-27 19:46:49 +02:00
Merge pull request #12668 from alexiamandeville/marketplace-update
Updating repo script to match marketplace script
This commit is contained in:
commit
32e7e5087e
1 changed files with 11 additions and 23 deletions
|
@ -126,16 +126,6 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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.");
|
||||||
|
@ -155,11 +145,11 @@
|
||||||
MyAvatar.characterControllerEnabled = false;
|
MyAvatar.characterControllerEnabled = false;
|
||||||
MyAvatar.hmdLeanRecenterEnabled = false;
|
MyAvatar.hmdLeanRecenterEnabled = false;
|
||||||
var roles = this.rolesToOverride();
|
var roles = this.rolesToOverride();
|
||||||
for (i in roles) {
|
for (var i = 0; i < roles.length; i++) {
|
||||||
MyAvatar.overrideRoleAnimation(roles[i], ANIMATION_URL, ANIMATION_FPS, true, ANIMATION_FIRST_FRAME, ANIMATION_LAST_FRAME);
|
MyAvatar.overrideRoleAnimation(roles[i], ANIMATION_URL, ANIMATION_FPS, true, ANIMATION_FIRST_FRAME, ANIMATION_LAST_FRAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var i in OVERRIDEN_DRIVE_KEYS) {
|
for (i = 0; i < OVERRIDEN_DRIVE_KEYS.length; i++) {
|
||||||
MyAvatar.disableDriveKey(OVERRIDEN_DRIVE_KEYS[i]);
|
MyAvatar.disableDriveKey(OVERRIDEN_DRIVE_KEYS[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -174,14 +164,12 @@
|
||||||
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);
|
||||||
|
@ -190,12 +178,12 @@
|
||||||
if (Settings.getValue(SETTING_KEY) === this.entityID) {
|
if (Settings.getValue(SETTING_KEY) === this.entityID) {
|
||||||
Settings.setValue(SETTING_KEY, "");
|
Settings.setValue(SETTING_KEY, "");
|
||||||
|
|
||||||
for (var i in OVERRIDEN_DRIVE_KEYS) {
|
for (var i = 0; i < OVERRIDEN_DRIVE_KEYS.length; i++) {
|
||||||
MyAvatar.enableDriveKey(OVERRIDEN_DRIVE_KEYS[i]);
|
MyAvatar.enableDriveKey(OVERRIDEN_DRIVE_KEYS[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
var roles = this.rolesToOverride();
|
var roles = this.rolesToOverride();
|
||||||
for (i in roles) {
|
for (i = 0; i < roles.length; i++) {
|
||||||
MyAvatar.restoreRoleAnimation(roles[i]);
|
MyAvatar.restoreRoleAnimation(roles[i]);
|
||||||
}
|
}
|
||||||
MyAvatar.characterControllerEnabled = true;
|
MyAvatar.characterControllerEnabled = true;
|
||||||
|
@ -272,7 +260,7 @@
|
||||||
// Check if a drive key is pressed
|
// Check if a drive key is pressed
|
||||||
var hasActiveDriveKey = false;
|
var hasActiveDriveKey = false;
|
||||||
for (var i in OVERRIDEN_DRIVE_KEYS) {
|
for (var i in OVERRIDEN_DRIVE_KEYS) {
|
||||||
if (MyAvatar.getRawDriveKey(OVERRIDEN_DRIVE_KEYS[i]) != 0.0) {
|
if (MyAvatar.getRawDriveKey(OVERRIDEN_DRIVE_KEYS[i]) !== 0.0) {
|
||||||
hasActiveDriveKey = true;
|
hasActiveDriveKey = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue