Skip to content

Commit

Permalink
Merge pull request #73 from AleziaKurdis/FlyAvatar-FixClosureCase
Browse files Browse the repository at this point in the history
Fly Avatar app: Fix when the Fly Avatar is present at closure.
  • Loading branch information
ksuprynowicz authored Mar 10, 2024
2 parents 45c2705 + 98248d9 commit 4bdffcb
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions applications/flyAvatar/app-flyAvatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
var INTERCALL_DELAY = 200; //0.3 sec
var FLY_AVATAR_SETTING_KEY = "overte.application.more.flyAvatar.avatarUrl";
var FLY_AVATAR_SWITCH_SETTING_KEY = "overte.application.more.flyAvatar.switch";
var FLY_AVATAR_ORIGINAL_AVATAR_SETTING_KEY = "overte.application.more.flyAvatar.originalAvatarUrl";
var flyAvatarSwitch = true;
var flyAvatarUrl = "";
var originalAvatarUrl = "";
Expand Down Expand Up @@ -115,6 +116,7 @@
MyAvatar.skeletonModelURLChanged.connect(function () {
if (!MyAvatar.isFlying() && MyAvatar.skeletonModelURL !== flyAvatarUrl) {
originalAvatarUrl = MyAvatar.skeletonModelURL;
Settings.setValue( FLY_AVATAR_ORIGINAL_AVATAR_SETTING_KEY, originalAvatarUrl);
}
});

Expand Down Expand Up @@ -173,6 +175,12 @@
originalAvatarUrl = MyAvatar.skeletonModelURL;
flyAvatarUrl = Settings.getValue( FLY_AVATAR_SETTING_KEY, "" );
flyAvatarSwitch = Settings.getValue( FLY_AVATAR_SWITCH_SETTING_KEY, true );
if (originalAvatarUrl === flyAvatarUrl) {
var lastRecordedOriginalAvatar = Settings.getValue( FLY_AVATAR_ORIGINAL_AVATAR_SETTING_KEY, "" );
if (lastRecordedOriginalAvatar !== "") {
originalAvatarUrl = lastRecordedOriginalAvatar;
}
}
if (flyAvatarSwitch) {
inactiveIcon = APP_ICON_INACTIVE_ON;
} else {
Expand Down

0 comments on commit 4bdffcb

Please sign in to comment.