From 34db374527c65ffaae42bddc6bd4a297473fe226 Mon Sep 17 00:00:00 2001 From: Burrowdev Date: Wed, 21 Oct 2026 20:50:44 +0300 Subject: [PATCH] feat(pets): the pet form's name follows the Usernames / Animal Names switch Playing as a pet showed the pet's name over it whatever the settings menu said. Now it shows the player's username, as the switch does by default, or the pet's name with Animal Names, and changes when the switch is flipped. Co-Authored-By: Claude Opus 5.5 --- swf-src/AvatarWorldView.as | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/swf-src/AvatarWorldView.as b/swf-src/AvatarWorldView.as index 6c9b3d1..0f5020c 100644 --- a/swf-src/AvatarWorldView.as +++ b/swf-src/AvatarWorldView.as @@ -2095,7 +2095,7 @@ package avatar _splash.showShadow(false); } _currPetName = LocalizationManager.translatePetName(param5); - _namebar.setAvName(_currPetName); + setPetFormName(); } else { @@ -2152,7 +2152,7 @@ package avatar { _splash.showShadow(false); } - _namebar.setAvName(_currPetName); + setPetFormName(); } else { @@ -2171,6 +2171,21 @@ package avatar return _shouldShowPetOnly; } + // the name over the pet in its form, as the settings menu's Usernames / + // Animal Names switch says: the player's username (the default), or + // the pet's name + private function setPetFormName() : void + { + if(Utility.isSettingOn(MySettings.SETTINGS_USERNAME_BADGE)) + { + _namebar.setAvName(_avatar,true,gMainFrame.userInfo.getUserInfoByUserName(_avatar.userName)); + } + else + { + _namebar.setAvName(_currPetName ? _currPetName : _avatar.avName); + } + } + // chat balloons and emotes sit over the pet in its form, as the // party's do (AvatarUtility's pet offsets) private function placeChatBalloon() : void @@ -2687,7 +2702,11 @@ package avatar public function updateNameBarName() : void { - if(_namebar) + if(_namebar && _shouldShowPetOnly) + { + setPetFormName(); + } + else if(_namebar) { _namebar.setAvName(_avatar,Utility.isSettingOn(MySettings.SETTINGS_USERNAME_BADGE),gMainFrame.userInfo.getUserInfoByUserName(_avatar.userName)); } @@ -2714,9 +2733,9 @@ package avatar { _namebar.setColorAndBadge(0); _namebar.setColorBadgeAndXp(0,0,_isMember); - if(_shouldShowPetOnly && _currPetName) + if(_shouldShowPetOnly) { - _namebar.setAvName(_currPetName); + setPetFormName(); } else {