From 0c12e38c83c5e9c3070e2c3432780fb8b1651986 Mon Sep 17 00:00:00 2001 From: Little Cat Date: Thu, 29 Dec 2022 21:32:43 -0400 Subject: [PATCH] pets: Fix crash for newer panda. --- toontown/pets/PetObserve.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/toontown/pets/PetObserve.py b/toontown/pets/PetObserve.py index 9373082..0b5d096 100644 --- a/toontown/pets/PetObserve.py +++ b/toontown/pets/PetObserve.py @@ -1,5 +1,5 @@ from direct.directnotify import DirectNotifyGlobal -from direct.showbase.PythonUtil import list2dict, Enum +from enum import IntEnum from toontown.pets import PetTricks import types notify = DirectNotifyGlobal.directNotify.newCategory('PetObserve') @@ -16,8 +16,8 @@ def send(zoneIds, petObserve): messenger.send(getEventName(zoneId), [petObserve]) -Phrases = Enum('HI, BYE, YES, NO, SOOTHE, PRAISE, CRITICISM, HAPPY,SAD, ANGRY, HURRY, QUESTION, FRIENDLY, LETS_PLAY,COME, FOLLOW_ME, STAY, NEED_LAFF, NEED_GAGS, NEED_JB,GO_AWAY, DO_TRICK,') -Actions = Enum('FEED, SCRATCH,ATTENDED_START, ATTENDED_STOP,ATTENDING_START, ATTENDING_STOP,CHANGE_ZONE, LOGOUT,GARDEN') +Phrases = IntEnum('Phrases', ('HI', 'BYE', 'YES', 'NO', 'SOOTHE', 'PRAISE', 'CRITICISM', 'HAPPY', 'SAD', 'ANGRY', 'HURRY', 'QUESTION', 'FRIENDLY', 'LETS_PLAY', 'COME', 'FOLLOW_ME', 'STAY', 'NEED_LAFF', 'NEED_GAGS', 'NEED_JB','GO_AWAY', 'DO_TRICK'), start=0) +Actions = IntEnum('Actions', ('FEED', 'SCRATCH', 'ATTENDED_START', 'ATTENDED_STOP', 'ATTENDING_START', 'ATTENDING_STOP', 'CHANGE_ZONE', 'LOGOUT', 'GARDEN'), start=0) class PetObserve: @@ -76,7 +76,7 @@ class PetPhraseObserve(PetObserve): petBrain._handlePhraseObserve(self) def __repr__(self): - return '%s(%s,%s)' % (self.__class__.__name__, Phrases.getString(self.petPhrase), self.avId) + return '%s(%s,%s)' % (self.__class__.__name__, Phrases(self.petPhrase).name, self.avId) class SCObserve(PetPhraseObserve):