From 64945da5800482121b2928cc2abcd17dae5c969a Mon Sep 17 00:00:00 2001 From: Open Toontown <57279094+opentoontown@users.noreply.github.com> Date: Mon, 19 Sep 2022 17:27:16 -0400 Subject: [PATCH] fix some enum conversions --- toontown/effects/DustCloud.py | 2 +- toontown/pets/Pet.py | 2 +- toontown/pets/PetConstants.py | 2 +- toontown/pets/PetTraits.py | 4 ++-- toontown/pets/PetTricks.py | 2 +- toontown/racing/KartDNA.py | 6 +++--- toontown/racing/KartShopGlobals.py | 2 +- toontown/safezone/DistributedPicnicBasket.py | 2 +- toontown/shtiker/GolfPage.py | 2 +- toontown/shtiker/KartPage.py | 2 +- toontown/shtiker/OptionsPage.py | 2 +- toontown/speedchat/TTSCJellybeanJamMenu.py | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/toontown/effects/DustCloud.py b/toontown/effects/DustCloud.py index 02a5cf9..f7882cc 100644 --- a/toontown/effects/DustCloud.py +++ b/toontown/effects/DustCloud.py @@ -3,7 +3,7 @@ from direct.interval.IntervalGlobal import * from toontown.battle.BattleProps import globalPropPool from direct.directnotify import DirectNotifyGlobal from enum import IntEnum -SFX = IntEnum('SFX', ('poof, magic')) +SFX = IntEnum('SFX', ('poof', 'magic')) SFXPATHS = {SFX.poof: 'phase_4/audio/sfx/firework_distance_02.ogg', SFX.magic: 'phase_4/audio/sfx/SZ_DD_treasure.ogg'} diff --git a/toontown/pets/Pet.py b/toontown/pets/Pet.py index 0931f90..86f0ff0 100644 --- a/toontown/pets/Pet.py +++ b/toontown/pets/Pet.py @@ -29,7 +29,7 @@ Component2IconDict = {'boredom': 'Bored', class Pet(Avatar.Avatar): notify = DirectNotifyGlobal.directNotify.newCategory('Pet') SerialNum = 0 - Interactions = IntEnum('Interactions', ('SCRATCH, BEG, EAT, NEUTRAL')) + Interactions = IntEnum('Interactions', ('SCRATCH', 'BEG', 'EAT', 'NEUTRAL')) InteractAnims = {Interactions.SCRATCH: ('toPet', 'pet', 'fromPet'), Interactions.BEG: ('toBeg', 'beg', 'fromBeg'), Interactions.EAT: ('eat', 'swallow', 'neutral'), diff --git a/toontown/pets/PetConstants.py b/toontown/pets/PetConstants.py index dcc58a3..8cb8562 100644 --- a/toontown/pets/PetConstants.py +++ b/toontown/pets/PetConstants.py @@ -24,7 +24,7 @@ HungerChaseToonScale = 1.2 FleeFromOwnerScale = 0.5 GettingAttentionGoalScale = 1.2 GettingAttentionGoalScaleDur = 7.0 -AnimMoods = IntEnum('AnimMoods', ('EXCITED, SAD, NEUTRAL')) +AnimMoods = IntEnum('AnimMoods', ('EXCITED', 'SAD', 'NEUTRAL')) FwdSpeed = 12.0 RotSpeed = 360.0 _HappyMult = 1.0 diff --git a/toontown/pets/PetTraits.py b/toontown/pets/PetTraits.py index 413f61b..1467190 100644 --- a/toontown/pets/PetTraits.py +++ b/toontown/pets/PetTraits.py @@ -24,8 +24,8 @@ def gaussian(min, max, rng): class TraitDistribution: - TraitQuality = IntEnum('TraitQuality', ('VERY_BAD, BAD, AVERAGE, GOOD, VERY_GOOD')) - TraitTypes = IntEnum('TraitTypes', ('INCREASING, DECREASING')) + TraitQuality = IntEnum('TraitQuality', ('VERY_BAD', 'BAD', 'AVERAGE', 'GOOD', 'VERY_GOOD')) + TraitTypes = IntEnum('TraitTypes', ('INCREASING', 'DECREASING')) Sz2MinMax = None TraitType = None TraitCutoffs = {TraitTypes.INCREASING: {TraitQuality.VERY_BAD: 0.1, diff --git a/toontown/pets/PetTricks.py b/toontown/pets/PetTricks.py index 951ee4e..21ed459 100644 --- a/toontown/pets/PetTricks.py +++ b/toontown/pets/PetTricks.py @@ -2,7 +2,7 @@ from direct.showbase.PythonUtil import invertDictLossless from direct.interval.IntervalGlobal import * import random from enum import IntEnum -Tricks = IntEnum('Tricks', ('JUMP, BEG, PLAYDEAD, ROLLOVER, BACKFLIP, DANCE, SPEAK, BALK,')) +Tricks = IntEnum('Tricks', ('JUMP', 'BEG', 'PLAYDEAD', 'ROLLOVER', 'BACKFLIP', 'DANCE', 'SPEAK', 'BALK')) NonHappyMinActualTrickAptitude = 0.1 NonHappyMaxActualTrickAptitude = 0.6 MinActualTrickAptitude = 0.5 diff --git a/toontown/racing/KartDNA.py b/toontown/racing/KartDNA.py index a20245a..72784b4 100644 --- a/toontown/racing/KartDNA.py +++ b/toontown/racing/KartDNA.py @@ -6,10 +6,10 @@ from enum import IntEnum if (__debug__): import pdb import copy -KartDNA = IntEnum('KartDNA', ('bodyType, bodyColor, accColor, ebType, spType, fwwType, bwwType, rimsType, decalType')) +KartDNA = IntEnum('KartDNA', ('bodyType', 'bodyColor', 'accColor', 'ebType', 'spType', 'fwwType', 'bwwType', 'rimsType', 'decalType')) InvalidEntry = -1 -KartInfo = IntEnum('KartInfo', ('name, model, cost, viewDist, decalId, LODmodel1, LODmodel2')) -AccInfo = IntEnum('KartInfo', ('name, model, cost, texCard, attach')) +KartInfo = IntEnum('KartInfo', ('name', 'model', 'cost', 'viewDist', 'decalId', 'LODmodel1', 'LODmodel2')) +AccInfo = IntEnum('AccInfo', ('name', 'model', 'cost', 'texCard', 'attach')) kNames = TTLocalizer.KartDNA_KartNames KartDict = {0: (kNames[0], 'phase_6/models/karting/Kart1_Final', diff --git a/toontown/racing/KartShopGlobals.py b/toontown/racing/KartShopGlobals.py index 78e14d6..fb56d9e 100644 --- a/toontown/racing/KartShopGlobals.py +++ b/toontown/racing/KartShopGlobals.py @@ -15,7 +15,7 @@ class KartGlobals: COUNTDOWN_TIME = 30 BOARDING_TIME = 10.0 ENTER_RACE_TIME = 6.0 - ERROR_CODE = IntEnum('ERROR_CODE', ('success, eGeneric, eTickets, eBoardOver, eNoKart, eOccupied, eTrackClosed, eTooLate, eUnpaid')) + ERROR_CODE = IntEnum('ERROR_CODE', ('success', 'eGeneric', 'eTickets', 'eBoardOver', 'eNoKart', 'eOccupied', 'eTrackClosed', 'eTooLate', 'eUnpaid')) FRONT_LEFT_SPOT = 0 FRONT_RIGHT_SPOT = 1 REAR_LEFT_SPOT = 2 diff --git a/toontown/safezone/DistributedPicnicBasket.py b/toontown/safezone/DistributedPicnicBasket.py index 3e115b2..75af429 100644 --- a/toontown/safezone/DistributedPicnicBasket.py +++ b/toontown/safezone/DistributedPicnicBasket.py @@ -19,7 +19,7 @@ from toontown.battle.BattleSounds import * from enum import IntEnum class DistributedPicnicBasket(DistributedObject.DistributedObject): - seatState = IntEnum('seatState', ('Empty, Full, Eating')) + seatState = IntEnum('seatState', ('Empty', 'Full', 'Eating')) notify = DirectNotifyGlobal.directNotify.newCategory('DistributedPicnicBasket') def __init__(self, cr): diff --git a/toontown/shtiker/GolfPage.py b/toontown/shtiker/GolfPage.py index 0b0722a..dd065d6 100644 --- a/toontown/shtiker/GolfPage.py +++ b/toontown/shtiker/GolfPage.py @@ -10,7 +10,7 @@ from toontown.golf import GolfGlobals from enum import IntEnum if (__debug__): import pdb -PageMode = IntEnum('PageMode', ('Records, Trophy')) +PageMode = IntEnum('PageMode', ('Records', 'Trophy')) class GolfPage(ShtikerPage): notify = DirectNotifyGlobal.directNotify.newCategory('GolfPage') diff --git a/toontown/shtiker/KartPage.py b/toontown/shtiker/KartPage.py index bb830e7..3a00323 100644 --- a/toontown/shtiker/KartPage.py +++ b/toontown/shtiker/KartPage.py @@ -12,7 +12,7 @@ from .FishPage import FishingTrophy from enum import IntEnum if (__debug__): import pdb -PageMode = IntEnum('PageMode', ('Customize, Records, Trophy')) +PageMode = IntEnum('PageMode', ('Customize', 'Records', 'Trophy')) class KartPage(ShtikerPage): notify = DirectNotifyGlobal.directNotify.newCategory('KartPage') diff --git a/toontown/shtiker/OptionsPage.py b/toontown/shtiker/OptionsPage.py index dd71b2c..9ad3c57 100644 --- a/toontown/shtiker/OptionsPage.py +++ b/toontown/shtiker/OptionsPage.py @@ -50,7 +50,7 @@ speedChatStyles = ((2000, (170 / 255.0, 120 / 255.0, 20 / 255.0), (165 / 255.0, 120 / 255.0, 50 / 255.0), (210 / 255.0, 200 / 255.0, 180 / 255.0))) -PageMode = IntEnum('PageMode', ('Options, Codes')) +PageMode = IntEnum('PageMode', ('Options', 'Codes')) class OptionsPage(ShtikerPage.ShtikerPage): notify = DirectNotifyGlobal.directNotify.newCategory('OptionsPage') diff --git a/toontown/speedchat/TTSCJellybeanJamMenu.py b/toontown/speedchat/TTSCJellybeanJamMenu.py index 683f09c..ccfd025 100644 --- a/toontown/speedchat/TTSCJellybeanJamMenu.py +++ b/toontown/speedchat/TTSCJellybeanJamMenu.py @@ -13,7 +13,7 @@ JellybeanJamMenu = [(OTPLocalizer.JellybeanJamMenuSections[0], [30180, 30188, 30189, 30190])] -JellybeanJamPhases = IntEnum('JellybeanJamPhases', ('TROLLEY, FISHING, PARTIES')) +JellybeanJamPhases = IntEnum('JellybeanJamPhases', ('TROLLEY', 'FISHING', 'PARTIES')) PhaseSpecifPhrases = [30180, 30181, 30182] class TTSCJellybeanJamMenu(SCMenu):