From 91d0730e03e5d3884a706304ec83c5a4e544f0ca Mon Sep 17 00:00:00 2001 From: John Date: Thu, 2 Jul 2015 21:35:04 +0300 Subject: [PATCH] Pet mood is now attached to nametag instead of pet --- toontown/pets/Pet.py | 14 +++++++++++--- toontown/pets/PetAvatarPanel.py | 1 + toontown/town/TownBattleSOSPetInfoPanel.py | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/toontown/pets/Pet.py b/toontown/pets/Pet.py index f46c7d7a..24d3f0c1 100755 --- a/toontown/pets/Pet.py +++ b/toontown/pets/Pet.py @@ -278,10 +278,16 @@ class Pet(Avatar.Avatar): return color def generateMoods(self): + nodePath = NodePath(self.nametag.getIcon()) + + if not nodePath: + return + moodIcons = loader.loadModel('phase_4/models/char/petEmotes') - self.moodIcons = self.attachNewNode('moodIcons') - self.moodIcons.setScale(2.0) - self.moodIcons.setZ(4.65) + self.moodIcons = nodePath.attachNewNode('moodIcons') + self.moodIcons.setScale(6.0) + self.moodIcons.setZ(3.5) + moods = moodIcons.findAllMatches('**/+GeomNode') for moodNum in range(0, moods.getNumPaths()): mood = moods.getPath(moodNum) @@ -289,6 +295,8 @@ class Pet(Avatar.Avatar): mood.setBillboardPointEye() mood.hide() + moodIcons.removeNode() + def clearMood(self): if self.moodModel: self.moodModel.hide() diff --git a/toontown/pets/PetAvatarPanel.py b/toontown/pets/PetAvatarPanel.py index 39a025ac..ea398eee 100755 --- a/toontown/pets/PetAvatarPanel.py +++ b/toontown/pets/PetAvatarPanel.py @@ -279,6 +279,7 @@ class PetAvatarPanel(AvatarPanel.AvatarPanel): self.petModel.reparentTo(self.petView) self.petModel.enterNeutralHappy() self.petModel.startBlink() + self.petModel.setScale(0.75) self.nameLabel = DirectLabel(parent=self.frame, pos=(0, 0, 5.2), relief=None, text=avatar.getName(), text_font=avatar.getFont(), text_fg=Vec4(0, 0, 0, 1), text_pos=(0, 0), text_scale=0.4, text_wordwrap=7.5, text_shadow=(1, 1, 1, 1)) self.stateLabel = DirectLabel(parent=self.frame, pos=TTLocalizer.PAPstateLabelPos, relief=None, text='', text_font=avatar.getFont(), text_fg=Vec4(0, 0, 0, 1), text_scale=TTLocalizer.PAPstateLabel, text_wordwrap=TTLocalizer.PAPstateLabelWordwrap, text_shadow=(1, 1, 1, 1)) self.__refreshPetInfo(avatar) diff --git a/toontown/town/TownBattleSOSPetInfoPanel.py b/toontown/town/TownBattleSOSPetInfoPanel.py index 36964a0f..53898140 100755 --- a/toontown/town/TownBattleSOSPetInfoPanel.py +++ b/toontown/town/TownBattleSOSPetInfoPanel.py @@ -146,6 +146,7 @@ class TownBattleSOSPetInfoPanel(StateData.StateData): self.petModel.reparentTo(self.petView) self.petModel.enterNeutralHappy() self.petModel.startBlink() + self.petModel.setScale(0.75) self.nameLabel = DirectLabel(parent=self.frame, pos=(0, 0, 5.2), relief=None, text=avatar.getName(), text_font=avatar.getFont(), text_fg=Vec4(0, 0, 0, 1), text_pos=(0, 0), text_scale=0.4, text_wordwrap=7.5, text_shadow=(1, 1, 1, 1)) self.stateLabel = DirectLabel(parent=self.frame, pos=(0.7, 0, 3.5), relief=None, text='', text_font=avatar.getFont(), text_fg=Vec4(0, 0, 0, 1), text_scale=0.4, text_wordwrap=7.5, text_shadow=(1, 1, 1, 1)) self.__refreshPetInfo(avatar)