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 <[email protected]>
This commit is contained in:
BurrowdevandClaude Opus 5.5 committed 2026-10-21 20:50:44 +03:00
1 parent 3256135df3
commit 34db374527
1 file changed
+24 -5
+24 -5
View File
@@ -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
{