Pet mood is now attached to nametag instead of pet

This commit is contained in:
John 2015-07-02 21:35:04 +03:00
parent cbec66d244
commit 91d0730e03
3 changed files with 13 additions and 3 deletions

View file

@ -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()

View file

@ -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)

View file

@ -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)