From b2bab83cbb243b1bc67c44729cfd0e8b77d07fcf Mon Sep 17 00:00:00 2001 From: DenialMC Date: Sat, 25 Apr 2015 10:26:27 +0300 Subject: [PATCH] So much Jizzney removing that Hitler toke his life --- astron/dclass/united.dc | 42 - otp/ai/AIBase.py | 11 +- otp/ai/AIBaseGlobal.py | 3 - otp/ai/AIZoneData.py | 2 - otp/ai/GarbageLeakServerEventAggregator.py | 1 - otp/ai/TimeManager.py | 176 +-- otp/ai/TimeManagerAI.py | 20 +- otp/avatar/AvatarHandle.py | 11 +- otp/avatar/DistributedPlayerAI.py | 12 - otp/chat/ChatInputNormal.py | 5 +- otp/chat/ChatInputTyped.py | 5 +- otp/chat/ChatInputWhiteListFrame.py | 5 +- otp/distributed/ClsendTracker.py | 2 +- otp/distributed/DCClassImports.py | 3 +- otp/distributed/OTPClientRepository.py | 13 +- otp/level/AmbientSound.py | 8 +- otp/level/BasicEntities.py | 5 +- otp/level/CollisionSolidEntity.py | 13 +- otp/level/DistributedEntityAI.py | 10 +- otp/level/DistributedLevel.py | 52 +- otp/level/DistributedLevelAI.py | 82 +- otp/level/EditMgr.py | 4 - otp/level/EditMgrAI.py | 41 - otp/level/EditMgrBase.py | 25 - otp/level/EditorGlobals.py | 40 - otp/level/Entity.py | 16 +- otp/level/EntityCreator.py | 2 - otp/level/EntityCreatorAI.py | 2 - otp/level/EntityTypeRegistry.py | 99 -- otp/level/EntityTypes.py | 12 - otp/level/EntrancePoint.py | 9 +- otp/level/Level.py | 44 +- otp/level/LevelConstants.py | 3 +- otp/level/LevelSpec.py | 317 +---- otp/level/LocatorEntity.py | 7 +- otp/level/ModelEntity.py | 6 +- otp/level/PathEntity.py | 14 +- otp/level/PropSpinner.py | 8 +- otp/level/VisibilityExtender.py | 21 +- otp/level/ZoneEntity.py | 16 +- otp/otpbase/OTPGlobals.py | 1 - toontown/building/ElevatorConstants.py | 9 - .../cogdominium/CogdoBoardroomGameSpec.py | 7 - toontown/cogdominium/CogdoCraneGameSpec.py | 7 - toontown/cogdominium/CogdoLevelGameBase.py | 38 - .../cogdominium/DistCogdoBoardroomGame.py | 8 +- toontown/cogdominium/DistCogdoCrane.py | 14 +- toontown/cogdominium/DistCogdoCraneGame.py | 36 +- toontown/cogdominium/DistCogdoCraneGameAI.py | 9 +- .../cogdominium/DistCogdoCraneMoneyBag.py | 8 +- toontown/cogdominium/DistCogdoLevelGame.py | 28 +- toontown/coghq/ActiveCell.py | 10 +- toontown/coghq/BarrelBase.py | 29 +- toontown/coghq/BattleBlocker.py | 8 +- toontown/coghq/BattleBlockerAI.py | 16 +- .../BossbotCountryClubEntrance_Action00.py | 7 - .../BossbotCountryClubFairwayRoom_Battle00.py | 10 - .../BossbotCountryClubGreenRoom_Action00.py | 7 - .../BossbotCountryClubGreenRoom_Action01.py | 7 - .../BossbotCountryClubGreenRoom_Action02.py | 7 - .../BossbotCountryClubKartRoom_Battle00.py | 7 - .../BossbotCountryClubMazeRoom_Battle00.py | 7 - .../BossbotCountryClubMazeRoom_Battle01.py | 7 - .../BossbotCountryClubMazeRoom_Battle02.py | 7 - ...ossbotCountryClubPresidentRoom_Battle00.py | 7 - .../BossbotCountryClubTeeOffRoom_Action00.py | 7 - .../BossbotCountryClubTeeOffRoom_Action01.py | 7 - .../BossbotCountryClubTeeOffRoom_Action02.py | 7 - .../coghq/CashbotMintBoilerRoom_Action00.py | 7 - .../coghq/CashbotMintBoilerRoom_Battle00.py | 7 - .../coghq/CashbotMintBoilerRoom_Battle01.py | 7 - .../coghq/CashbotMintControlRoom_Battle00.py | 7 - .../coghq/CashbotMintDuctRoom_Action00.py | 7 - .../coghq/CashbotMintDuctRoom_Battle00.py | 7 - .../coghq/CashbotMintDuctRoom_Battle01.py | 7 - .../coghq/CashbotMintEntrance_Action00.py | 7 - .../coghq/CashbotMintGearRoom_Action00.py | 7 - .../coghq/CashbotMintGearRoom_Battle00.py | 7 - .../coghq/CashbotMintGearRoom_Battle01.py | 7 - .../CashbotMintLavaRoomFoyer_Action00.py | 7 - .../CashbotMintLavaRoomFoyer_Action01.py | 7 - .../CashbotMintLavaRoomFoyer_Battle00.py | 7 - .../CashbotMintLavaRoomFoyer_Battle01.py | 7 - .../coghq/CashbotMintLavaRoom_Action00.py | 7 - toontown/coghq/CashbotMintLobby_Action00.py | 7 - toontown/coghq/CashbotMintLobby_Battle00.py | 7 - toontown/coghq/CashbotMintLobby_Battle01.py | 7 - toontown/coghq/CashbotMintOilRoom_Battle00.py | 7 - .../CashbotMintPaintMixerReward_Battle00.py | 7 - .../coghq/CashbotMintPaintMixer_Action00.py | 7 - .../coghq/CashbotMintPipeRoom_Action00.py | 7 - .../coghq/CashbotMintPipeRoom_Battle00.py | 7 - .../coghq/CashbotMintPipeRoom_Battle01.py | 7 - .../coghq/CashbotMintStomperAlley_Action00.py | 7 - toontown/coghq/ConveyorBelt.py | 8 +- toontown/coghq/CountryClubRoomBase.py | 10 +- toontown/coghq/DistributedCountryClubAI.py | 5 - toontown/coghq/DistributedCountryClubRoom.py | 15 - .../coghq/DistributedCountryClubRoomAI.py | 4 - toontown/coghq/DistributedDoorEntity.py | 25 +- toontown/coghq/DistributedDoorEntityAI.py | 8 +- toontown/coghq/DistributedElevatorMarker.py | 4 - toontown/coghq/DistributedFactory.py | 13 - toontown/coghq/DistributedFactoryAI.py | 9 - toontown/coghq/DistributedInGameEditor.py | 774 ------------ toontown/coghq/DistributedLaserFieldAI.py | 3 +- toontown/coghq/DistributedLawOffice.py | 2 - toontown/coghq/DistributedLawOfficeFloor.py | 13 - toontown/coghq/DistributedLawOfficeFloorAI.py | 4 - toontown/coghq/DistributedLift.py | 9 +- toontown/coghq/DistributedMintAI.py | 5 - toontown/coghq/DistributedMintRoom.py | 17 - toontown/coghq/DistributedMintRoomAI.py | 4 - toontown/coghq/DistributedStageAI.py | 5 - toontown/coghq/DistributedStageRoom.py | 15 - toontown/coghq/DistributedStageRoomAI.py | 4 - toontown/coghq/DistributedStomper.py | 10 +- toontown/coghq/DistributedSwitch.py | 8 +- toontown/coghq/DistributedSwitchAI.py | 8 +- toontown/coghq/FactoryBase.py | 12 +- toontown/coghq/FactoryLevelMgr.py | 8 +- toontown/coghq/FactoryMockupSpec.py | 7 - toontown/coghq/FactorySpecs.py | 8 +- toontown/coghq/GearEntity.py | 38 +- toontown/coghq/InGameEditor.py | 1051 ----------------- toontown/coghq/InGameEditorDCImports.py | 3 - toontown/coghq/InGameEditorDCImportsAI.py | 3 - toontown/coghq/InGameEditorElements.py | 37 - toontown/coghq/LawOfficeBase.py | 10 +- toontown/coghq/LawOffice_Spec_Tier0_a.py | 8 - toontown/coghq/LawOffice_Spec_Tier0_b.py | 8 - toontown/coghq/LawbotLegFactorySpec.py | 7 - .../coghq/LawbotOfficeBoilerRoom_Action01.py | 7 - .../coghq/LawbotOfficeBoilerRoom_Battle00.py | 7 - .../LawbotOfficeBoilerRoom_Security00.py | 7 - .../coghq/LawbotOfficeBoilerRoom_Trap00.py | 7 - .../coghq/LawbotOfficeDiamondRoom_Action00.py | 7 - .../coghq/LawbotOfficeDiamondRoom_Action01.py | 7 - .../coghq/LawbotOfficeDiamondRoom_Battle00.py | 7 - .../LawbotOfficeDiamondRoom_Security00.py | 7 - .../coghq/LawbotOfficeDiamondRoom_Trap00.py | 7 - .../coghq/LawbotOfficeEntrance_Action00.py | 7 - .../coghq/LawbotOfficeGearRoom_Action00.py | 7 - .../coghq/LawbotOfficeGearRoom_Battle00.py | 7 - .../coghq/LawbotOfficeGearRoom_Platform00.py | 7 - .../coghq/LawbotOfficeGearRoom_Security00.py | 7 - toontown/coghq/LawbotOfficeLobby_Action00.py | 7 - toontown/coghq/LawbotOfficeLobby_Action01.py | 7 - toontown/coghq/LawbotOfficeLobby_Lights00.py | 7 - toontown/coghq/LawbotOfficeLobby_Trap00.py | 7 - .../coghq/LawbotOfficeOilRoom_Battle00.py | 7 - .../coghq/LawbotOfficeOilRoom_Battle01.py | 7 - toontown/coghq/LevelSuitPlannerAI.py | 5 - toontown/coghq/MintProduct.py | 9 +- toontown/coghq/MintRoomBase.py | 10 +- toontown/coghq/PathMasterEntity.py | 29 +- toontown/coghq/PlatformEntity.py | 8 +- toontown/coghq/SellbotBrutalLegFactorySpec.py | 7 - toontown/coghq/SellbotLegFactorySpec.py | 7 - toontown/coghq/SellbotMegaCorpLegSpec.py | 7 - toontown/coghq/StageRoomBase.py | 10 +- toontown/estate/DistributedLawnDecor.py | 5 - toontown/hood/InteractiveAnimatedProp.py | 2 - .../parties/DistributedPartyCatchActivity.py | 19 - toontown/pets/DistributedPet.py | 2 - toontown/pets/DistributedPetAI.py | 16 - toontown/pets/DistributedPetProxyAI.py | 4 - toontown/pets/PetBrain.py | 21 - toontown/pets/PetGoalMgr.py | 21 - toontown/suit/DistributedCashbotBossAI.py | 2 - toontown/suit/DistributedGoon.py | 13 - toontown/toon/DistributedToon.py | 4 - toontown/toon/DistributedToonAI.py | 12 - toontown/toon/LocalToon.py | 21 - 174 files changed, 64 insertions(+), 4163 deletions(-) delete mode 100644 otp/level/EditMgr.py delete mode 100644 otp/level/EditMgrAI.py delete mode 100644 otp/level/EditMgrBase.py delete mode 100644 otp/level/EditorGlobals.py delete mode 100644 otp/level/EntityTypeRegistry.py delete mode 100644 toontown/cogdominium/CogdoLevelGameBase.py delete mode 100644 toontown/coghq/DistributedInGameEditor.py delete mode 100644 toontown/coghq/InGameEditor.py delete mode 100644 toontown/coghq/InGameEditorDCImports.py delete mode 100644 toontown/coghq/InGameEditorDCImportsAI.py delete mode 100644 toontown/coghq/InGameEditorElements.py diff --git a/astron/dclass/united.dc b/astron/dclass/united.dc index 1ce0ac99..86818c4d 100644 --- a/astron/dclass/united.dc +++ b/astron/dclass/united.dc @@ -67,20 +67,6 @@ dclass TimeManager : DistributedObject { serverTime(uint8 context, int32 timestap, uint32 timeOfDay); setDisconnectReason(uint8) airecv clsend; setExceptionInfo(string(0-1024)) airecv clsend; - setSignature(string(0-1024) signature, char prcHash[16], - char pycHash[16]) airecv clsend; - setFrameRate(uint16/10 fps, uint16/1000 deviation, uint16 numAvatars, - string(0-256) locationCode, uint32/10 timeInLocation, - uint32/10 timeInGame, string(0-256) gameOptionsCode, - uint16 vendorId, uint16 deviceId, uint32/10 processMemory, - uint32/10 pageFileUsage, uint32/10 physicalMemory, - uint32 pageFaultCount, OSInfo, CPUSpeed, uint16 cpuCores, - uint16 logicalCPUs, string(0-256) apiName) airecv clsend; - checkForGarbageLeaks(bool) airecv clsend; - setNumAIGarbageLeaks(uint32); - setClientGarbageLeak(uint32, string(0-1024)) airecv clsend; - checkAvOnDistrict(uint32 context, DoId avatar) clsend airecv; - checkAvOnDistrictResult(uint32 context, DoId av, bool isOnDistrict); }; dclass DistributedDirectory : DistributedObject { @@ -447,7 +433,6 @@ from toontown.coghq import DistributedStageRoom/AI from toontown.coghq import DistributedStageBattle/AI from toontown.pets.PetDCImports/AI import * from toontown.pets import DistributedPetProxy/AI -from toontown.coghq.InGameEditorDCImports/AI import * from toontown.distributed import ToontownDistrict/AI from toontown.distributed import ToontownDistrictStats/AI from toontown.racing import DistributedVehicle/AI @@ -1714,10 +1699,6 @@ dclass AccountDate : DistributedObject { requestDateResult(string); }; -dclass DistributedMyTest : DistributedObject { - setMyTest(uint16) broadcast; -}; - dclass DistributedTreasure : DistributedObject { setTreasureType(uint16) required broadcast ram; setPosition(int16/10, int16/10, int16/10) required broadcast ram; @@ -1732,14 +1713,6 @@ dclass DistributedCashbotBossTreasure : DistributedTreasure { setStyle(uint16) required broadcast ram; }; -dclass DistributedLargeBlobSender : DistributedObject { - setMode(uint8) required broadcast ram; - setTargetAvId(uint32) required broadcast ram; - setChunk(blob); - setFilename(string); - setAck() airecv clsend; -}; - dclass DistributedLevel : DistributedObject { setLevelZoneId(uint32) required broadcast ram; setAvIds(uint32[]) required broadcast ram; @@ -1747,10 +1720,6 @@ dclass DistributedLevel : DistributedObject { setZoneIds(uint32[]) broadcast ram; setStartTimestamp(int32) broadcast ram; setOuch(uint8) airecv clsend; - requestCurrentLevelSpec(string, string) airecv clsend; - setSpecDeny(blob); - setSpecSenderDoId(uint32); - setAttribChange(uint32, blob, blob, blob) broadcast; }; dclass DistributedEntity : DistributedObject { @@ -2364,17 +2333,6 @@ dclass DistributedStageRoom : DistributedLevel { setDefeated() broadcast ram; }; -dclass DistributedInGameEditor : DistributedObject { - setEditorAvId(uint32) required broadcast ram; - setEditUsername(blob) required broadcast ram; - setLevelDoId(uint32) required broadcast ram; - requestCurrentLevelSpec() airecv clsend; - setSpecSenderDoId(uint32); - setEdit(uint32, blob, blob, blob) airecv clsend; - setAttribChange(uint32, blob, blob, blob); - setFinished() airecv clsend; -}; - dclass DistributedLift : DistributedEntity { setStateTransition(uint8, uint8, uint32) required broadcast ram; setAvatarEnter() airecv clsend; diff --git a/otp/ai/AIBase.py b/otp/ai/AIBase.py index f53b4d48..9e343928 100644 --- a/otp/ai/AIBase.py +++ b/otp/ai/AIBase.py @@ -6,7 +6,6 @@ import time from direct.directnotify.DirectNotifyGlobal import * from direct.interval.IntervalManager import ivalMgr from direct.showbase import EventManager -from direct.showbase import ExceptionVarDump from direct.showbase import PythonUtil from direct.showbase.BulletinBoardGlobal import * from direct.showbase.EventManagerGlobal import * @@ -25,10 +24,6 @@ class AIBase: def __init__(self): self.config = getConfigShowbase() __builtins__['__dev__'] = self.config.GetBool('want-dev', 0) - logStackDump = (self.config.GetBool('log-stack-dump', (not __dev__)) or self.config.GetBool('ai-log-stack-dump', (not __dev__))) - uploadStackDump = self.config.GetBool('upload-stack-dump', 0) - if logStackDump or uploadStackDump: - ExceptionVarDump.install(logStackDump, uploadStackDump) if self.config.GetBool('use-vfs', 1): vfs = VirtualFileSystem.getGlobalPtr() else: @@ -58,15 +53,11 @@ class AIBase: __builtins__['globalClock'] = globalClock __builtins__['vfs'] = vfs __builtins__['hidden'] = self.hidden - AIBase.notify.info('__dev__ == %s' % __dev__) PythonUtil.recordFunctorCreationStacks() self.wantStats = self.config.GetBool('want-pstats', 0) Task.TaskManager.pStatsTasks = self.config.GetBool('pstats-tasks', 0) taskMgr.resumeFunc = PStatClient.resumeAfterPause - defaultValue = 1 - if __dev__: - defaultValue = 0 - wantFakeTextures = self.config.GetBool('want-fake-textures-ai', defaultValue) + wantFakeTextures = self.config.GetBool('want-fake-textures-ai', 1) if wantFakeTextures: loadPrcFileData('aibase', 'textures-header-only 1') self.wantPets = self.config.GetBool('want-pets', 1) diff --git a/otp/ai/AIBaseGlobal.py b/otp/ai/AIBaseGlobal.py index 3f8185a8..7a600f31 100644 --- a/otp/ai/AIBaseGlobal.py +++ b/otp/ai/AIBaseGlobal.py @@ -20,7 +20,4 @@ def inspect(anObject): __builtins__['inspect'] = inspect -if not __debug__ and __dev__: - notify = directNotify.newCategory('ShowBaseGlobal') - notify.error("You must set 'want-dev' to false in non-debug mode.") taskMgr.finalInit() diff --git a/otp/ai/AIZoneData.py b/otp/ai/AIZoneData.py index 7173026e..ff11c97f 100644 --- a/otp/ai/AIZoneData.py +++ b/otp/ai/AIZoneData.py @@ -93,8 +93,6 @@ class AIZoneDataObj: if not hasattr(self, '_nonCollidableParent'): render = self.getRender() self._nonCollidableParent = render.attachNewNode('nonCollidables') - if __dev__: - pass return self._nonCollidableParent def getParentMgr(self): diff --git a/otp/ai/GarbageLeakServerEventAggregator.py b/otp/ai/GarbageLeakServerEventAggregator.py index 7585145a..5d43366d 100644 --- a/otp/ai/GarbageLeakServerEventAggregator.py +++ b/otp/ai/GarbageLeakServerEventAggregator.py @@ -37,7 +37,6 @@ class GarbageLeakServerEventAggregator(DirectObject): self._sentLeakDesc2num.setdefault(desc, 0) num = curNum - self._sentLeakDesc2num[desc] if num > 0: - base.cr.timeManager.d_setClientGarbageLeak(num, desc) self._sentLeakDesc2num[desc] = curNum if task: diff --git a/otp/ai/TimeManager.py b/otp/ai/TimeManager.py index b4ce06f9..cc45f1e6 100644 --- a/otp/ai/TimeManager.py +++ b/otp/ai/TimeManager.py @@ -29,15 +29,12 @@ class TimeManager(DistributedObject.DistributedObject): self.extraSkew = base.config.GetInt('time-manager-extra-skew', 0) if self.extraSkew != 0: self.notify.info('Simulating clock skew of %0.3f s' % self.extraSkew) - self.reportFrameRateInterval = base.config.GetDouble('report-frame-rate-interval', 300.0) self.talkResult = 0 self.thisContext = -1 self.nextContext = 0 self.attemptCount = 0 self.start = 0 self.lastAttempt = -self.minWait * 2 - self.setFrameRateInterval(self.reportFrameRateInterval) - self._numClientGarbage = 0 def generate(self): self._gotFirstTimeSync = False @@ -47,8 +44,6 @@ class TimeManager(DistributedObject.DistributedObject): DistributedObject.DistributedObject.generate(self) self.accept(OTPGlobals.SynchronizeHotkey, self.handleHotkey) self.accept('clock_error', self.handleClockError) - if __dev__ and base.config.GetBool('enable-garbage-hotkey', 0): - self.accept(OTPGlobals.DetectGarbageHotkey, self.handleDetectGarbageHotkey) if self.updateFreq > 0: self.startTask() return @@ -62,11 +57,8 @@ class TimeManager(DistributedObject.DistributedObject): def disable(self): self.ignore(OTPGlobals.SynchronizeHotkey) - if __dev__: - self.ignore(OTPGlobals.DetectGarbageHotkey) self.ignore('clock_error') self.stopTask() - taskMgr.remove('frameRateMonitor') if self.cr.timeManager == self: self.cr.timeManager = None del self._gotFirstTimeSync @@ -75,10 +67,8 @@ class TimeManager(DistributedObject.DistributedObject): def delete(self): self.ignore(OTPGlobals.SynchronizeHotkey) - self.ignore(OTPGlobals.DetectGarbageHotkey) self.ignore('clock_error') self.stopTask() - taskMgr.remove('frameRateMonitor') if self.cr.timeManager == self: self.cr.timeManager = None DistributedObject.DistributedObject.delete(self) @@ -159,168 +149,4 @@ class TimeManager(DistributedObject.DistributedObject): info = PythonUtil.describeException() self.notify.info('Client exception: %s' % info) self.sendUpdate('setExceptionInfo', [info]) - self.cr.flush() - - def setStackDump(self, dump): - self.notify.debug('Stack dump: %s' % fastRepr(dump)) - maxLen = 900 - dataLeft = base64.b64encode(dump) - index = 0 - while dataLeft: - if len(dataLeft) >= maxLen: - data = dataLeft[:maxLen] - dataLeft = dataLeft[maxLen:] - else: - data = dataLeft - dataLeft = None - self.sendUpdate('setStackDump', [index, data]) - index += 1 - self.cr.flush() - - return - - def d_setSignature(self, signature, hash, pyc): - self.sendUpdate('setSignature', [signature, hash, pyc]) - - def setFrameRateInterval(self, frameRateInterval): - if frameRateInterval == 0: - return - if not base.frameRateMeter: - maxFrameRateInterval = base.config.GetDouble('max-frame-rate-interval', 30.0) - globalClock.setAverageFrameRateInterval(min(frameRateInterval, maxFrameRateInterval)) - taskMgr.remove('frameRateMonitor') - taskMgr.doMethodLater(frameRateInterval, self.frameRateMonitor, 'frameRateMonitor') - - def frameRateMonitor(self, task): - from otp.avatar.Avatar import Avatar - vendorId = 0 - deviceId = 0 - processMemory = 0 - pageFileUsage = 0 - physicalMemory = 0 - pageFaultCount = 0 - osInfo = (os.name, - 0, - 0, - 0) - cpuSpeed = (0, 0) - numCpuCores = 0 - numLogicalCpus = 0 - apiName = 'None' - if getattr(base, 'pipe', None): - di = base.pipe.getDisplayInformation() - if di.getDisplayState() == DisplayInformation.DSSuccess: - vendorId = di.getVendorId() - deviceId = di.getDeviceId() - di.updateMemoryInformation() - oomb = 1.0 / (1024.0 * 1024.0) - processMemory = di.getProcessMemory() * oomb - pageFileUsage = di.getPageFileUsage() * oomb - physicalMemory = di.getPhysicalMemory() * oomb - pageFaultCount = di.getPageFaultCount() / 1000.0 - osInfo = (os.name, - di.getOsPlatformId(), - di.getOsVersionMajor(), - di.getOsVersionMinor()) - if sys.platform == 'darwin': - osInfo = self.getMacOsInfo(osInfo) - di.updateCpuFrequency(0) - ooghz = 1e-09 - cpuSpeed = (di.getMaximumCpuFrequency() * ooghz, di.getCurrentCpuFrequency() * ooghz) - numCpuCores = di.getNumCpuCores() - numLogicalCpus = di.getNumLogicalCpus() - apiName = base.pipe.getInterfaceName() - self.d_setFrameRate(max(0, globalClock.getAverageFrameRate()), max(0, globalClock.calcFrameRateDeviation()), len(Avatar.ActiveAvatars), base.locationCode or '', max(0, time.time() - base.locationCodeChanged), max(0, globalClock.getRealTime()), base.gameOptionsCode, vendorId, deviceId, processMemory, pageFileUsage, physicalMemory, pageFaultCount, osInfo, cpuSpeed, numCpuCores, numLogicalCpus, apiName) - return task.again - - def d_setFrameRate(self, fps, deviation, numAvs, locationCode, timeInLocation, timeInGame, gameOptionsCode, vendorId, deviceId, processMemory, pageFileUsage, physicalMemory, pageFaultCount, osInfo, cpuSpeed, numCpuCores, numLogicalCpus, apiName): - info = '%0.1f fps|%0.3fd|%s avs|%s|%d|%d|%s|0x%04x|0x%04x|%0.1fMB|%0.1fMB|%0.1fMB|%d|%s|%s|%s cpus|%s' % (fps, - deviation, - numAvs, - locationCode, - timeInLocation, - timeInGame, - gameOptionsCode, - vendorId, - deviceId, - processMemory, - pageFileUsage, - physicalMemory, - pageFaultCount, - '%s.%d.%d.%d' % osInfo, - '%0.03f,%0.03f' % cpuSpeed, - '%d,%d' % (numCpuCores, numLogicalCpus), - apiName) - print 'frame rate: %s' % info - self.sendUpdate('setFrameRate', [fps, - deviation, - numAvs, - locationCode, - timeInLocation, - timeInGame, - gameOptionsCode, - vendorId, - deviceId, - processMemory, - pageFileUsage, - physicalMemory, - pageFaultCount, - osInfo, - cpuSpeed, - numCpuCores, - numLogicalCpus, - apiName]) - - if __dev__: - - def handleDetectGarbageHotkey(self): - self._numClientGarbage = GarbageReport.b_checkForGarbageLeaks(wantReply=True) - if self._numClientGarbage: - s = '%s client garbage cycles found, see log' % self._numClientGarbage - else: - s = '0 client garbage cycles found' - localAvatar.setChatAbsolute(s, CFSpeech | CFTimeout) - - def d_checkForGarbageLeaks(self, wantReply): - self.sendUpdate('checkForGarbageLeaks', [wantReply]) - - def setNumAIGarbageLeaks(self, numLeaks): - if self._numClientGarbage and numLeaks: - s = '%s client and %s AI garbage cycles found, see logs' % (self._numClientGarbage, numLeaks) - elif numLeaks: - s = '0 client and %s AI garbage cycles found, see log' % numLeaks - else: - s = '0 client and 0 AI garbage cycles found' - localAvatar.setChatAbsolute(s, CFSpeech | CFTimeout) - - def d_setClientGarbageLeak(self, num, description): - self.sendUpdate('setClientGarbageLeak', [num, description]) - - def getMacOsInfo(self, defaultOsInfo): - result = defaultOsInfo - try: - theFile = open('/System/Library/CoreServices/SystemVersion.plist') - except IOError: - pass - else: - key = re.search('ProductUserVisibleVersion\\s*' + '(.*?)', theFile.read()) - theFile.close() - if key is not None: - try: - verString = key.group(1) - parts = verString.split('.') - major = int(parts[0]) - minor = int(parts[1]) - bugfix = int(parts[2]) - result = (sys.platform, - bugfix, - major, - minor) - except Exception, e: - self.notify.debug('getMacOsInfo %s' % str(e)) - - self.notify.debug('getMacOsInfo returning %s' % str(result)) - return result - - def checkAvOnDistrict(self, av, context): - self.sendUpdate('checkAvOnDistrict', [context, av.doId]) + self.cr.flush() \ No newline at end of file diff --git a/otp/ai/TimeManagerAI.py b/otp/ai/TimeManagerAI.py index 07c12f30..dcfbe325 100644 --- a/otp/ai/TimeManagerAI.py +++ b/otp/ai/TimeManagerAI.py @@ -18,22 +18,4 @@ class TimeManagerAI(DistributedObjectAI): def setExceptionInfo(self, exception): avId = self.air.getAvatarIdFromSender() - self.air.writeServerEvent('client-exception', avId, exception) - - def setSignature(self, todo0, todo1, todo2): - pass - - def setFrameRate(self, todo0, todo1, todo2, todo3, todo4, todo5, todo6, todo7, todo8, todo9, todo10, todo11, todo12, todo13, todo14, todo15, todo16, todo17): - pass - - def checkForGarbageLeaks(self, todo0): - pass - - def setNumAIGarbageLeaks(self, todo0): - pass - - def setClientGarbageLeak(self, todo0, todo1): - pass - - def checkAvOnDistrict(self, todo0, todo1): - pass + self.air.writeServerEvent('client-exception', avId, exception) \ No newline at end of file diff --git a/otp/avatar/AvatarHandle.py b/otp/avatar/AvatarHandle.py index 211122c3..98e38152 100644 --- a/otp/avatar/AvatarHandle.py +++ b/otp/avatar/AvatarHandle.py @@ -1,24 +1,15 @@ - - class AvatarHandle: dclassName = 'AvatarHandle' def getName(self): - if __dev__: - pass return '' def isOnline(self): - if __dev__: - pass return False def isUnderstandable(self): - if __dev__: - pass return True def setTalkWhisper(self, fromAV, fromAC, avatarName, chat, mods, flags): newText, scrubbed = localAvatar.scrubTalk(chat, mods) - base.talkAssistant.receiveWhisperTalk(fromAV, avatarName, fromAC, None, self.avatarId, self.getName(), newText, scrubbed) - return + base.talkAssistant.receiveWhisperTalk(fromAV, avatarName, fromAC, None, self.avatarId, self.getName(), newText, scrubbed) \ No newline at end of file diff --git a/otp/avatar/DistributedPlayerAI.py b/otp/avatar/DistributedPlayerAI.py index ae17124d..1ab6d379 100644 --- a/otp/avatar/DistributedPlayerAI.py +++ b/otp/avatar/DistributedPlayerAI.py @@ -21,12 +21,6 @@ class DistributedPlayerAI(DistributedAvatarAI.DistributedAvatarAI, PlayerBase.Pl self.DISLid = 0 self.adminAccess = 0 - if __dev__: - - def generate(self): - self._sentExitServerEvent = False - DistributedAvatarAI.DistributedAvatarAI.generate(self) - def announceGenerate(self): DistributedAvatarAI.DistributedAvatarAI.announceGenerate(self) ClsendTracker.announceGenerate(self) @@ -40,16 +34,10 @@ class DistributedPlayerAI(DistributedAvatarAI.DistributedAvatarAI, PlayerBase.Pl def _sendExitServerEvent(self): self.air.writeServerEvent('avatarExit', self.doId, '') - if __dev__: - self._sentExitServerEvent = True def delete(self): - if __dev__: - del self._sentExitServerEvent self._doPlayerExit() ClsendTracker.destroy(self) - if __dev__: - GarbageReport.checkForGarbageLeaks() DistributedAvatarAI.DistributedAvatarAI.delete(self) def isPlayerControlled(self): diff --git a/otp/chat/ChatInputNormal.py b/otp/chat/ChatInputNormal.py index 5bc9f4f0..1246147d 100644 --- a/otp/chat/ChatInputNormal.py +++ b/otp/chat/ChatInputNormal.py @@ -15,10 +15,7 @@ class ChatInputNormal(DirectObject.DirectObject): self.whisperPos = Vec3(0.0, 0, 0.71) self.whisperAvatarName = None self.whisperAvatarId = None - wantHistory = 0 - if __dev__: - wantHistory = 1 - self.wantHistory = base.config.GetBool('want-chat-history', wantHistory) + self.wantHistory = base.config.GetBool('want-chat-history', 0) self.history = [''] self.historySize = base.config.GetInt('chat-history-size', 10) self.historyIndex = 0 diff --git a/otp/chat/ChatInputTyped.py b/otp/chat/ChatInputTyped.py index 9a8cc899..f17bd94e 100644 --- a/otp/chat/ChatInputTyped.py +++ b/otp/chat/ChatInputTyped.py @@ -13,10 +13,7 @@ class ChatInputTyped(DirectObject.DirectObject): self.whisperName = None self.whisperId = None self.mainEntry = mainEntry - wantHistory = 0 - if __dev__: - wantHistory = 1 - self.wantHistory = base.config.GetBool('want-chat-history', wantHistory) + self.wantHistory = base.config.GetBool('want-chat-history', 0) self.history = [''] self.historySize = base.config.GetInt('chat-history-size', 10) self.historyIndex = 0 diff --git a/otp/chat/ChatInputWhiteListFrame.py b/otp/chat/ChatInputWhiteListFrame.py index d53609f4..a6e93ddc 100644 --- a/otp/chat/ChatInputWhiteListFrame.py +++ b/otp/chat/ChatInputWhiteListFrame.py @@ -45,10 +45,7 @@ class ChatInputWhiteListFrame(FSM.FSM, DirectFrame): self.chatEntry = DirectEntry(**entryOptions) self.whisperId = None self.chatEntry.bind(DGG.OVERFLOW, self.chatOverflow) - wantHistory = 0 - if __dev__: - wantHistory = 1 - self.wantHistory = base.config.GetBool('want-chat-history', wantHistory) + self.wantHistory = base.config.GetBool('want-chat-history', 0) self.history = [''] self.historySize = base.config.GetInt('chat-history-size', 10) self.historyIndex = 0 diff --git a/otp/distributed/ClsendTracker.py b/otp/distributed/ClsendTracker.py index 85cb1ef1..65b221fe 100644 --- a/otp/distributed/ClsendTracker.py +++ b/otp/distributed/ClsendTracker.py @@ -12,7 +12,7 @@ class ClsendTracker: if self.isPlayerControlled(): if simbase.air.getTrackClsends(): if ClsendTracker.NumTrackersLoggingOverflow < ClsendTracker.MaxTrackersLoggingOverflow: - self._logClsendOverflow = random.random() < 1.0 / config.GetFloat('clsend-log-one-av-in-every', choice(__dev__, 4, 50)) + self._logClsendOverflow = random.random() < 1.0 / config.GetFloat('clsend-log-one-av-in-every', choice(0, 4, 50)) if self._logClsendOverflow: ClsendTracker.NumTrackersLoggingOverflow += 1 self._clsendMsgs = [] diff --git a/otp/distributed/DCClassImports.py b/otp/distributed/DCClassImports.py index e70db52d..7080e8b7 100644 --- a/otp/distributed/DCClassImports.py +++ b/otp/distributed/DCClassImports.py @@ -2,7 +2,7 @@ from pandac.PandaModules import * -hashVal = 3070829445L +hashVal = 204403139 from toontown.coghq import DistributedCashbotBossSafe, DistributedCashbotBossCrane, DistributedBattleFactory, DistributedCashbotBossTreasure, DistributedCogHQDoor, DistributedSellbotHQDoor, DistributedFactoryElevatorExt, DistributedMintElevatorExt, DistributedLawOfficeElevatorExt, DistributedLawOfficeElevatorInt, LobbyManager, DistributedMegaCorp, DistributedFactory, DistributedLawOffice, DistributedLawOfficeFloor, DistributedLift, DistributedDoorEntity, DistributedSwitch, DistributedButton, DistributedTrigger, DistributedCrushableEntity, DistributedCrusherEntity, DistributedStomper, DistributedStomperPair, DistributedLaserField, DistributedGolfGreenGame, DistributedSecurityCamera, DistributedMover, DistributedElevatorMarker, DistributedBarrelBase, DistributedGagBarrel, DistributedBeanBarrel, DistributedHealBarrel, DistributedGrid, ActiveCell, DirectionalCell, CrusherCell, DistributedCrate, DistributedSinkingPlatform, BattleBlocker, DistributedMint, DistributedMintRoom, DistributedMintBattle, DistributedStage, DistributedStageRoom, DistributedStageBattle, DistributedLawbotBossGavel, DistributedLawbotCannon, DistributedLawbotChair, DistributedCogKart, DistributedCountryClub, DistributedCountryClubRoom, DistributedMoleField, DistributedCountryClubBattle, DistributedMaze, DistributedFoodBelt, DistributedBanquetTable, DistributedGolfSpot @@ -30,7 +30,6 @@ from toontown.catalog import CatalogManager, AccountDate from toontown.rpc.AwardManager import AwardManager from toontown.parties import DistributedParty, DistributedPartyActivity, DistributedPartyTeamActivity, DistributedPartyCannon, DistributedPartyCannonActivity, DistributedPartyCatchActivity, DistributedPartyWinterCatchActivity, DistributedPartyCogActivity, DistributedPartyWinterCogActivity, DistributedPartyFireworksActivity, DistributedPartyDanceActivityBase, DistributedPartyDanceActivity, DistributedPartyDance20Activity, DistributedPartyValentineDanceActivity, DistributedPartyValentineDance20Activity, DistributedPartyTrampolineActivity, DistributedPartyValentineTrampolineActivity, DistributedPartyVictoryTrampolineActivity, DistributedPartyWinterTrampolineActivity, DistributedPartyTugOfWarActivity, DistributedPartyJukeboxActivityBase, DistributedPartyJukeboxActivity, DistributedPartyJukebox40Activity, DistributedPartyValentineJukeboxActivity, DistributedPartyValentineJukebox40Activity from toontown.friends.TrueFriendsMgr import TrueFriendsMgr -from toontown.coghq.InGameEditorDCImports import * from toontown.friends import TTUFriendsManager from toontown.cogdominium import DistributedCogdoInterior, DistributedCogdoBattleBldg, DistributedCogdoElevatorExt, DistributedCogdoElevatorInt, DistributedCogdoBarrel, DistCogdoGame, DistCogdoLevelGame, DistCogdoBoardroomGame, DistCogdoCraneGame, DistCogdoMazeGame, DistCogdoFlyingGame, DistCogdoCrane, DistCogdoCraneMoneyBag, DistCogdoCraneCog from otp.distributed import Account, DistributedDistrict, DistributedDirectory diff --git a/otp/distributed/OTPClientRepository.py b/otp/distributed/OTPClientRepository.py index 182f7937..3d5cd500 100644 --- a/otp/distributed/OTPClientRepository.py +++ b/otp/distributed/OTPClientRepository.py @@ -637,10 +637,7 @@ class OTPClientRepository(ClientRepositoryBase): def doneWait(task, self = self): self.loginFSM.request('waitForShardList') - if __dev__: - delay = 0.0 - else: - delay = 6.5 + random.random() * 2.0 + delay = 6.5 + random.random() * 2.0 taskMgr.doMethodLater(delay, doneWait, self.noShardsWaitTaskName) @report(types=['args', 'deltaStamp'], dConfigParam='teleport') @@ -832,7 +829,7 @@ class OTPClientRepository(ClientRepositoryBase): @report(types=['args'], dConfigParam='teleport') def detectLeaks(self, okTasks = None, okEvents = None): - if not __dev__ or configIsToday('allow-unclean-exit'): + if not True: return leakedTasks = self.detectLeakedTasks(okTasks) leakedEvents = self.detectLeakedEvents(okEvents) @@ -1085,10 +1082,6 @@ class OTPClientRepository(ClientRepositoryBase): self.gotTimeSync() else: DistributedSmoothNode.globalActivateSmoothing(1, 0) - h = HashVal() - hashPrcVariables(h) - pyc = HashVal() - self.timeManager.d_setSignature(self.userSignature, h.asBin(), pyc.asBin()) if self.timeManager.synchronize('startup'): self.accept('gotTimeSync', self.gotTimeSync) self.waitForDatabaseTimeout(requestName='uberZoneInterest-timeSync') @@ -1353,7 +1346,7 @@ class OTPClientRepository(ClientRepositoryBase): OTPClientRepository.notify.debug('waiting for database timeout %s at %s' % (requestName, globalClock.getFrameTime())) self.cleanupWaitingForDatabase() globalClock.tick() - taskMgr.doMethodLater((OTPGlobals.DatabaseDialogTimeout + extraTimeout) * choice(__dev__, 10, 1), self.__showWaitingForDatabase, 'waitingForDatabase', extraArgs=[requestName]) + taskMgr.doMethodLater((OTPGlobals.DatabaseDialogTimeout + extraTimeout) * choice(0, 10, 1), self.__showWaitingForDatabase, 'waitingForDatabase', extraArgs=[requestName]) def cleanupWaitingForDatabase(self): if self.waitingForDatabase: diff --git a/otp/level/AmbientSound.py b/otp/level/AmbientSound.py index dd717c0d..c78d8acc 100644 --- a/otp/level/AmbientSound.py +++ b/otp/level/AmbientSound.py @@ -30,10 +30,4 @@ class AmbientSound(BasicEntities.NodePathEntity): self.soundIval.pause() del self.soundIval if hasattr(self, 'sound'): - del self.sound - - if __dev__: - - def attribChanged(self, *args): - self.destroySound() - self.initSound() + del self.sound \ No newline at end of file diff --git a/otp/level/BasicEntities.py b/otp/level/BasicEntities.py index 617a0398..4a459159 100644 --- a/otp/level/BasicEntities.py +++ b/otp/level/BasicEntities.py @@ -9,16 +9,13 @@ class NodePathEntityBase: if doReparent: self.callSetters('parentEntId') self.getNodePath().setName('%s-%s' % (self.__class__.__name__, self.entId)) - if __dev__: - self.getNodePath().setTag('entity', '1') def setParentEntId(self, parentEntId): self.parentEntId = parentEntId self.level.requestReparent(self, self.parentEntId) def destroy(self): - if __dev__: - self.getNodePath().clearTag('entity') + pass class NodePathAttribs(NodePathEntityBase): diff --git a/otp/level/CollisionSolidEntity.py b/otp/level/CollisionSolidEntity.py index 48feec09..e11f3505 100644 --- a/otp/level/CollisionSolidEntity.py +++ b/otp/level/CollisionSolidEntity.py @@ -26,20 +26,9 @@ class CollisionSolidEntity(BasicEntities.NodePathEntity): node.addSolid(solid) node.setCollideMask(OTPGlobals.WallBitmask) self.collNodePath = self.attachNewNode(node) - if __dev__: - if self.showSolid: - self.showCS() - else: - self.hideCS() def destroySolid(self): if self.collNodePath is not None: self.collNodePath.removeNode() self.collNodePath = None - return - - if __dev__: - - def attribChanged(self, attrib, value): - print 'attribChanged' - self.initSolid() + return \ No newline at end of file diff --git a/otp/level/DistributedEntityAI.py b/otp/level/DistributedEntityAI.py index 06e30af8..2aca6fce 100644 --- a/otp/level/DistributedEntityAI.py +++ b/otp/level/DistributedEntityAI.py @@ -34,12 +34,4 @@ class DistributedEntityAI(DistributedObjectAI.DistributedObjectAI, Entity.Entity return self.levelDoId def getEntId(self): - return self.entId - - if __dev__: - - def setParentEntId(self, parentEntId): - self.parentEntId = parentEntId - newZoneId = self.getZoneEntity().getZoneId() - if newZoneId != self.zoneId: - self.sendSetZone(newZoneId) + return self.entId \ No newline at end of file diff --git a/otp/level/DistributedLevel.py b/otp/level/DistributedLevel.py index c4395847..24bee6ca 100644 --- a/otp/level/DistributedLevel.py +++ b/otp/level/DistributedLevel.py @@ -17,7 +17,6 @@ import random class DistributedLevel(DistributedObject.DistributedObject, Level.Level): notify = DirectNotifyGlobal.directNotify.newCategory('DistributedLevel') - WantVisibility = config.GetBool('level-visibility', 1) ColorZonesAllDOs = 0 FloorCollPrefix = 'zoneFloor' OuchTaskName = 'ouchTask' @@ -78,47 +77,12 @@ class DistributedLevel(DistributedObject.DistributedObject, Level.Level): pass def initializeLevel(self, levelSpec): - if __dev__: - self.candidateSpec = levelSpec - self.sendUpdate('requestCurrentLevelSpec', [levelSpec.stringHash(), levelSpec.entTypeReg.getHashStr()]) - else: - self.privGotSpec(levelSpec) - - if __dev__: - - def reportModelSpecSyncError(self, msg): - DistributedLevel.notify.error('%s\n\nyour spec does not match the level model\nuse SpecUtil.updateSpec, then restart your AI and client' % msg) - - def setSpecDeny(self, reason): - DistributedLevel.notify.error(reason) - - def setSpecSenderDoId(self, doId): - DistributedLevel.notify.debug('setSpecSenderDoId: %s' % doId) - blobSender = base.cr.doId2do[doId] - - def setSpecBlob(specBlob, blobSender = blobSender, self = self): - blobSender.sendAck() - from LevelSpec import LevelSpec - spec = eval(specBlob) - if spec is None: - spec = self.candidateSpec - del self.candidateSpec - self.privGotSpec(spec) - return - - if blobSender.isComplete(): - setSpecBlob(blobSender.getBlob()) - else: - evtName = self.uniqueName('specDone') - blobSender.setDoneEvent(evtName) - self.acceptOnce(evtName, setSpecBlob) + self.privGotSpec(levelSpec) def privGotSpec(self, levelSpec): Level.Level.initializeLevel(self, self.doId, levelSpec, self.scenarioIndex) modelZoneNums = self.zoneNums specZoneNums = self.zoneNum2zoneId.keys() - if not sameElements(modelZoneNums, specZoneNums): - self.reportModelSpecSyncError('model zone nums (%s) do not match spec zone nums (%s)' % (modelZoneNums, specZoneNums)) self.initVisibility() self.placeLocalToon() @@ -329,13 +293,7 @@ class DistributedLevel(DistributedObject.DistributedObject, Level.Level): self.camEnterZone(zoneNum) self.accept('on-floor', handleCameraRayFloorCollision) - if not DistributedLevel.WantVisibility: - zoneNums = list(self.zoneNums) - zoneNums.remove(LevelConstants.UberZoneEntId) - self.forceSetZoneThisFrame() - self.setVisibility(zoneNums) taskMgr.add(self.visChangeTask, self.uniqueName(DistributedLevel.VisChangeTaskName), priority=49) - return def shutdownVisibility(self): taskMgr.remove(self.uniqueName(DistributedLevel.VisChangeTaskName)) @@ -373,8 +331,6 @@ class DistributedLevel(DistributedObject.DistributedObject, Level.Level): def enterZone(self, zoneNum): DistributedLevel.notify.debug('entering zone %s' % zoneNum) - if not DistributedLevel.WantVisibility: - return if zoneNum == self.curZoneNum: return if zoneNum not in self.zoneNumDict: @@ -468,12 +424,6 @@ class DistributedLevel(DistributedObject.DistributedObject, Level.Level): self.visChangedThisFrame = 0 return Task.cont - if __dev__: - - def setAttribChange(self, entId, attribName, valueStr, username): - value = eval(valueStr) - self.levelSpec.setAttribChange(entId, attribName, value, username) - def spawnTitleText(self): def getDescription(zoneNum, self = self): diff --git a/otp/level/DistributedLevelAI.py b/otp/level/DistributedLevelAI.py index 59b74443..7a8a3680 100644 --- a/otp/level/DistributedLevelAI.py +++ b/otp/level/DistributedLevelAI.py @@ -20,8 +20,6 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level): self.numPlayers = len(self.avIdList) self.presentAvIds = list(self.avIdList) self.notify.debug('expecting avatars: %s' % str(self.avIdList)) - if __dev__: - self.modified = 0 def setLevelSpec(self, levelSpec): self.levelSpec = levelSpec @@ -34,9 +32,6 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level): self.initializeLevel(levelSpec) self.sendUpdate('setZoneIds', [self.zoneIds]) self.sendUpdate('setStartTimestamp', [self.startTimestamp]) - if __dev__: - pass - return def getLevelZoneId(self): return self.zoneId @@ -52,8 +47,6 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level): def delete(self, deAllocZone = True): self.notify.debug('delete') - if __dev__: - self.removeAutosaveTask() self.destroyLevel() self.ignoreAll() if deAllocZone: @@ -66,8 +59,6 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level): lol = zip([1] * levelSpec.getNumScenarios(), range(levelSpec.getNumScenarios())) scenarioIndex = weightedChoice(lol) Level.Level.initializeLevel(self, self.doId, levelSpec, scenarioIndex) - if __dev__: - self.accept(self.editMgrEntity.getSpecSaveEvent(), self.saveSpec) for avId in self.avIdList: self.acceptOnce(self.air.getAvatarExitEvent(avId), Functor(self.handleAvatarDisconnect, avId)) @@ -104,75 +95,4 @@ class DistributedLevelAI(DistributedObjectAI.DistributedObjectAI, Level.Level): av.takeDamage(penalty) if av.getHp() <= 0: av.inventory.zeroInv() - av.d_setInventory(av.inventory.makeNetString()) - - def requestCurrentLevelSpec(self, specHash, entTypeRegHash): - senderId = self.air.getAvatarIdFromSender() - self.notify.info('av %s: specHash %s, entTypeRegHash %s' % (senderId, specHash, entTypeRegHash)) - if not __dev__: - self.notify.info('client is in dev mode and we are not') - self.sendUpdateToAvatarId(senderId, 'setSpecDeny', ['AI server is not running in dev mode. Set want-dev to false on your client or true on the AI.']) - return - srvHash = self.levelSpec.entTypeReg.getHashStr() - self.notify.info('srv entTypeRegHash %s' % srvHash) - if srvHash != entTypeRegHash: - self.sendUpdateToAvatarId(senderId, 'setSpecDeny', ['EntityTypeRegistry hashes do not match! (server:%s, client:%s' % (srvHash, entTypeRegHash)]) - return - if hash(self.levelSpec) != specHash: - self.notify.info('spec hashes do not match, sending our spec') - spec = self.levelSpec - useDisk = simbase.config.GetBool('spec-by-disk', 1) - else: - self.notify.info('spec hashes match, sending null spec') - spec = None - useDisk = 0 - specStr = repr(spec) - from direct.directutil import DistributedLargeBlobSenderAI - largeBlob = DistributedLargeBlobSenderAI.DistributedLargeBlobSenderAI(self.air, self.zoneId, senderId, specStr, useDisk=useDisk) - self.sendUpdateToAvatarId(senderId, 'setSpecSenderDoId', [largeBlob.doId]) - return - - if __dev__: - - def setAttribChange(self, entId, attribName, value, username = 'SYSTEM'): - DistributedLevelAI.notify.info('setAttribChange(%s): %s, %s = %s' % (username, - entId, - attribName, - repr(value))) - self.sendUpdate('setAttribChange', [entId, - attribName, - repr(value), - username]) - self.levelSpec.setAttribChange(entId, attribName, value, username) - self.modified = 1 - self.scheduleAutosave() - - AutosavePeriod = simbase.config.GetFloat('level-autosave-period-minutes', 5) - - def scheduleAutosave(self): - if hasattr(self, 'autosaveTask'): - return - self.autosaveTaskName = self.uniqueName('autosaveSpec') - self.autosaveTask = taskMgr.doMethodLater(DistributedLevelAI.AutosavePeriod * 60, self.autosaveSpec, self.autosaveTaskName) - - def removeAutosaveTask(self): - if hasattr(self, 'autosaveTask'): - taskMgr.remove(self.autosaveTaskName) - del self.autosaveTask - - def autosaveSpec(self, task = None): - self.removeAutosaveTask() - if self.modified: - DistributedLevelAI.notify.info('autosaving spec') - filename = self.levelSpec.getFilename() - filename = '%s.autosave' % filename - self.levelSpec.saveToDisk(filename, makeBackup=0) - - def saveSpec(self, task = None): - DistributedLevelAI.notify.info('saving spec') - self.removeAutosaveTask() - if not self.modified: - DistributedLevelAI.notify.info('no changes to save') - return - self.levelSpec.saveToDisk() - self.modified = 0 + av.d_setInventory(av.inventory.makeNetString()) \ No newline at end of file diff --git a/otp/level/EditMgr.py b/otp/level/EditMgr.py deleted file mode 100644 index 3a1927b4..00000000 --- a/otp/level/EditMgr.py +++ /dev/null @@ -1,4 +0,0 @@ -import EditMgrBase - -class EditMgr(EditMgrBase.EditMgrBase): - pass diff --git a/otp/level/EditMgrAI.py b/otp/level/EditMgrAI.py deleted file mode 100644 index dcb8b5ea..00000000 --- a/otp/level/EditMgrAI.py +++ /dev/null @@ -1,41 +0,0 @@ -import EditMgrBase -if __dev__: - from direct.showbase.PythonUtil import list2dict - import EditorGlobals - -class EditMgrAI(EditMgrBase.EditMgrBase): - if __dev__: - - def setRequestNewEntity(self, data): - spec = self.level.levelSpec - entIds = spec.getAllEntIds() - entIdDict = list2dict(entIds) - allocRange = EditorGlobals.getEntIdAllocRange() - if not hasattr(self, 'lastAllocatedEntId'): - self.lastAllocatedEntId = allocRange[0] - idChosen = 0 - while not idChosen: - for id in xrange(self.lastAllocatedEntId, allocRange[1]): - print id - if id not in entIdDict: - idChosen = 1 - break - else: - if self.lastAllocatedEntId != allocRange[0]: - self.lastAllocatedEntId = allocRange[0] - else: - self.notify.error('out of entIds') - - data.update({'entId': id}) - self.lastAllocatedEntId = id - self.level.setAttribChange(self.entId, 'insertEntity', data) - self.level.levelSpec.doSetAttrib(self.entId, 'requestNewEntity', None) - return - - def getSpecSaveEvent(self): - return 'requestSave-%s' % self.level.levelId - - def setRequestSave(self, data): - messenger.send(self.getSpecSaveEvent()) - self.level.levelSpec.doSetAttrib(self.entId, 'requestSave', None) - return diff --git a/otp/level/EditMgrBase.py b/otp/level/EditMgrBase.py deleted file mode 100644 index fe4c7b1e..00000000 --- a/otp/level/EditMgrBase.py +++ /dev/null @@ -1,25 +0,0 @@ -import Entity -from direct.directnotify import DirectNotifyGlobal - -class EditMgrBase(Entity.Entity): - notify = DirectNotifyGlobal.directNotify.newCategory('EditMgr') - - def __init__(self, level, entId): - Entity.Entity.__init__(self, level, entId) - - def destroy(self): - Entity.Entity.destroy(self) - self.ignoreAll() - - if __dev__: - - def setInsertEntity(self, data): - self.level.setEntityCreatorUsername(data['entId'], data['username']) - self.level.levelSpec.insertEntity(data['entId'], data['entType'], data['parentEntId']) - self.level.levelSpec.doSetAttrib(self.entId, 'insertEntity', None) - return - - def setRemoveEntity(self, data): - self.level.levelSpec.removeEntity(data['entId']) - self.level.levelSpec.doSetAttrib(self.entId, 'removeEntity', None) - return diff --git a/otp/level/EditorGlobals.py b/otp/level/EditorGlobals.py deleted file mode 100644 index 7edb648c..00000000 --- a/otp/level/EditorGlobals.py +++ /dev/null @@ -1,40 +0,0 @@ -from direct.showbase.PythonUtil import uniqueElements -EditTargetPostName = 'inGameEditTarget' -EntIdRange = 10000 -username2entIdBase = {'darren': 1 * EntIdRange, - 'samir': 2 * EntIdRange, - 'skyler': 3 * EntIdRange, - 'joe': 4 * EntIdRange, - 'DrEvil': 5 * EntIdRange, - 'asad': 6 * EntIdRange, - 'drose': 7 * EntIdRange, - 'pappy': 8 * EntIdRange, - 'patricia': 9 * EntIdRange, - 'jloehrle': 10 * EntIdRange, - 'rurbino': 11 * EntIdRange} -usernameConfigVar = 'level-edit-username' -undefinedUsername = 'UNDEFINED_USERNAME' -editUsername = config.GetString(usernameConfigVar, undefinedUsername) - -def checkNotReadyToEdit(): - if editUsername == undefinedUsername: - return "you must config '%s'; see %s.py" % (usernameConfigVar, __name__) - if editUsername not in username2entIdBase: - return "unknown editor username '%s'; see %s.py" % (editUsername, __name__) - return None - - -def assertReadyToEdit(): - msg = checkNotReadyToEdit() - if msg is not None: - pass - return - - -def getEditUsername(): - return editUsername - - -def getEntIdAllocRange(): - baseId = username2entIdBase[editUsername] - return [baseId, baseId + EntIdRange] diff --git a/otp/level/Entity.py b/otp/level/Entity.py index 15e2570f..ac47b34d 100644 --- a/otp/level/Entity.py +++ b/otp/level/Entity.py @@ -84,18 +84,4 @@ class Entity(DirectObject): return def setAttribInit(self, attrib, value): - self.__dict__[attrib] = value - - if __dev__: - - def handleAttribChange(self, attrib, value): - setter = self.privGetSetter(attrib) - if setter is not None: - setter(value) - else: - self.__dict__[attrib] = value - self.attribChanged(attrib, value) - return - - def attribChanged(self, attrib, value): - pass + self.__dict__[attrib] = value \ No newline at end of file diff --git a/otp/level/EntityCreator.py b/otp/level/EntityCreator.py index 8d73961b..6d0a384a 100644 --- a/otp/level/EntityCreator.py +++ b/otp/level/EntityCreator.py @@ -2,7 +2,6 @@ import CutScene import EntityCreatorBase import BasicEntities from direct.directnotify import DirectNotifyGlobal -import EditMgr import EntrancePoint import LevelMgr import LogicGate @@ -32,7 +31,6 @@ class EntityCreator(EntityCreatorBase.EntityCreatorBase): 'ambientSound': AmbientSound.AmbientSound, 'collisionSolid': CollisionSolidEntity.CollisionSolidEntity, 'cutScene': CutScene.CutScene, - 'editMgr': EditMgr.EditMgr, 'entityGroup': nothing, 'entrancePoint': EntrancePoint.EntrancePoint, 'levelMgr': LevelMgr.LevelMgr, diff --git a/otp/level/EntityCreatorAI.py b/otp/level/EntityCreatorAI.py index d14a2d31..57ae4dcc 100644 --- a/otp/level/EntityCreatorAI.py +++ b/otp/level/EntityCreatorAI.py @@ -1,6 +1,5 @@ import EntityCreatorBase import LogicGate -import EditMgrAI import LevelMgrAI import ZoneEntityAI from direct.showbase.PythonUtil import Functor @@ -29,7 +28,6 @@ class EntityCreatorAI(EntityCreatorBase.EntityCreatorBase): 'ambientSound': nothing, 'collisionSolid': nothing, 'cutScene': nothing, - 'editMgr': Functor(cLE, EditMgrAI.EditMgrAI), 'entityGroup': nothing, 'entrancePoint': nothing, 'levelMgr': Functor(cLE, LevelMgrAI.LevelMgrAI), diff --git a/otp/level/EntityTypeRegistry.py b/otp/level/EntityTypeRegistry.py deleted file mode 100644 index a86b410a..00000000 --- a/otp/level/EntityTypeRegistry.py +++ /dev/null @@ -1,99 +0,0 @@ -from pandac.PandaModules import * -from direct.directnotify import DirectNotifyGlobal -import types -import AttribDesc -import EntityTypeDesc -from direct.showbase.PythonUtil import mostDerivedLast -import os -import string - -class EntityTypeRegistry: - notify = DirectNotifyGlobal.directNotify.newCategory('EntityTypeRegistry') - - def __init__(self, entityTypeModule): - self.entTypeModule = entityTypeModule - hv = HashVal() - import EntityTypes - reload(EntityTypes) - reload(self.entTypeModule) - - def getPyExtVersion(filename): - base, ext = os.path.splitext(filename) - if ext == '.pyc' or ext == '.pyo': - filename = base + '.py' - return filename - - fileLines = file(getPyExtVersion(EntityTypes.__file__)).readlines() - hv.hashString(string.join(fileLines, '')) - s = str(hv.asHex()) - s += '.' - fileLines = file(getPyExtVersion(self.entTypeModule.__file__)).readlines() - hv.hashString(string.join(fileLines, '')) - s += str(hv.asHex()) - self.hashStr = s - getPyExtVersion = None - classes = [] - for key, value in entityTypeModule.__dict__.items(): - if type(value) is types.ClassType: - if issubclass(value, EntityTypeDesc.EntityTypeDesc): - classes.append(value) - - self.entTypeName2typeDesc = {} - mostDerivedLast(classes) - for c in classes: - if 'type' in c.__dict__: - if c.type in self.entTypeName2typeDesc: - EntityTypeRegistry.notify.debug("replacing %s with %s for entity type '%s'" % (self.entTypeName2typeDesc[c.type].__class__, c, c.type)) - self.entTypeName2typeDesc[c.type] = c() - - self.output2typeNames = {} - for typename, typeDesc in self.entTypeName2typeDesc.items(): - if typeDesc.isConcrete(): - if hasattr(typeDesc, 'output'): - outputType = typeDesc.output - self.output2typeNames.setdefault(outputType, []) - self.output2typeNames[outputType].append(typename) - - self.permanentTypeNames = [] - for typename, typeDesc in self.entTypeName2typeDesc.items(): - if typeDesc.isPermanent(): - self.permanentTypeNames.append(typename) - - self.typeName2derivedTypeNames = {} - for typename, typeDesc in self.entTypeName2typeDesc.items(): - typenames = [] - for tn, td in self.entTypeName2typeDesc.items(): - if td.isConcrete(): - if issubclass(td.__class__, typeDesc.__class__): - typenames.append(tn) - - self.typeName2derivedTypeNames[typename] = typenames - - return - - def getAllTypeNames(self): - return self.entTypeName2typeDesc.keys() - - def getTypeDesc(self, entTypeName): - return self.entTypeName2typeDesc[entTypeName] - - def getTypeNamesFromOutputType(self, outputType): - return self.output2typeNames.get(outputType, []) - - def getDerivedTypeNames(self, entTypeName): - return self.typeName2derivedTypeNames[entTypeName] - - def isDerivedAndBase(self, entType, baseEntType): - return entType in self.getDerivedTypeNames(baseEntType) - - def getPermanentTypeNames(self): - return self.permanentTypeNames - - def getHashStr(self): - return self.hashStr - - def __hash__(self): - return hash(repr(self)) - - def __repr__(self): - return str(self.entTypeName2typeDesc) diff --git a/otp/level/EntityTypes.py b/otp/level/EntityTypes.py index fb7b22f2..43541ffe 100644 --- a/otp/level/EntityTypes.py +++ b/otp/level/EntityTypes.py @@ -16,18 +16,6 @@ class LevelMgr(Entity): attribs = (('name', 'LevelMgr', 'const'), ('parentEntId', 0, 'const'), ('modelFilename', '', 'const')) -class EditMgr(Entity): - type = 'editMgr' - permanent = 1 - blockAttribs = ('comment',) - attribs = (('name', 'LevelMgr', 'const'), - ('parentEntId', 0, 'const'), - ('requestSave', None, 'const'), - ('requestNewEntity', None, 'const'), - ('insertEntity', None, 'const'), - ('removeEntity', None, 'const')) - - class AttribModifier(Entity): type = 'attribModifier' attribs = (('recursive', 0, 'bool'), diff --git a/otp/level/EntrancePoint.py b/otp/level/EntrancePoint.py index 99f7520b..fedfab86 100644 --- a/otp/level/EntrancePoint.py +++ b/otp/level/EntrancePoint.py @@ -30,11 +30,4 @@ class EntrancePoint(BasicEntities.NodePathEntity): def destroyEntrancePoint(self): if self.entranceId >= 0: if self.entranceId in self.level.entranceId2entity: - del self.level.entranceId2entity[self.entranceId] - - if __dev__: - - def attribChanged(self, *args): - BasicEntities.NodePathEntity.attribChanged(self, *args) - self.destroyEntrancePoint() - self.initEntrancePoint() + del self.level.entranceId2entity[self.entranceId] \ No newline at end of file diff --git a/otp/level/Level.py b/otp/level/Level.py index 62220d5f..c2859dae 100644 --- a/otp/level/Level.py +++ b/otp/level/Level.py @@ -17,8 +17,6 @@ class Level: self.levelSpec = levelSpec self.scenarioIndex = scenarioIndex self.levelSpec.setScenario(self.scenarioIndex) - if __dev__: - self.levelSpec.setLevel(self) self.entranceId2entity = {} self.entId2createCallbacks = {} self.createdEntIds = [] @@ -218,44 +216,4 @@ class Level: self.createdEntIds.remove(entId) def handleVisChange(self): - pass - - if __dev__: - - def getAttribChangeEventName(self): - return 'attribChange-%s' % self.levelId - - def getInsertEntityEventName(self): - return 'insertEntity-%s' % self.levelId - - def getRemoveEntityEventName(self): - return 'removeEntity-%s' % self.levelId - - def handleAttribChange(self, entId, attrib, value, username = None): - entity = self.getEntity(entId) - if entity is not None: - entity.handleAttribChange(attrib, value) - messenger.send(self.getAttribChangeEventName(), [entId, - attrib, - value, - username]) - return - - def setEntityCreatorUsername(self, entId, editUsername): - pass - - def handleEntityInsert(self, entId): - self.entType2ids[self.getEntityType(entId)].append(entId) - self.createEntity(entId) - messenger.send(self.getInsertEntityEventName(), [entId]) - - def handleEntityRemove(self, entId): - messenger.send(self.getRemoveEntityEventName(), [entId]) - if entId in self.createdEntIds: - entity = self.getEntity(entId) - entity.destroy() - elif entId in self.nothingEntIds: - del self.nothingEntIds[entId] - elif entId in self.nonlocalEntIds: - del self.nonlocalEntIds[entId] - self.entType2ids[self.getEntityType(entId)].remove(entId) + pass \ No newline at end of file diff --git a/otp/level/LevelConstants.py b/otp/level/LevelConstants.py index d7e22830..b890c882 100644 --- a/otp/level/LevelConstants.py +++ b/otp/level/LevelConstants.py @@ -1,5 +1,4 @@ MinZoneNum = 0 MaxZoneNum = 999 UberZoneEntId = 0 -LevelMgrEntId = 1000 -EditMgrEntId = 1001 +LevelMgrEntId = 1000 \ No newline at end of file diff --git a/otp/level/LevelSpec.py b/otp/level/LevelSpec.py index 08e6b1fc..5d9c2b25 100644 --- a/otp/level/LevelSpec.py +++ b/otp/level/LevelSpec.py @@ -1,53 +1,24 @@ from pandac import PandaModules as PM from direct.directnotify import DirectNotifyGlobal from direct.showbase.PythonUtil import list2dict, uniqueElements -import string -import LevelConstants -import types -if __dev__: - import os +import LevelConstants, types class LevelSpec: notify = DirectNotifyGlobal.directNotify.newCategory('LevelSpec') - SystemEntIds = (LevelConstants.UberZoneEntId, LevelConstants.LevelMgrEntId, LevelConstants.EditMgrEntId) + SystemEntIds = (LevelConstants.UberZoneEntId, LevelConstants.LevelMgrEntId) def __init__(self, spec = None, scenario = 0): newSpec = 0 if type(spec) is types.ModuleType: - if __dev__: - reload(spec) self.specDict = spec.levelSpec - if __dev__: - self.setFilename(spec.__file__) elif type(spec) is types.DictType: self.specDict = spec - elif spec is None: - if __dev__: - newSpec = 1 - self.specDict = {'globalEntities': {}, - 'scenarios': [{}]} self.entId2specDict = {} self.entId2specDict.update(list2dict(self.getGlobalEntIds(), value=self.privGetGlobalEntityDict())) for i in xrange(self.getNumScenarios()): self.entId2specDict.update(list2dict(self.getScenarioEntIds(i), value=self.privGetScenarioEntityDict(i))) self.setScenario(scenario) - if __dev__: - if newSpec: - import EntityTypes - import EntityTypeRegistry - etr = EntityTypeRegistry.EntityTypeRegistry(EntityTypes) - self.setEntityTypeReg(etr) - entId = LevelConstants.UberZoneEntId - self.insertEntity(entId, 'zone') - self.doSetAttrib(entId, 'name', 'UberZone') - entId = LevelConstants.LevelMgrEntId - self.insertEntity(entId, 'levelMgr') - self.doSetAttrib(entId, 'name', 'LevelMgr') - entId = LevelConstants.EditMgrEntId - self.insertEntity(entId, 'editMgr') - self.doSetAttrib(entId, 'name', 'EditMgr') - return def destroy(self): del self.specDict @@ -55,8 +26,6 @@ class LevelSpec: del self.scenario if hasattr(self, 'level'): del self.level - if hasattr(self, 'entTypeReg'): - del self.entTypeReg def getNumScenarios(self): return len(self.specDict['scenarios']) @@ -89,13 +58,6 @@ class LevelSpec: specDict = self.entId2specDict[entId] return specDict[entId] - def getCopyOfSpec(self, spec): - return __import__(self.getSpecImportsModuleName(), fromlist=['*']).__dict__ - - def getEntitySpecCopy(self, entId): - specDict = self.entId2specDict[entId] - return self.getCopyOfSpec(specDict[entId]) - def getEntityType(self, entId): return self.getEntitySpec(entId)['type'] @@ -130,277 +92,4 @@ class LevelSpec: zoneIds.sort() for zoneNum in zoneIds: spec = self.getEntitySpec(zoneNum) - print 'zone %s: %s' % (zoneNum, spec['name']) - - if __dev__: - - def setLevel(self, level): - self.level = level - - def hasLevel(self): - return hasattr(self, 'level') - - def setEntityTypeReg(self, entTypeReg): - self.entTypeReg = entTypeReg - for entId in self.getAllEntIds(): - spec = self.getEntitySpec(entId) - type = self.getEntityType(entId) - typeDesc = self.entTypeReg.getTypeDesc(type) - attribDescDict = typeDesc.getAttribDescDict() - for attribName, desc in attribDescDict.iteritems(): - if attribName not in spec: - spec[attribName] = desc.getDefaultValue() - - self.checkSpecIntegrity() - - def hasEntityTypeReg(self): - return hasattr(self, 'entTypeReg') - - def setFilename(self, filename): - self.filename = filename - - def doSetAttrib(self, entId, attrib, value): - specDict = self.entId2specDict[entId] - specDict[entId][attrib] = value - - def setAttribChange(self, entId, attrib, value, username): - LevelSpec.notify.info('setAttribChange(%s): %s, %s = %s' % (username, - entId, - attrib, - repr(value))) - self.doSetAttrib(entId, attrib, value) - if self.hasLevel(): - self.level.handleAttribChange(entId, attrib, value, username) - - def insertEntity(self, entId, entType, parentEntId = 'unspecified'): - LevelSpec.notify.info('inserting entity %s (%s)' % (entId, entType)) - globalEnts = self.privGetGlobalEntityDict() - self.entId2specDict[entId] = globalEnts - globalEnts[entId] = {} - spec = globalEnts[entId] - attribDescs = self.entTypeReg.getTypeDesc(entType).getAttribDescDict() - for name, desc in attribDescs.items(): - spec[name] = desc.getDefaultValue() - - spec['type'] = entType - if parentEntId != 'unspecified': - spec['parentEntId'] = parentEntId - if self.hasLevel(): - self.level.handleEntityInsert(entId) - else: - LevelSpec.notify.warning('no level to be notified of insertion') - - def removeEntity(self, entId): - LevelSpec.notify.info('removing entity %s' % entId) - if self.hasLevel(): - self.level.handleEntityRemove(entId) - else: - LevelSpec.notify.warning('no level to be notified of removal') - dict = self.entId2specDict[entId] - del dict[entId] - del self.entId2specDict[entId] - - def removeZoneReferences(self, removedZoneNums): - type2ids = self.getEntType2ids(self.getAllEntIdsFromAllScenarios()) - for type in type2ids: - typeDesc = self.entTypeReg.getTypeDesc(type) - visZoneListAttribs = typeDesc.getAttribsOfType('visZoneList') - if len(visZoneListAttribs) > 0: - for entId in type2ids[type]: - spec = self.getEntitySpec(entId) - for attribName in visZoneListAttribs: - for zoneNum in removedZoneNums: - while zoneNum in spec[attribName]: - spec[attribName].remove(zoneNum) - - def getSpecImportsModuleName(self): - return 'toontown.coghq.SpecImports' - - def getFilename(self): - return self.filename - - def privGetBackupFilename(self, filename): - return '%s.bak' % filename - - def saveToDisk(self, filename = None, makeBackup = 1): - if filename is None: - filename = self.filename - if filename.endswith('.pyc'): - filename = filename.replace('.pyc', '.py') - if makeBackup and self.privFileExists(filename): - try: - backupFilename = self.privGetBackupFilename(filename) - self.privRemoveFile(backupFilename) - os.rename(filename, backupFilename) - except OSError, e: - LevelSpec.notify.warning('error during backup: %s' % str(e)) - - LevelSpec.notify.info("writing to '%s'" % filename) - self.privRemoveFile(filename) - self.privSaveToDisk(filename) - return - - def privSaveToDisk(self, filename): - retval = 1 - f = file(filename, 'wb') - try: - f.write(self.getPrettyString()) - except IOError: - retval = 0 - - f.close() - return retval - - def privFileExists(self, filename): - try: - os.stat(filename) - return 1 - except OSError: - return 0 - - def privRemoveFile(self, filename): - try: - os.remove(filename) - return 1 - except OSError: - return 0 - - def getPrettyString(self): - import pprint - tabWidth = 4 - tab = ' ' * tabWidth - globalEntitiesName = 'GlobalEntities' - scenarioEntitiesName = 'Scenario%s' - topLevelName = 'levelSpec' - - def getPrettyEntityDictStr(name, dict, tabs = 0): - - def t(n): - return (tabs + n) * tab - - def sortList(lst, firstElements = []): - elements = list(lst) - result = [] - for el in firstElements: - if el in elements: - result.append(el) - elements.remove(el) - - elements.sort() - result.extend(elements) - return result - - firstTypes = ('levelMgr', 'editMgr', 'zone') - firstAttribs = ('type', 'name', 'comment', 'parentEntId', 'pos', 'x', 'y', 'z', 'hpr', 'h', 'p', 'r', 'scale', 'sx', 'sy', 'sz', 'color', 'model') - str = t(0) + '%s = {\n' % name - entIds = dict.keys() - entType2ids = self.getEntType2ids(entIds) - types = sortList(entType2ids.keys(), firstTypes) - for type in types: - str += t(1) + '# %s\n' % type.upper() - entIds = entType2ids[type] - entIds.sort() - for entId in entIds: - str += t(1) + '%s: {\n' % entId - spec = dict[entId] - attribs = sortList(spec.keys(), firstAttribs) - for attrib in attribs: - str += t(2) + "'%s': %s,\n" % (attrib, repr(spec[attrib])) - - str += t(2) + '}, # end entity %s\n' % entId - - str += t(1) + '}\n' - return str - - def getPrettyTopLevelDictStr(tabs = 0): - - def t(n): - return (tabs + n) * tab - - str = t(0) + '%s = {\n' % topLevelName - str += t(1) + "'globalEntities': %s,\n" % globalEntitiesName - str += t(1) + "'scenarios': [\n" - for i in xrange(self.getNumScenarios()): - str += t(2) + '%s,\n' % (scenarioEntitiesName % i) - - str += t(2) + '],\n' - str += t(1) + '}\n' - return str - - str = 'from %s import *\n' % self.getSpecImportsModuleName() - str += '\n' - str += getPrettyEntityDictStr('GlobalEntities', self.privGetGlobalEntityDict()) - str += '\n' - numScenarios = self.getNumScenarios() - for i in xrange(numScenarios): - str += getPrettyEntityDictStr('Scenario%s' % i, self.privGetScenarioEntityDict(i)) - str += '\n' - - str += getPrettyTopLevelDictStr() - self.testPrettyString(prettyString=str) - return str - - def _recurKeyTest(self, dict1, dict2): - s = '' - errorCount = 0 - if set(dict1.keys()) != set(dict2.keys()): - return 0 - for key in dict1: - if type(dict1[key]) == type({}) and type(dict2[key]) == type({}): - if not self._recurKeyTest(dict1[key], dict2[key]): - return 0 - else: - strd1 = repr(dict1[key]) - strd2 = repr(dict2[key]) - if strd1 != strd2: - s += '\nBAD VALUE(%s): %s != %s\n' % (key, strd1, strd2) - errorCount += 1 - - print s - if errorCount == 0: - return 1 - else: - return 0 - - def testPrettyString(self, prettyString=None): - pass - - def checkSpecIntegrity(self): - entIds = self.getGlobalEntIds() - entIds = list2dict(entIds) - for i in xrange(self.getNumScenarios()): - for id in self.getScenarioEntIds(i): - entIds[id] = None - - if self.entTypeReg is not None: - allEntIds = entIds - for entId in allEntIds: - spec = self.getEntitySpec(entId) - entType = spec['type'] - typeDesc = self.entTypeReg.getTypeDesc(entType) - attribNames = typeDesc.getAttribNames() - attribDescs = typeDesc.getAttribDescDict() - for attrib in spec.keys(): - if attrib not in attribNames: - LevelSpec.notify.warning("entId %s (%s): unknown attrib '%s', omitting" % (entId, spec['type'], attrib)) - del spec[attrib] - - for attribName in attribNames: - if attribName not in spec: - LevelSpec.notify.warning("entId %s (%s): missing attrib '%s'" % (entId, spec['type'], attribName)) - - return - - def stringHash(self): - h = PM.HashVal() - h.hashString(repr(self)) - return h.asHex() - - def __hash__(self): - return hash(repr(self)) - - def __str__(self): - return 'LevelSpec' - - def __repr__(self): - return 'LevelSpec(%s, scenario=%s)' % (repeatableRepr(self.specDict), repeatableRepr(self.scenario)) + print 'zone %s: %s' % (zoneNum, spec['name']) \ No newline at end of file diff --git a/otp/level/LocatorEntity.py b/otp/level/LocatorEntity.py index c0b593e8..6363e074 100644 --- a/otp/level/LocatorEntity.py +++ b/otp/level/LocatorEntity.py @@ -25,9 +25,4 @@ class LocatorEntity(Entity.Entity, NodePath): LocatorEntity.notify.warning("could not find '%s'" % self.searchPath) self.reparentTo(hidden) else: - self.reparentTo(parent) - - if __dev__: - - def attribChanged(self, attrib, value): - self.doReparent() + self.reparentTo(parent) \ No newline at end of file diff --git a/otp/level/ModelEntity.py b/otp/level/ModelEntity.py index 34757ae1..02db755a 100644 --- a/otp/level/ModelEntity.py +++ b/otp/level/ModelEntity.py @@ -35,11 +35,7 @@ class ModelEntity(BasicEntities.NodePathEntity): if self.model: self.model.reparentTo(self) if self.collisionsOnly: - if __dev__: - self.model.setTransparency(1) - self.model.setColorScale(1, 1, 1, 0.1) - else: - self.model.hide() + self.model.hide() else: self.model.show() if self.modelPath in ('phase_9/models/cogHQ/woodCrateB.bam', 'phase_9/models/cogHQ/metal_crateB.bam', 'phase_10/models/cashbotHQ/CBMetalCrate.bam', 'phase_10/models/cogHQ/CBMetalCrate2.bam', 'phase_10/models/cashbotHQ/CBWoodCrate.bam', 'phase_11/models/lawbotHQ/LB_metal_crate.bam', 'phase_11/models/lawbotHQ/LB_metal_crate2.bam'): diff --git a/otp/level/PathEntity.py b/otp/level/PathEntity.py index d29f1421..335d4edc 100644 --- a/otp/level/PathEntity.py +++ b/otp/level/PathEntity.py @@ -20,12 +20,9 @@ class PathEntity(BasicEntities.NodePathEntity): pathTableId = GoonPathData.taskZoneId2pathId[self.level.getTaskZoneId()] if self.pathIndex in GoonPathData.Paths[pathTableId]: self.path = GoonPathData.Paths[pathTableId][self.pathIndex] - if __dev__: - messenger.send(self.getChangeEvent()) else: PathEntity.notify.warning('invalid pathIndex: %s' % pathIndex) self.path = None - return def makePathTrack(self, node, velocity, name, turnTime = 1, lookAroundNode = None): track = Sequence(name=name) @@ -45,13 +42,4 @@ class PathEntity(BasicEntities.NodePathEntity): duration = distance / velocity track.append(LerpPosInterval(node, duration=duration, pos=endPoint, startPos=startPoint)) - return track - - if __dev__: - - def getChangeEvent(self): - return self.getUniqueName('pathChanged') - - def setPathScale(self, pathScale): - self.pathScale = pathScale - self.setPathIndex(self.pathIndex) + return track \ No newline at end of file diff --git a/otp/level/PropSpinner.py b/otp/level/PropSpinner.py index 02ad5d27..545e740b 100644 --- a/otp/level/PropSpinner.py +++ b/otp/level/PropSpinner.py @@ -49,10 +49,4 @@ class PropSpinner(Entity): def destroyProps(self): if hasattr(self, 'spinTracks'): self.spinTracks.pause() - del self.spinTracks - - if __dev__: - - def attribChanged(self, *args): - self.destroyProps() - self.initProps() + del self.spinTracks \ No newline at end of file diff --git a/otp/level/VisibilityExtender.py b/otp/level/VisibilityExtender.py index d5e72ea9..2ad13657 100644 --- a/otp/level/VisibilityExtender.py +++ b/otp/level/VisibilityExtender.py @@ -13,14 +13,12 @@ class VisibilityExtender(Entity.Entity): if self.event is not None: self.eventName = self.getOutputEventName(self.event) self.accept(self.eventName, self.handleEvent) - return def destroyVisExt(self): if self.eventName is not None: self.ignore(self.eventName) if self.extended: self.retract() - return def handleEvent(self, doExtend): if doExtend: @@ -43,21 +41,4 @@ class VisibilityExtender(Entity.Entity): def destroy(self): self.destroyVisExt() - Entity.Entity.destroy(self) - - if __dev__: - - def setNewZones(self, newZones): - extended = self.extended - self.destroyVisExt() - self.newZones = newZones - self.initVisExt() - if extended: - self.extend() - - def attribChanged(self, *args): - extended = self.extended - self.destroyVisExt() - self.initVisExt() - if extended: - self.extend() + Entity.Entity.destroy(self) \ No newline at end of file diff --git a/otp/level/ZoneEntity.py b/otp/level/ZoneEntity.py index 6b1f8cd9..dd4b697f 100644 --- a/otp/level/ZoneEntity.py +++ b/otp/level/ZoneEntity.py @@ -7,14 +7,10 @@ class ZoneEntity(ZoneEntityBase.ZoneEntityBase, BasicEntities.NodePathAttribs): ZoneEntityBase.ZoneEntityBase.__init__(self, level, entId) self.nodePath = self.level.getZoneNode(self.entId) if self.nodePath is None: - if __dev__: - self.level.reportModelSpecSyncError('unknown zoneNum %s; zone was removed from model?' % self.entId) - else: - self.notify.error('zone %s not found in level model' % self.entId) + self.notify.error('zone %s not found in level model' % self.entId) BasicEntities.NodePathAttribs.initNodePathAttribs(self, doReparent=0) self.visibleZoneNums = {} self.incrementRefCounts(self.visibility) - return def destroy(self): BasicEntities.NodePathAttribs.destroy(self) @@ -35,12 +31,4 @@ class ZoneEntity(ZoneEntityBase.ZoneEntityBase, BasicEntities.NodePathAttribs): for zoneNum in zoneNumList: self.visibleZoneNums[zoneNum] -= 1 if self.visibleZoneNums[zoneNum] == 0: - del self.visibleZoneNums[zoneNum] - - if __dev__: - - def setVisibility(self, visibility): - self.decrementRefCounts(self.visibility) - self.visibility = visibility - self.incrementRefCounts(self.visibility) - self.level.handleVisChange() + del self.visibleZoneNums[zoneNum] \ No newline at end of file diff --git a/otp/otpbase/OTPGlobals.py b/otp/otpbase/OTPGlobals.py index b741c6b4..2b8bc0aa 100644 --- a/otp/otpbase/OTPGlobals.py +++ b/otp/otpbase/OTPGlobals.py @@ -208,7 +208,6 @@ InventoryHotkeyOn = 'home' InventoryHotkeyOff = 'home-up' MapHotkeyOn = 'delete' MapHotkeyOff = 'delete-up' -DetectGarbageHotkey = 'shift-f11' PrintCamPosHotkey = 'f12' QuitGameHotKeyOSX = 'meta-q' QuitGameHotKeyRepeatOSX = 'meta-q-repeat' diff --git a/toontown/building/ElevatorConstants.py b/toontown/building/ElevatorConstants.py index 1c7e1e9d..a255fa46 100644 --- a/toontown/building/ElevatorConstants.py +++ b/toontown/building/ElevatorConstants.py @@ -18,15 +18,6 @@ REJECT_BLOCKED_ROOM = 5 REJECT_NOT_YET_AVAILABLE = 6 REJECT_BOARDINGPARTY = 7 MAX_GROUP_BOARDING_TIME = 6.0 -if __dev__: - try: - config = simbase.config - except: - config = base.config - - elevatorCountdown = config.GetFloat('elevator-countdown', -1) - if elevatorCountdown != -1: - bboard.post('elevatorCountdown', elevatorCountdown) ElevatorData = {ELEVATOR_NORMAL: {'openTime': 2.0, 'closeTime': 2.0, 'width': 3.5, diff --git a/toontown/cogdominium/CogdoBoardroomGameSpec.py b/toontown/cogdominium/CogdoBoardroomGameSpec.py index d8e808fb..4e785d87 100644 --- a/toontown/cogdominium/CogdoBoardroomGameSpec.py +++ b/toontown/cogdominium/CogdoBoardroomGameSpec.py @@ -4,13 +4,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'comment': '', 'parentEntId': 0, 'modelFilename': 'phase_10/models/cogHQ/EndVault.bam'}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/cogdominium/CogdoCraneGameSpec.py b/toontown/cogdominium/CogdoCraneGameSpec.py index 129fbeae..f124ee0e 100644 --- a/toontown/cogdominium/CogdoCraneGameSpec.py +++ b/toontown/cogdominium/CogdoCraneGameSpec.py @@ -4,13 +4,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'comment': '', 'parentEntId': 0, 'modelFilename': 'phase_10/models/cogHQ/EndVault.bam'}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/cogdominium/CogdoLevelGameBase.py b/toontown/cogdominium/CogdoLevelGameBase.py deleted file mode 100644 index cc63b5b5..00000000 --- a/toontown/cogdominium/CogdoLevelGameBase.py +++ /dev/null @@ -1,38 +0,0 @@ -from direct.fsm.StatePush import FunctionCall -from otp.level.EntityStateVarSet import EntityStateVarSet -from otp.level.LevelSpec import LevelSpec - -class CogdoLevelGameBase: - - def getLevelSpec(self): - return LevelSpec(self.getSpec()) - - if __dev__: - - def startHandleEdits(self): - fcs = [] - Consts = self.getConsts() - for item in Consts.__dict__.itervalues(): - if isinstance(item, EntityStateVarSet): - for attribName in item._getAttributeNames(): - handler = getattr(self, '_handle%sChanged' % attribName, None) - if handler: - stateVar = getattr(item, attribName) - fcs.append(FunctionCall(handler, stateVar)) - - self._functionCalls = fcs - return - - def stopHandleEdits(self): - if __dev__: - for fc in self._functionCalls: - fc.destroy() - - self._functionCalls = None - return - - def getEntityTypeReg(self): - import CogdoEntityTypes - from otp.level import EntityTypeRegistry - typeReg = EntityTypeRegistry.EntityTypeRegistry(CogdoEntityTypes) - return typeReg diff --git a/toontown/cogdominium/DistCogdoBoardroomGame.py b/toontown/cogdominium/DistCogdoBoardroomGame.py index a7cb615b..c676c924 100644 --- a/toontown/cogdominium/DistCogdoBoardroomGame.py +++ b/toontown/cogdominium/DistCogdoBoardroomGame.py @@ -44,10 +44,4 @@ class DistCogdoBoardroomGame(CogdoBoardroomGameBase, DistCogdoLevelGame): self.timer.unstash() def timerExpired(self): - pass - - if __dev__: - - def _handleTimerScaleChanged(self, timerScale): - if hasattr(self, 'timer'): - self.timer.setScale(timerScale) + pass \ No newline at end of file diff --git a/toontown/cogdominium/DistCogdoCrane.py b/toontown/cogdominium/DistCogdoCrane.py index 3f7eb445..9e8b3862 100644 --- a/toontown/cogdominium/DistCogdoCrane.py +++ b/toontown/cogdominium/DistCogdoCrane.py @@ -869,16 +869,4 @@ class DistCogdoCrane(DistributedObject.DistributedObject, FSM.FSM): def exitMovie(self): self.__deactivatePhysics() - self.__straightenCable() - - if __dev__: - - def _handleEmptyFrictionCoefChanged(self, coef): - self.handler.setDynamicFrictionCoef(coef) - - def _handleRopeLinkMassChanged(self, mass): - for an, anp, cnp in self.activeLinks: - an.getPhysicsObject().setMass(mass) - - def _handleMagnetMassChanged(self, mass): - pass + self.__straightenCable() \ No newline at end of file diff --git a/toontown/cogdominium/DistCogdoCraneGame.py b/toontown/cogdominium/DistCogdoCraneGame.py index 98f688ae..0fc9d816 100644 --- a/toontown/cogdominium/DistCogdoCraneGame.py +++ b/toontown/cogdominium/DistCogdoCraneGame.py @@ -28,8 +28,6 @@ class DistCogdoCraneGame(CogdoCraneGameBase, DistCogdoLevelGame): DistCogdoLevelGame.announceGenerate(self) self.timer = ToontownTimer.ToontownTimer() self.timer.stash() - if __dev__: - self._durationChangedEvent = self.uniqueName('durationChanged') def disable(self): self.timer.destroy() @@ -151,8 +149,6 @@ class DistCogdoCraneGame(CogdoCraneGameBase, DistCogdoLevelGame): self._physicsTask = taskMgr.add(self._doPhysics, self.uniqueName('physics'), priority=25) self.evWalls.stash() self._startTimer() - if __dev__: - self.accept(self._durationChangedEvent, self._startTimer) def _startTimer(self): timeLeft = GameConsts.Settings.GameDuration.get() - self.getCurrentGameTime() @@ -167,8 +163,6 @@ class DistCogdoCraneGame(CogdoCraneGameBase, DistCogdoLevelGame): return Task.cont def exitGame(self): - if __dev__: - self.ignore(self._durationChangedEvent) DistCogdoLevelGame.exitGame(self) self._physicsTask.remove() @@ -180,32 +174,4 @@ class DistCogdoCraneGame(CogdoCraneGameBase, DistCogdoLevelGame): self.timer.unstash() def timerExpired(self): - pass - - if __dev__: - - def _handleGameDurationChanged(self, gameDuration): - messenger.send(self._durationChangedEvent) - - def _handleGravityChanged(self, gravity): - self.physicsMgr.removeLinearForce(self._gravityForce) - self._gravityForceNode.removeForce(self._gravityForce) - self._gravityForce = PM.LinearVectorForce(0, 0, gravity) - self.physicsMgr.addLinearForce(self._gravityForce) - self._gravityForceNode.addForce(self._gravityForce) - - def _handleEmptyFrictionCoefChanged(self, coef): - for crane in self.cranes.itervalues(): - crane._handleEmptyFrictionCoefChanged(coef) - - def _handleRopeLinkMassChanged(self, mass): - for crane in self.cranes.itervalues(): - crane._handleRopeLinkMassChanged(mass) - - def _handleMagnetMassChanged(self, mass): - for crane in self.cranes.itervalues(): - crane._handleMagnetMassChanged(mass) - - def _handleMoneyBagGrabHeightChanged(self, height): - for moneyBag in self.moneyBags.itervalues(): - moneyBag._handleMoneyBagGrabHeightChanged(height) + pass \ No newline at end of file diff --git a/toontown/cogdominium/DistCogdoCraneGameAI.py b/toontown/cogdominium/DistCogdoCraneGameAI.py index 1ac2594f..4dbc906c 100644 --- a/toontown/cogdominium/DistCogdoCraneGameAI.py +++ b/toontown/cogdominium/DistCogdoCraneGameAI.py @@ -60,11 +60,4 @@ class DistCogdoCraneGameAI(DistCogdoLevelGameAI, CogdoCraneGameBase): def _finishDoneDL(self, task): self.announceGameDone() - return task.done - - if __dev__: - - def _handleGameDurationChanged(self, gameDuration): - if hasattr(self, '_gameDoneEvent') and self._gameDoneEvent != None: - taskMgr.remove(self._gameDoneEvent) - self._scheduleGameDone() \ No newline at end of file + return task.done \ No newline at end of file diff --git a/toontown/cogdominium/DistCogdoCraneMoneyBag.py b/toontown/cogdominium/DistCogdoCraneMoneyBag.py index 995fb950..27f3af40 100644 --- a/toontown/cogdominium/DistCogdoCraneMoneyBag.py +++ b/toontown/cogdominium/DistCogdoCraneMoneyBag.py @@ -80,10 +80,4 @@ class DistCogdoCraneMoneyBag(DistCogdoCraneObject): self.showShadows() def exitInitial(self): - pass - - if __dev__: - - def _handleMoneyBagGrabHeightChanged(self, height): - grabPos = DistCogdoCraneMoneyBag.grabPos - DistCogdoCraneMoneyBag.grabPos = (grabPos[0], grabPos[1], height) + pass \ No newline at end of file diff --git a/toontown/cogdominium/DistCogdoLevelGame.py b/toontown/cogdominium/DistCogdoLevelGame.py index 93cd1cb6..eb2f61ae 100644 --- a/toontown/cogdominium/DistCogdoLevelGame.py +++ b/toontown/cogdominium/DistCogdoLevelGame.py @@ -1,12 +1,11 @@ from direct.directnotify.DirectNotifyGlobal import directNotify from otp.level.DistributedLevel import DistributedLevel from otp.level import LevelConstants -from otp.level import EditorGlobals +from otp.level.LevelSpec import LevelSpec from toontown.cogdominium.DistCogdoGame import DistCogdoGame -from toontown.cogdominium.CogdoLevelGameBase import CogdoLevelGameBase from toontown.cogdominium.CogdoEntityCreator import CogdoEntityCreator -class DistCogdoLevelGame(CogdoLevelGameBase, DistCogdoGame, DistributedLevel): +class DistCogdoLevelGame(DistCogdoGame, DistributedLevel): notify = directNotify.newCategory('DistCogdoLevelGame') def __init__(self, cr): @@ -16,14 +15,10 @@ class DistCogdoLevelGame(CogdoLevelGameBase, DistCogdoGame, DistributedLevel): def generate(self): DistributedLevel.generate(self) DistCogdoGame.generate(self) - if __dev__: - bboard.post(EditorGlobals.EditTargetPostName, self) def announceGenerate(self): DistributedLevel.announceGenerate(self) DistCogdoGame.announceGenerate(self) - if __dev__: - self.startHandleEdits() def createEntityCreator(self): return CogdoEntityCreator(level=self) @@ -31,18 +26,7 @@ class DistCogdoLevelGame(CogdoLevelGameBase, DistCogdoGame, DistributedLevel): def levelAnnounceGenerate(self): self.notify.debug('levelAnnounceGenerate') DistributedLevel.levelAnnounceGenerate(self) - spec = self.getLevelSpec() - if __dev__: - typeReg = self.getEntityTypeReg() - spec.setEntityTypeReg(typeReg) - DistributedLevel.initializeLevel(self, spec) - - def privGotSpec(self, levelSpec): - if __dev__: - if not levelSpec.hasEntityTypeReg(): - typeReg = self.getEntityTypeReg() - levelSpec.setEntityTypeReg(typeReg) - DistributedLevel.privGotSpec(self, levelSpec) + DistributedLevel.initializeLevel(self, LevelSpec(self.getSpec())) def initVisibility(self): levelMgr = self.getEntity(LevelConstants.LevelMgrEntId) @@ -53,13 +37,9 @@ class DistCogdoLevelGame(CogdoLevelGameBase, DistCogdoGame, DistributedLevel): DistributedLevel.placeLocalToon(self, moveLocalAvatar=False) def disable(self): - if __dev__: - self.stopHandleEdits() DistCogdoGame.disable(self) DistributedLevel.disable(self) def delete(self): DistCogdoGame.delete(self) - DistributedLevel.delete(self) - if __dev__: - bboard.removeIfEqual(EditorGlobals.EditTargetPostName, self) + DistributedLevel.delete(self) \ No newline at end of file diff --git a/toontown/coghq/ActiveCell.py b/toontown/coghq/ActiveCell.py index 44627628..b576b8c7 100644 --- a/toontown/coghq/ActiveCell.py +++ b/toontown/coghq/ActiveCell.py @@ -31,12 +31,4 @@ class ActiveCell(BasicEntities.DistributedNodePathEntity): def setState(self, state, objId): self.state = state - self.occupantId = objId - - if __dev__: - - def attribChanged(self, *args): - model = self.find('*') - if not model.isEmpty(): - model.removeNode() - self.loadModel() + self.occupantId = objId \ No newline at end of file diff --git a/toontown/coghq/BarrelBase.py b/toontown/coghq/BarrelBase.py index 3ac803c2..ac3b09ec 100644 --- a/toontown/coghq/BarrelBase.py +++ b/toontown/coghq/BarrelBase.py @@ -28,31 +28,4 @@ class BarrelBase: self._gagTrack = self.getRng().choice(tracks) else: self._gagTrack = self.gagTrack - return self._gagTrack - - if __dev__: - - def setRewardPerGrab(self, rewardPerGrab): - if hasattr(self, '_reward'): - del self._reward - self.rewardPerGrab = rewardPerGrab - - def setRewardPerGrabMax(self, rewardPerGrabMax): - if hasattr(self, '_reward'): - del self._reward - self.rewardPerGrabMax = rewardPerGrabMax - - def setGagLevel(self, gagLevel): - if hasattr(self, '_gagLevel'): - del self._gagLevel - self.gagLevel = gagLevel - - def setGagLevelMax(self, gagLevelMax): - if hasattr(self, '_gagLevel'): - del self._gagLevel - self.gagLevelMax = gagLevelMax - - def setGagTrack(self, gagTrack): - if hasattr(self, '_gagTrack'): - del self._gagTrack - self.gagTrack = gagTrack + return self._gagTrack \ No newline at end of file diff --git a/toontown/coghq/BattleBlocker.py b/toontown/coghq/BattleBlocker.py index ae333c6b..7babece6 100644 --- a/toontown/coghq/BattleBlocker.py +++ b/toontown/coghq/BattleBlocker.py @@ -86,10 +86,4 @@ class BattleBlocker(BasicEntities.DistributedNodePathEntity): track = Sequence() if callback: track.append(Func(callback)) - track.start() - - if __dev__: - - def attribChanged(self, *args): - self.unloadCollisionGeom() - self.initCollisionGeom() + track.start() \ No newline at end of file diff --git a/toontown/coghq/BattleBlockerAI.py b/toontown/coghq/BattleBlockerAI.py index 027e6162..b633f395 100644 --- a/toontown/coghq/BattleBlockerAI.py +++ b/toontown/coghq/BattleBlockerAI.py @@ -63,18 +63,4 @@ class BattleBlockerAI(DistributedEntityAI.DistributedEntityAI): messenger.send(self.getOutputEventName(), [1]) def d_setBattleFinished(self): - self.sendUpdate('setBattleFinished', []) - - if __dev__: - - def attribChanged(self, *args): - self.suitIds = [] - suits = self.level.planner.battleCellId2suits.get(self.cellId) - if suits: - for suit in suits: - self.suitIds.append(suit.doId) - - else: - self.notify.warning("Couldn't find battle cell id %d in battleCellId2suits" % self.cellId) - self.d_setSuits() - self.registerBlocker() + self.sendUpdate('setBattleFinished', []) \ No newline at end of file diff --git a/toontown/coghq/BossbotCountryClubEntrance_Action00.py b/toontown/coghq/BossbotCountryClubEntrance_Action00.py index 6e12640f..617a9b9a 100644 --- a/toontown/coghq/BossbotCountryClubEntrance_Action00.py +++ b/toontown/coghq/BossbotCountryClubEntrance_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/BossbotEntranceRoom', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/BossbotCountryClubFairwayRoom_Battle00.py b/toontown/coghq/BossbotCountryClubFairwayRoom_Battle00.py index 0e3c75dd..80cf9ad2 100644 --- a/toontown/coghq/BossbotCountryClubFairwayRoom_Battle00.py +++ b/toontown/coghq/BossbotCountryClubFairwayRoom_Battle00.py @@ -7,16 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/BossbotFairwayRoom_A', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': {'entType': 'door', - 'username': 'rurbino', - 'parentEntId': 110001, - 'entId': 110002}, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/BossbotCountryClubGreenRoom_Action00.py b/toontown/coghq/BossbotCountryClubGreenRoom_Action00.py index b7196a21..70d73ff1 100644 --- a/toontown/coghq/BossbotCountryClubGreenRoom_Action00.py +++ b/toontown/coghq/BossbotCountryClubGreenRoom_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/BossbotGreenRoom_A', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/BossbotCountryClubGreenRoom_Action01.py b/toontown/coghq/BossbotCountryClubGreenRoom_Action01.py index ae1b8c35..c65cbef1 100644 --- a/toontown/coghq/BossbotCountryClubGreenRoom_Action01.py +++ b/toontown/coghq/BossbotCountryClubGreenRoom_Action01.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/BossbotGreenRoom_A', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/BossbotCountryClubGreenRoom_Action02.py b/toontown/coghq/BossbotCountryClubGreenRoom_Action02.py index 33e85813..157c91ed 100644 --- a/toontown/coghq/BossbotCountryClubGreenRoom_Action02.py +++ b/toontown/coghq/BossbotCountryClubGreenRoom_Action02.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/BossbotGreenRoom_A', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/BossbotCountryClubKartRoom_Battle00.py b/toontown/coghq/BossbotCountryClubKartRoom_Battle00.py index 416b2402..56820805 100644 --- a/toontown/coghq/BossbotCountryClubKartRoom_Battle00.py +++ b/toontown/coghq/BossbotCountryClubKartRoom_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/BossbotKartBoardingRm', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/BossbotCountryClubMazeRoom_Battle00.py b/toontown/coghq/BossbotCountryClubMazeRoom_Battle00.py index dffc77e5..d5dd4e46 100644 --- a/toontown/coghq/BossbotCountryClubMazeRoom_Battle00.py +++ b/toontown/coghq/BossbotCountryClubMazeRoom_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/BossbotMazex1_C', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/BossbotCountryClubMazeRoom_Battle01.py b/toontown/coghq/BossbotCountryClubMazeRoom_Battle01.py index 4599fffe..73714423 100644 --- a/toontown/coghq/BossbotCountryClubMazeRoom_Battle01.py +++ b/toontown/coghq/BossbotCountryClubMazeRoom_Battle01.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/BossbotMazex2_straight_C', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/BossbotCountryClubMazeRoom_Battle02.py b/toontown/coghq/BossbotCountryClubMazeRoom_Battle02.py index c6e9092a..51fe54fd 100644 --- a/toontown/coghq/BossbotCountryClubMazeRoom_Battle02.py +++ b/toontown/coghq/BossbotCountryClubMazeRoom_Battle02.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/BossbotMazex4_C', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/BossbotCountryClubPresidentRoom_Battle00.py b/toontown/coghq/BossbotCountryClubPresidentRoom_Battle00.py index 6b0fd4a9..00e67b3b 100644 --- a/toontown/coghq/BossbotCountryClubPresidentRoom_Battle00.py +++ b/toontown/coghq/BossbotCountryClubPresidentRoom_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/BossbotPresidentsRm', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/BossbotCountryClubTeeOffRoom_Action00.py b/toontown/coghq/BossbotCountryClubTeeOffRoom_Action00.py index da3e4053..d84b9c83 100644 --- a/toontown/coghq/BossbotCountryClubTeeOffRoom_Action00.py +++ b/toontown/coghq/BossbotCountryClubTeeOffRoom_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/BossbotTeeOffRoom', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/BossbotCountryClubTeeOffRoom_Action01.py b/toontown/coghq/BossbotCountryClubTeeOffRoom_Action01.py index 485cbf95..7fe025cd 100644 --- a/toontown/coghq/BossbotCountryClubTeeOffRoom_Action01.py +++ b/toontown/coghq/BossbotCountryClubTeeOffRoom_Action01.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/BossbotTeeOffRoom', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/BossbotCountryClubTeeOffRoom_Action02.py b/toontown/coghq/BossbotCountryClubTeeOffRoom_Action02.py index 76c7b1c3..2a427b75 100644 --- a/toontown/coghq/BossbotCountryClubTeeOffRoom_Action02.py +++ b/toontown/coghq/BossbotCountryClubTeeOffRoom_Action02.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_12/models/bossbotHQ/BossbotTeeOffRoom', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintBoilerRoom_Action00.py b/toontown/coghq/CashbotMintBoilerRoom_Action00.py index 34605eb4..e27f2e7a 100644 --- a/toontown/coghq/CashbotMintBoilerRoom_Action00.py +++ b/toontown/coghq/CashbotMintBoilerRoom_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE08a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintBoilerRoom_Battle00.py b/toontown/coghq/CashbotMintBoilerRoom_Battle00.py index 06a5dab7..d756c426 100644 --- a/toontown/coghq/CashbotMintBoilerRoom_Battle00.py +++ b/toontown/coghq/CashbotMintBoilerRoom_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE08a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintBoilerRoom_Battle01.py b/toontown/coghq/CashbotMintBoilerRoom_Battle01.py index 28e2ddc9..898cd205 100644 --- a/toontown/coghq/CashbotMintBoilerRoom_Battle01.py +++ b/toontown/coghq/CashbotMintBoilerRoom_Battle01.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE08a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintControlRoom_Battle00.py b/toontown/coghq/CashbotMintControlRoom_Battle00.py index 7624c34e..b445ae40 100644 --- a/toontown/coghq/CashbotMintControlRoom_Battle00.py +++ b/toontown/coghq/CashbotMintControlRoom_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE31a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintDuctRoom_Action00.py b/toontown/coghq/CashbotMintDuctRoom_Action00.py index ffddc61b..a43b8fdd 100644 --- a/toontown/coghq/CashbotMintDuctRoom_Action00.py +++ b/toontown/coghq/CashbotMintDuctRoom_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE15a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintDuctRoom_Battle00.py b/toontown/coghq/CashbotMintDuctRoom_Battle00.py index 646fcc5a..c68ada2a 100644 --- a/toontown/coghq/CashbotMintDuctRoom_Battle00.py +++ b/toontown/coghq/CashbotMintDuctRoom_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE15a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintDuctRoom_Battle01.py b/toontown/coghq/CashbotMintDuctRoom_Battle01.py index 127dbb6e..64820963 100644 --- a/toontown/coghq/CashbotMintDuctRoom_Battle01.py +++ b/toontown/coghq/CashbotMintDuctRoom_Battle01.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE15a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintEntrance_Action00.py b/toontown/coghq/CashbotMintEntrance_Action00.py index 32c8f8d1..4442c494 100644 --- a/toontown/coghq/CashbotMintEntrance_Action00.py +++ b/toontown/coghq/CashbotMintEntrance_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE03a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintGearRoom_Action00.py b/toontown/coghq/CashbotMintGearRoom_Action00.py index 3d7ee8cb..2564fba3 100644 --- a/toontown/coghq/CashbotMintGearRoom_Action00.py +++ b/toontown/coghq/CashbotMintGearRoom_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE07a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintGearRoom_Battle00.py b/toontown/coghq/CashbotMintGearRoom_Battle00.py index ae8b14f6..c639b2de 100644 --- a/toontown/coghq/CashbotMintGearRoom_Battle00.py +++ b/toontown/coghq/CashbotMintGearRoom_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE07a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintGearRoom_Battle01.py b/toontown/coghq/CashbotMintGearRoom_Battle01.py index 005f1cbf..00dc0ec8 100644 --- a/toontown/coghq/CashbotMintGearRoom_Battle01.py +++ b/toontown/coghq/CashbotMintGearRoom_Battle01.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE07a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintLavaRoomFoyer_Action00.py b/toontown/coghq/CashbotMintLavaRoomFoyer_Action00.py index 3a740f5a..739037c5 100644 --- a/toontown/coghq/CashbotMintLavaRoomFoyer_Action00.py +++ b/toontown/coghq/CashbotMintLavaRoomFoyer_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE18a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintLavaRoomFoyer_Action01.py b/toontown/coghq/CashbotMintLavaRoomFoyer_Action01.py index bb66a247..bb606886 100644 --- a/toontown/coghq/CashbotMintLavaRoomFoyer_Action01.py +++ b/toontown/coghq/CashbotMintLavaRoomFoyer_Action01.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE18a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintLavaRoomFoyer_Battle00.py b/toontown/coghq/CashbotMintLavaRoomFoyer_Battle00.py index 0e1be57c..46de9114 100644 --- a/toontown/coghq/CashbotMintLavaRoomFoyer_Battle00.py +++ b/toontown/coghq/CashbotMintLavaRoomFoyer_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE18a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintLavaRoomFoyer_Battle01.py b/toontown/coghq/CashbotMintLavaRoomFoyer_Battle01.py index 4586be50..7cb5a727 100644 --- a/toontown/coghq/CashbotMintLavaRoomFoyer_Battle01.py +++ b/toontown/coghq/CashbotMintLavaRoomFoyer_Battle01.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE18a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintLavaRoom_Action00.py b/toontown/coghq/CashbotMintLavaRoom_Action00.py index 4e4060f9..65064c60 100644 --- a/toontown/coghq/CashbotMintLavaRoom_Action00.py +++ b/toontown/coghq/CashbotMintLavaRoom_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE19a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintLobby_Action00.py b/toontown/coghq/CashbotMintLobby_Action00.py index 09a9f4c2..e38dee00 100644 --- a/toontown/coghq/CashbotMintLobby_Action00.py +++ b/toontown/coghq/CashbotMintLobby_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE04a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintLobby_Battle00.py b/toontown/coghq/CashbotMintLobby_Battle00.py index bda60561..3a425e7c 100644 --- a/toontown/coghq/CashbotMintLobby_Battle00.py +++ b/toontown/coghq/CashbotMintLobby_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE04a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintLobby_Battle01.py b/toontown/coghq/CashbotMintLobby_Battle01.py index ae383de3..6068d846 100644 --- a/toontown/coghq/CashbotMintLobby_Battle01.py +++ b/toontown/coghq/CashbotMintLobby_Battle01.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE04a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintOilRoom_Battle00.py b/toontown/coghq/CashbotMintOilRoom_Battle00.py index 81662379..f0a561dc 100644 --- a/toontown/coghq/CashbotMintOilRoom_Battle00.py +++ b/toontown/coghq/CashbotMintOilRoom_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE22a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintPaintMixerReward_Battle00.py b/toontown/coghq/CashbotMintPaintMixerReward_Battle00.py index 1d011902..b8502595 100644 --- a/toontown/coghq/CashbotMintPaintMixerReward_Battle00.py +++ b/toontown/coghq/CashbotMintPaintMixerReward_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE11a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintPaintMixer_Action00.py b/toontown/coghq/CashbotMintPaintMixer_Action00.py index 8f13bbc6..4dd032db 100644 --- a/toontown/coghq/CashbotMintPaintMixer_Action00.py +++ b/toontown/coghq/CashbotMintPaintMixer_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE10a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintPipeRoom_Action00.py b/toontown/coghq/CashbotMintPipeRoom_Action00.py index 4bef84e9..89cf0e20 100644 --- a/toontown/coghq/CashbotMintPipeRoom_Action00.py +++ b/toontown/coghq/CashbotMintPipeRoom_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE13a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintPipeRoom_Battle00.py b/toontown/coghq/CashbotMintPipeRoom_Battle00.py index da9120ce..647c58ec 100644 --- a/toontown/coghq/CashbotMintPipeRoom_Battle00.py +++ b/toontown/coghq/CashbotMintPipeRoom_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE13a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintPipeRoom_Battle01.py b/toontown/coghq/CashbotMintPipeRoom_Battle01.py index cb501878..d7ecab2c 100644 --- a/toontown/coghq/CashbotMintPipeRoom_Battle01.py +++ b/toontown/coghq/CashbotMintPipeRoom_Battle01.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE13a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/CashbotMintStomperAlley_Action00.py b/toontown/coghq/CashbotMintStomperAlley_Action00.py index babeee70..e275475b 100644 --- a/toontown/coghq/CashbotMintStomperAlley_Action00.py +++ b/toontown/coghq/CashbotMintStomperAlley_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE17a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/ConveyorBelt.py b/toontown/coghq/ConveyorBelt.py index f8e2685f..e5fc0b22 100644 --- a/toontown/coghq/ConveyorBelt.py +++ b/toontown/coghq/ConveyorBelt.py @@ -98,10 +98,4 @@ class ConveyorBelt(BasicEntities.NodePathEntity): del self.tailClipPath self.clearClipPlane() for tread in self.treads: - tread.parentingNode.clearClipPlane() - - if __dev__: - - def attribChanged(self, attrib, value): - self.destroyBelt() - self.initBelt() + tread.parentingNode.clearClipPlane() \ No newline at end of file diff --git a/toontown/coghq/CountryClubRoomBase.py b/toontown/coghq/CountryClubRoomBase.py index 764c0d79..4b21f8de 100644 --- a/toontown/coghq/CountryClubRoomBase.py +++ b/toontown/coghq/CountryClubRoomBase.py @@ -13,12 +13,4 @@ class CountryClubRoomBase: self.roomId = roomId def getCogTrack(self): - return self.cogTrack - - if __dev__: - - def getCountryClubEntityTypeReg(self): - import FactoryEntityTypes - from otp.level import EntityTypeRegistry - typeReg = EntityTypeRegistry.EntityTypeRegistry(FactoryEntityTypes) - return typeReg + return self.cogTrack \ No newline at end of file diff --git a/toontown/coghq/DistributedCountryClubAI.py b/toontown/coghq/DistributedCountryClubAI.py index e08cabea..2b43796b 100644 --- a/toontown/coghq/DistributedCountryClubAI.py +++ b/toontown/coghq/DistributedCountryClubAI.py @@ -41,8 +41,6 @@ class DistributedCountryClubAI(DistributedObjectAI.DistributedObjectAI): self.sendUpdate('setRoomDoIds', [ roomDoIds]) self.placeElevatorsOnMarkers() - if __dev__: - simbase.countryClub = self description = '%s|%s|%s' % (self.countryClubId, self.floorNum, self.avIds) for avId in self.avIds: self.air.writeServerEvent('countryClubEntered', avId, description) @@ -58,9 +56,6 @@ class DistributedCountryClubAI(DistributedObjectAI.DistributedObjectAI): def delete(self): self.notify.info('delete: %s' % self.doId) - if __dev__: - if hasattr(simbase, 'countryClub') and simbase.countryClub is self: - del simbase.countryClub del self.rooms del self.layout del self.battleExpAggreg diff --git a/toontown/coghq/DistributedCountryClubRoom.py b/toontown/coghq/DistributedCountryClubRoom.py index 1f8140a0..9dc89b7c 100644 --- a/toontown/coghq/DistributedCountryClubRoom.py +++ b/toontown/coghq/DistributedCountryClubRoom.py @@ -11,8 +11,6 @@ import CountryClubRoomSpecs from otp.level import LevelSpec, LevelConstants from toontown.toonbase import TTLocalizer from toontown.nametag.NametagGlobals import * -if __dev__: - from otp.level import EditorGlobals def getCountryClubRoomReadyPostName(doId): return 'countryClubRoomReady-%s' % doId @@ -65,19 +63,12 @@ class DistributedCountryClubRoom(DistributedLevel.DistributedLevel, CountryClubR DistributedLevel.DistributedLevel.levelAnnounceGenerate(self) specModule = CountryClubRoomSpecs.getCountryClubRoomSpecModule(self.roomId) roomSpec = LevelSpec.LevelSpec(specModule) - if __dev__: - typeReg = self.getCountryClubEntityTypeReg() - roomSpec.setEntityTypeReg(typeReg) DistributedLevel.DistributedLevel.initializeLevel(self, roomSpec) def getReadyPostName(self): return getCountryClubRoomReadyPostName(self.doId) def privGotSpec(self, levelSpec): - if __dev__: - if not levelSpec.hasEntityTypeReg(): - typeReg = self.getCountryClubEntityTypeReg() - levelSpec.setEntityTypeReg(typeReg) DistributedLevel.DistributedLevel.privGotSpec(self, levelSpec) base.localAvatar.setH(-90) CountryClubRoom.CountryClubRoom.enter(self) @@ -130,20 +121,14 @@ class DistributedCountryClubRoom(DistributedLevel.DistributedLevel, CountryClubR pass def getParentTokenForEntity(self, entId): - if __dev__: - pass return 1000000 * self.roomNum + entId def enterLtNotPresent(self): CountryClubRoom.CountryClubRoom.enterLtNotPresent(self) - if __dev__: - bboard.removeIfEqual(EditorGlobals.EditTargetPostName, self) self.ignore('f2') def enterLtPresent(self): CountryClubRoom.CountryClubRoom.enterLtPresent(self) - if __dev__: - bboard.post(EditorGlobals.EditTargetPostName, self) if self.countryClub is not None: self.countryClub.currentRoomName = CountryClubRoomSpecs.BossbotCountryClubRoomId2RoomName[self.roomId] diff --git a/toontown/coghq/DistributedCountryClubRoomAI.py b/toontown/coghq/DistributedCountryClubRoomAI.py index 39dfc2ba..2fa1add5 100644 --- a/toontown/coghq/DistributedCountryClubRoomAI.py +++ b/toontown/coghq/DistributedCountryClubRoomAI.py @@ -33,10 +33,6 @@ class DistributedCountryClubRoomAI(DistributedLevelAI.DistributedLevelAI, Countr self.notify.debug('loading spec') specModule = CountryClubRoomSpecs.getCountryClubRoomSpecModule(self.roomId) roomSpec = LevelSpec.LevelSpec(specModule) - if __dev__: - self.notify.debug('creating entity type registry') - typeReg = self.getCountryClubEntityTypeReg() - roomSpec.setEntityTypeReg(typeReg) self.notify.debug('creating entities') DistributedLevelAI.DistributedLevelAI.generate(self, roomSpec) self.notify.debug('creating cogs') diff --git a/toontown/coghq/DistributedDoorEntity.py b/toontown/coghq/DistributedDoorEntity.py index 3d1196f4..2d5f6412 100644 --- a/toontown/coghq/DistributedDoorEntity.py +++ b/toontown/coghq/DistributedDoorEntity.py @@ -126,12 +126,8 @@ class DistributedDoorEntity(DistributedDoorEntityBase.DistributedDoorEntityBase, self.accept('exit%s' % (self.getName(),), self.exitTrigger) self.acceptAvatar() - if __dev__: - self.initWantDoors() def takedown(self): - if __dev__: - self.shutdownWantDoors() self.ignoreAll() if self.track is not None: self.track.finish() @@ -446,23 +442,4 @@ class DistributedDoorEntity(DistributedDoorEntityBase.DistributedDoorEntityBase, self.doorLeft.unstash() self.doorRight.unstash() self.doorLeft.setPos(Vec3(0.0)) - self.doorRight.setPos(Vec3(0.0)) - - - if __dev__: - def initWantDoors(self): - self.accept('wantDoorsChanged', self.onWantDoorsChanged) - self.onWantDoorsChanged() - - def shutdownWantDoors(self): - self.ignore('wantDoorsChanged') - - def onWantDoorsChanged(self): - if self.level.levelMgrEntity.wantDoors: - self.getNodePath().unstash() - else: - self.getNodePath().stash() - - def attribChanged(self, attrib, value): - self.takedown() - self.setup() \ No newline at end of file + self.doorRight.setPos(Vec3(0.0)) \ No newline at end of file diff --git a/toontown/coghq/DistributedDoorEntityAI.py b/toontown/coghq/DistributedDoorEntityAI.py index aaa11f4a..2c2a0a3c 100644 --- a/toontown/coghq/DistributedDoorEntityAI.py +++ b/toontown/coghq/DistributedDoorEntityAI.py @@ -206,10 +206,4 @@ class DistributedDoorEntityAI(DistributedDoorEntityBase.DistributedDoorEntityBas def requestOpen(self): if self.isUnlocked(): if self.fsm.getCurrentState() is not self.states[2]: - self.fsm.request(self.states[1]) - - if __dev__: - - def attribChanged(self, attrib, value): - self.takedown() - self.setup() \ No newline at end of file + self.fsm.request(self.states[1]) \ No newline at end of file diff --git a/toontown/coghq/DistributedElevatorMarker.py b/toontown/coghq/DistributedElevatorMarker.py index 16b67995..8d20945c 100644 --- a/toontown/coghq/DistributedElevatorMarker.py +++ b/toontown/coghq/DistributedElevatorMarker.py @@ -44,10 +44,6 @@ class DistributedElevatorMarker(BasicEntities.DistributedNodePathEntity): def loadModel(self): self.rotateNode = self.attachNewNode('rotate') self.model = None - if __dev__: - self.model = loader.loadModel(self.elevatorMarkerModels[self.modelPath]) - self.model.reparentTo(self.rotateNode) - return def unloadModel(self): if self.model: diff --git a/toontown/coghq/DistributedFactory.py b/toontown/coghq/DistributedFactory.py index 1b2951fa..4228aa8a 100644 --- a/toontown/coghq/DistributedFactory.py +++ b/toontown/coghq/DistributedFactory.py @@ -16,8 +16,6 @@ from direct.controls.ControlManager import CollisionHandlerRayStart from otp.ai.MagicWordGlobal import * from toontown.nametag.NametagGlobals import * from toontown.chat.ChatGlobals import CFThought, CFTimeout -if __dev__: - from otp.level import EditorGlobals class DistributedFactory(DistributedLevel.DistributedLevel, FactoryBase.FactoryBase): notify = DirectNotifyGlobal.directNotify.newCategory('DistributedFactory') @@ -41,8 +39,6 @@ class DistributedFactory(DistributedLevel.DistributedLevel, FactoryBase.FactoryB DistributedLevel.DistributedLevel.generate(self) self.factoryViews = FactoryCameraViews.FactoryCameraViews(self) base.localAvatar.chatMgr.chatInputSpeedChat.addFactoryMenu() - if __dev__: - bboard.post(EditorGlobals.EditTargetPostName, self) self.accept('SOSPanelEnter', self.handleSOSPanel) def delete(self): @@ -51,8 +47,6 @@ class DistributedFactory(DistributedLevel.DistributedLevel, FactoryBase.FactoryB self.factoryViews.delete() del self.factoryViews self.ignore('SOSPanelEnter') - if __dev__: - bboard.removeIfEqual(EditorGlobals.EditTargetPostName, self) base.localAvatar.physControls.setCollisionRayHeight(CollisionHandlerRayStart) def setFactoryId(self, id): @@ -76,16 +70,9 @@ class DistributedFactory(DistributedLevel.DistributedLevel, FactoryBase.FactoryB DistributedLevel.DistributedLevel.levelAnnounceGenerate(self) specModule = FactorySpecs.getFactorySpecModule(self.factoryId) factorySpec = LevelSpec.LevelSpec(specModule) - if __dev__: - typeReg = self.getEntityTypeReg() - factorySpec.setEntityTypeReg(typeReg) DistributedLevel.DistributedLevel.initializeLevel(self, factorySpec) def privGotSpec(self, levelSpec): - if __dev__: - if not levelSpec.hasEntityTypeReg(): - typeReg = self.getEntityTypeReg() - levelSpec.setEntityTypeReg(typeReg) firstSetZoneDoneEvent = self.cr.getNextSetZoneDoneEvent() def handleFirstSetZoneDone(): diff --git a/toontown/coghq/DistributedFactoryAI.py b/toontown/coghq/DistributedFactoryAI.py index 8f5e9859..26350389 100644 --- a/toontown/coghq/DistributedFactoryAI.py +++ b/toontown/coghq/DistributedFactoryAI.py @@ -29,15 +29,9 @@ class DistributedFactoryAI(DistributedLevelAI.DistributedLevelAI, FactoryBase.Fa def generate(self): self.notify.info('generate') self.notify.info('start factory %s %s creation, frame=%s' % (self.factoryId, self.doId, globalClock.getFrameCount())) - if __dev__: - simbase.factory = self self.notify.info('loading spec') specModule = FactorySpecs.getFactorySpecModule(self.factoryId) factorySpec = LevelSpec.LevelSpec(specModule) - if __dev__: - self.notify.info('creating entity type registry') - typeReg = self.getEntityTypeReg() - factorySpec.setEntityTypeReg(typeReg) self.notify.info('creating entities') DistributedLevelAI.DistributedLevelAI.generate(self, factorySpec) self.notify.info('creating cogs') @@ -60,9 +54,6 @@ class DistributedFactoryAI(DistributedLevelAI.DistributedLevelAI, FactoryBase.Fa def delete(self): self.notify.info('delete: %s' % self.doId) - if __dev__: - if hasattr(simbase, 'factory') and simbase.factory is self: - del simbase.factory suits = self.suits for reserve in self.reserveSuits: suits.append(reserve[0]) diff --git a/toontown/coghq/DistributedInGameEditor.py b/toontown/coghq/DistributedInGameEditor.py deleted file mode 100644 index d06e34fc..00000000 --- a/toontown/coghq/DistributedInGameEditor.py +++ /dev/null @@ -1,774 +0,0 @@ -from pandac.PandaModules import * -from direct.interval.IntervalGlobal import * -from direct.showbase.PythonUtil import lineInfo, Functor -from direct.directnotify import DirectNotifyGlobal -from direct.distributed import DistributedObject -from otp.level import Level -from otp.level import LevelConstants -from otp.level import Entity -from otp.level import EditMgr -from SpecImports import * -from InGameEditorElements import * -from toontown.cogdominium import CogdoEntityCreator -import string - -class InGameEditorEntityBase(InGameEditorElement): - def __init__(self): - InGameEditorElement.__init__(self) - - def attribChanged(self, attrib, value): - Entity.Entity.attribChanged(self, attrib, value) - print 'attribChange: %s %s, %s = %s' % (self.level.getEntityType(self.entId), - self.entId, - attrib, - repr(value)) - - def getTypeName(self): - return self.level.getEntityType(self.entId) - - def privGetNamePrefix(self): - return '[%s-%s] ' % (self.getTypeName(), self.entId) - - def privGetEntityName(self): - return self.level.levelSpec.getEntitySpec(self.entId)['name'] - - def getName(self): - return '%s%s' % (self.privGetNamePrefix(), self.privGetEntityName()) - - def setNewName(self, newName): - prefix = self.privGetNamePrefix() - if newName[:len(prefix)] == prefix: - newName = newName[len(prefix):] - oldName = self.privGetEntityName() - if oldName != newName: - self.level.setAttribEdit(self.entId, 'name', newName) - - def setParentEntId(self, parentEntId): - self.parentEntId = parentEntId - self.level.buildEntityTree() - - def setName(self, name): - self.name = name - self.level.buildEntityTree() - - -class InGameEditorEntity(Entity.Entity, InGameEditorEntityBase): - - def __init__(self, level, entId): - Entity.Entity.__init__(self, level, entId) - InGameEditorEntityBase.__init__(self) - - def id(self): - return self.entId - - def destroy(self): - Entity.Entity.destroy(self) - - -class InGameEditorEditMgr(EditMgr.EditMgr, InGameEditorEntityBase): - - def __init__(self, level, entId): - EditMgr.EditMgr.__init__(self, level, entId) - InGameEditorEntityBase.__init__(self) - - def destroy(self): - EditMgr.EditMgr.destroy(self) - - -class AttribModifier(Entity.Entity, InGameEditorEntityBase): - notify = DirectNotifyGlobal.directNotify.newCategory('AttribModifier') - - def __init__(self, level, entId): - Entity.Entity.__init__(self, level, entId) - InGameEditorEntityBase.__init__(self) - - def destroy(self): - Entity.Entity.destroy(self) - - def setValue(self, value): - if len(self.typeName) == 0: - AttribModifier.notify.warning('no typeName set') - return - entTypeReg = self.level.entTypeReg - if self.typeName not in entTypeReg.getAllTypeNames(): - AttribModifier.notify.warning('invalid typeName: %s' % self.typeName) - return - typeDesc = entTypeReg.getTypeDesc(self.typeName) - if len(self.attribName) == 0: - AttribModifier.notify.warning('no attribName set') - return - if self.attribName not in typeDesc.getAttribNames(): - AttribModifier.notify.warning('invalid attribName: %s' % self.attribName) - return - if len(value) == 0: - AttribModifier.notify.warning('no value set') - - def setAttrib(entId, typeName = self.typeName, attribName = self.attribName, value = eval(value), recursive = self.recursive): - if typeName == self.level.getEntityType(entId): - self.level.setAttribEdit(entId, attribName, value) - if recursive: - entity = self.level.getEntity(entId) - for child in entity.getChildren(): - setAttrib(child.entId) - - setAttrib(self.parentEntId) - - -def getInGameEditorEntityCreatorClass(level): - entCreator = level.createEntityCreator() - EntCreatorClass = entCreator.__class__ - - class InGameEditorEntityCreator(EntCreatorClass): - - def __init__(self, editor): - EntCreatorClass.__init__(self, editor) - entTypes = self.entType2Ctor.keys() - for type in entTypes: - self.entType2Ctor[type] = InGameEditorEntity - - self.entType2Ctor['editMgr'] = InGameEditorEditMgr - self.entType2Ctor['attribModifier'] = AttribModifier - - return InGameEditorEntityCreator - - -class DistributedInGameEditor(DistributedObject.DistributedObject, Level.Level, InGameEditorElement): - notify = DirectNotifyGlobal.directNotify.newCategory('DistributedInGameEditor') - - def __init__(self, cr): - DistributedObject.DistributedObject.__init__(self, cr) - Level.Level.__init__(self) - InGameEditorElement.__init__(self) - self.editorInitialized = 0 - self.specModified = 0 - self.undoStack = [] - self.redoStack = [] - self.entCreateHandlerQ = [] - self.entitiesWeCreated = [] - self.nodePathId2EntId = {} - - def generate(self): - self.notify.debug('generate') - DistributedObject.DistributedObject.generate(self) - base.inGameEditor = self - - def setEditorAvId(self, editorAvId): - self.editorAvId = editorAvId - - def setEditUsername(self, editUsername): - self.editUsername = editUsername - - def getEditUsername(self): - return self.editUsername - - def setLevelDoId(self, levelDoId): - self.levelDoId = levelDoId - self.level = base.cr.doId2do[self.levelDoId] - - def getLevelDoId(self): - return self.levelDoId - - def announceGenerate(self): - self.notify.debug('announceGenerate') - DistributedObject.DistributedObject.announceGenerate(self) - if self.editorIsLocalToon(): - from otp.level import EditorGlobals - EditorGlobals.assertReadyToEdit() - self.notify.debug('requesting an up-to-date copy of the level spec') - self.sendUpdate('requestCurrentLevelSpec') - - def setSpecSenderDoId(self, doId): - DistributedInGameEditor.notify.debug('setSpecSenderDoId: %s' % doId) - blobSender = base.cr.doId2do[doId] - - def setSpecBlob(specBlob, blobSender = blobSender, self = self): - blobSender.sendAck() - from otp.level.LevelSpec import LevelSpec - curSpec = eval(specBlob) - self.gotCurrentSpec(curSpec) - - if blobSender.isComplete(): - setSpecBlob(blobSender.getBlob()) - else: - evtName = self.uniqueName('specDone') - blobSender.setDoneEvent(evtName) - self.acceptOnce(evtName, setSpecBlob) - - def gotCurrentSpec(self, curSpec): - self.entTypeReg = self.level.getEntityTypeReg() - curSpec.setEntityTypeReg(self.entTypeReg) - self.axis = loader.loadModel('models/misc/xyzAxis.bam') - self.axis.setColorOff() - self.axis.setColorScale(1, 1, 1, 1, 1) - self.initializeLevel(self.doId, curSpec, curSpec.getScenario()) - entCreator = self.level.createEntityCreator() - self.entTypes = entCreator.getEntityTypes() - self.selectedEntity = None - base.startTk() - import InGameEditor - doneEvent = self.uniqueName('editorDone') - saveAsEvent = self.uniqueName('saveSpec') - requestSaveEvent = self.uniqueName('requestSpecSave') - undoEvent = self.uniqueName('undoEvent') - redoEvent = self.uniqueName('redoEvent') - wireframeEvent = self.uniqueName('wireframeEvent') - oobeEvent = self.uniqueName('oobeEvent') - csEvent = self.uniqueName('csEvent') - runEvent = self.uniqueName('runEvent') - texEvent = self.uniqueName('texEvent') - self.editor = InGameEditor.InGameEditor(level=self, doneEvent=doneEvent, requestSaveEvent=requestSaveEvent, saveAsEvent=saveAsEvent, undoEvent=undoEvent, redoEvent=redoEvent, wireframeEvent=wireframeEvent, oobeEvent=oobeEvent, csEvent=csEvent, runEvent=runEvent, texEvent=texEvent) - self.acceptOnce(doneEvent, self.doneEditing) - self.accept(saveAsEvent, self.saveSpec) - self.accept(requestSaveEvent, self.requestSpecSave) - self.accept(undoEvent, self.doUndo) - self.accept(redoEvent, self.doRedo) - self.accept(wireframeEvent, self.doWireframe) - self.accept(oobeEvent, self.doOobe) - self.accept(csEvent, self.doCs) - self.accept(runEvent, self.doRun) - self.accept(texEvent, self.doTex) - self.accept(self.editor.getEventMsgName('Select'), self.handleEntitySelect) - self.accept(self.editor.getEventMsgName('Flash'), self.handleEntitySelect) - self.editorInitialized = 1 - self.buildEntityTree() - return - - def editorIsLocalToon(self): - return self.editorAvId == base.localAvatar.doId - - def createEntityCreator(self): - return getInGameEditorEntityCreatorClass(self.level)(self) - - def doneEditing(self): - self.notify.debug('doneEditing') - if self.specModified: - if self.editor.askYesNo('Save the spec on the AI?'): - self.requestSpecSave() - self.sendUpdate('setFinished') - - def disable(self): - self.notify.debug('disable') - if self.editorInitialized and self.editorIsLocalToon(): - self.axis.removeNode() - del self.axis - if hasattr(self, 'entTypeReg'): - del self.entTypeReg - self.editorInitialized = 0 - Level.Level.destroyLevel(self) - if hasattr(self, 'editor'): - self.editor.quit() - del self.editor - DistributedObject.DistributedObject.disable(self) - self.ignoreAll() - - def getEntInstance(self, entId): - return self.level.getEntity(entId) - - def getEntInstanceNP(self, entId): - entity = self.getEntInstance(entId) - if entity is None: - return - if isinstance(entity, NodePath): - return entity - if hasattr(entity, 'getNodePath'): - return entity.getNodePath() - return - - def getEntInstanceNPCopy(self, entId): - np = self.getEntInstanceNP(entId) - if np is None: - return np - stashNodeGroups = [] - searches = ('**/+ActorNode', '**/+Character') - for search in searches: - stashNodeGroups.append(np.findAllMatches(search)) - - for group in stashNodeGroups: - if not group.isEmpty(): - group.stash() - - par = np.getParent() - copy = np.copyTo(par) - for group in stashNodeGroups: - if not group.isEmpty(): - group.unstash() - - return copy - - def saveSpec(self, filename): - return self.levelSpec.saveToDisk(filename) - - def setEntityParent(self, entity, parent): - parent.addChild(entity) - entity._parentEntity = parent - - def insertEntityIntoTree(self, entId): - ent = self.getEntity(entId) - if entId == LevelConstants.UberZoneEntId: - self.setEntityParent(ent, self) - return - parentEnt = self.getEntity(ent.parentEntId) - if parentEnt is not None: - self.setEntityParent(ent, parentEnt) - return - self.setEntityParent(ent, self.uberZoneEntity) - return - - def buildEntityTree(self): - self.setChildren([]) - entIds = self.entities.keys() - entIds.sort() - for entId in entIds: - ent = self.getEntity(entId) - ent.setChildren([]) - - for entId in entIds: - self.insertEntityIntoTree(entId) - - self.editor.refreshExplorer() - - def onEntityCreate(self, entId): - DistributedInGameEditor.notify.debug('onEntityCreate %s' % entId) - Level.Level.onEntityCreate(self, entId) - entityNP = self.getEntInstanceNP(entId) - if entityNP: - self.nodePathId2EntId[entityNP.get_key()] = entId - if not self.editorInitialized: - return - self.insertEntityIntoTree(entId) - self.editor.refreshExplorer() - if entId == self.entitiesWeCreated[0]: - self.entitiesWeCreated = self.entitiesWeCreated[1:] - self.editor.selectEntity(entId) - - def onEntityDestroy(self, entId): - DistributedInGameEditor.notify.debug('onEntityDestroy %s' % entId) - ent = self.getEntity(entId) - if self.editorInitialized: - entityNP = self.getEntInstanceNP(entId) - if entityNP in self.nodePathId2EntId: - del self.nodePathId2EntId[entityNP.get_key()] - if ent is self.selectedEntity: - self.editor.clearAttribEditPane() - self.selectedEntity = None - ent._parentEntity.removeChild(ent) - del ent._parentEntity - self.editor.refreshExplorer() - Level.Level.onEntityDestroy(self, entId) - return - - def handleEntitySelect(self, entity): - self.selectedEntity = entity - if hasattr(self, 'identifyIval'): - self.identifyIval.finish() - if entity is self: - self.editor.clearAttribEditPane() - else: - entityNP = self.getEntInstanceNP(entity.entId) - if entityNP is not None: - dur = float(0.5) - oColor = entityNP.getColorScale() - flashIval = Sequence(Func(Functor(entityNP.setColorScale, 1, 0, 0, 1)), WaitInterval(dur / 3), Func(Functor(entityNP.setColorScale, 0, 1, 0, 1)), WaitInterval(dur / 3), Func(Functor(entityNP.setColorScale, 0, 0, 1, 1)), WaitInterval(dur / 3), Func(Functor(entityNP.setColorScale, oColor[0], oColor[1], oColor[2], oColor[3]))) - boundIval = Sequence(Func(entityNP.showBounds), WaitInterval(dur * 0.5), Func(entityNP.hideBounds)) - entCp = self.getEntInstanceNPCopy(entity.entId) - entCp.setRenderModeWireframe() - entCp.setTextureOff(1) - wireIval = Sequence(Func(Functor(entCp.setColor, 1, 0, 0, 1, 1)), WaitInterval(dur / 3), Func(Functor(entCp.setColor, 0, 1, 0, 1, 1)), WaitInterval(dur / 3), Func(Functor(entCp.setColor, 0, 0, 1, 1, 1)), WaitInterval(dur / 3), Func(entCp.removeNode)) - self.identifyIval = Parallel(flashIval, boundIval, wireIval) - - def putAxis(self = self, entityNP = entityNP): - self.axis.reparentTo(entityNP) - self.axis.setPos(0, 0, 0) - self.axis.setHpr(0, 0, 0) - - def takeAxis(self = self): - self.axis.reparentTo(hidden) - - self.identifyIval = Sequence(Func(putAxis), Parallel(self.identifyIval, WaitInterval(1000.5)), Func(takeAxis)) - self.identifyIval.start() - self.editor.updateAttribEditPane(entity.entId, self.levelSpec, self.entTypeReg) - entType = self.getEntityType(entity.entId) - menu = self.editor.menuBar.component('Entity-menu') - index = menu.index('Remove Selected Entity') - if entType in self.entTypeReg.getPermanentTypeNames(): - menu.entryconfigure(index, state='disabled') - else: - menu.entryconfigure(index, state='normal') - return - - def privSendAttribEdit(self, entId, attrib, value): - self.specModified = 1 - valueStr = repr(value) - self.notify.debug("sending edit: %s: '%s' = %s" % (entId, attrib, valueStr)) - self.sendUpdate('setEdit', [entId, - attrib, - valueStr, - self.editUsername]) - - def privExecActionList(self, actions): - for action in actions: - if callable(action): - action() - else: - entId, attrib, value = action - self.privSendAttribEdit(entId, attrib, value) - - def setUndoableAttribEdit(self, old2new, new2old): - self.redoStack = [] - self.undoStack.append((new2old, old2new)) - self.privExecActionList(old2new) - - def setAttribEdit(self, entId, attrib, value, canUndo = 1): - oldValue = eval(repr(self.levelSpec.getEntitySpec(entId)[attrib])) - new2old = [(entId, attrib, oldValue)] - old2new = [(entId, attrib, value)] - self.setUndoableAttribEdit(old2new, new2old) - if not canUndo: - self.undoStack = [] - - def doUndo(self): - if len(self.undoStack) == 0: - self.editor.showWarning('Nothing left to undo') - return - undo = self.undoStack.pop() - self.redoStack.append(undo) - new2old, old2new = undo - self.privExecActionList(new2old) - - def doRedo(self): - if len(self.redoStack) == 0: - self.editor.showWarning('Nothing to redo') - return - redo = self.redoStack.pop() - self.undoStack.append(redo) - new2old, old2new = redo - self.privExecActionList(old2new) - - def doWireframe(self): - messenger.send('magicWord', ['~wire']) - - def doOobe(self): - messenger.send('magicWord', ['~oobe']) - - def doCs(self): - messenger.send('magicWord', ['~cs']) - - def doRun(self): - messenger.send('magicWord', ['~run']) - - def doTex(self): - messenger.send('magicWord', ['~tex']) - - def insertEntity(self, entType, parentEntId = None, callback = None): - if parentEntId is None: - try: - parentEntId = self.selectedEntity.entId - except AttributeError: - self.editor.showWarning('Please select a valid parent entity first.', 'error') - return - - removeAction = (self.editMgrEntity.entId, 'removeEntity', {'entId': 'REPLACEME'}) - new2old = [removeAction] - - def setNewEntityId(entId, self = self, action = removeAction, callback = callback): - action[2]['entId'] = entId - if callback: - callback(entId) - - def setEntCreateHandler(self = self, handler = setNewEntityId): - self.entCreateHandlerQ.append(handler) - - old2new = [setEntCreateHandler, (self.editMgrEntity.entId, 'requestNewEntity', {'entType': entType, - 'parentEntId': parentEntId, - 'username': self.editUsername})] - self.setUndoableAttribEdit(old2new, new2old) - return - - def setEntityCreatorUsername(self, entId, editUsername): - Level.Level.setEntityCreatorUsername(self, entId, editUsername) - if editUsername == self.getEditUsername(): - print 'entity %s about to be created; we requested it' % entId - callback = self.entCreateHandlerQ[0] - del self.entCreateHandlerQ[:1] - callback(entId) - self.entitiesWeCreated.append(entId) - - def removeSelectedEntity(self): - try: - selectedEntId = self.selectedEntity.entId - except AttributeError: - self.editor.showWarning('Please select a valid entity to be removed first.', 'error') - return -1 - - if self.getEntity(selectedEntId).getNumChildren() > 0: - self.editor.showWarning('Remove children first.') - return -1 - self.doRemoveEntity(selectedEntId) - - def removeSelectedEntityTree(self): - try: - selectedEntId = self.selectedEntity.entId - except AttributeError: - self.editor.showWarning('Please select a valid entity to be removed first.', 'error') - return -1 - - def removeEntity(entId): - entity = self.getEntity(entId) - for child in entity.getChildren(): - removeEntity(child.entId) - - self.doRemoveEntity(entId) - - removeEntity(selectedEntId) - - def doRemoveEntity(self, entId): - parentEntId = self.getEntity(entId)._parentEntity.entId - entType = self.getEntityType(entId) - if entType in self.entTypeReg.getPermanentTypeNames(): - self.editor.showWarning("Cannot remove entities of type '%s'" % entType) - return - removeAction = (self.editMgrEntity.entId, 'removeEntity', {'entId': entId}) - old2new = [removeAction] - oldAttribs = [] - spec = self.levelSpec.getEntitySpecCopy(entId) - del spec['type'] - for attrib, value in spec.items(): - oldAttribs.append((attrib, value)) - - def setNewEntityId(entId, self = self, removeAction = removeAction, oldAttribs = oldAttribs): - removeAction[2]['entId'] = entId - for attrib, value in spec.items(): - self.privSendAttribEdit(entId, attrib, value) - - def setEntCreateHandler(self = self, handler = setNewEntityId): - self.entCreateHandlerQ.append(handler) - - new2old = [setEntCreateHandler, (self.editMgrEntity.entId, 'requestNewEntity', {'entType': self.getEntityType(entId), - 'parentEntId': parentEntId, - 'username': self.editUsername})] - self.setUndoableAttribEdit(old2new, new2old) - - def makeCopyOfEntName(self, name): - prefix = 'copy of ' - suffix = ' (%s)' - oldName = name - if len(oldName) <= len(prefix): - newName = prefix + oldName - elif oldName[:len(prefix)] != prefix: - newName = prefix + oldName - else: - hasSuffix = True - copyNum = 2 - if oldName[-1] != ')': - hasSuffix = False - if hasSuffix and oldName[-2] in string.digits: - i = len(oldName) - 2 - numString = '' - while oldName[i] in string.digits: - numString = oldName[i] + numString - i -= 1 - - if oldName[i] != '(': - hasSuffix = False - else: - i -= 1 - if oldName[i] != ' ': - hasSuffix = False - else: - print 'numString: %s' % numString - copyNum = int(numString) + 1 - if hasSuffix: - newName = oldName[:i] + suffix % copyNum - else: - newName = oldName + suffix % copyNum - return newName - - def duplicateSelectedEntity(self): - try: - selectedEntId = self.selectedEntity.entId - parentEntId = self.selectedEntity._parentEntity.entId - except AttributeError: - self.editor.showWarning('Please select a valid entity to be removed first.', 'error') - return - - if self.selectedEntity.getNumChildren() > 0: - self.editor.showTodo('Cannot duplicate entity with children.') - return - removeAction = (self.editMgrEntity.entId, 'removeEntity', {'entId': selectedEntId}) - new2old = [removeAction] - copyAttribs = self.levelSpec.getEntitySpecCopy(selectedEntId) - copyAttribs['comment'] = '' - copyAttribs['name'] = self.makeCopyOfEntName(copyAttribs['name']) - typeDesc = self.entTypeReg.getTypeDesc(copyAttribs['type']) - attribDescs = typeDesc.getAttribDescDict() - for attribName, attribDesc in attribDescs.items(): - if attribDesc.getDatatype() == 'const': - del copyAttribs[attribName] - - def setNewEntityId(entId, self = self, removeAction = removeAction, copyAttribs = copyAttribs): - removeAction[2]['entId'] = entId - for attribName, value in copyAttribs.items(): - self.privSendAttribEdit(entId, attribName, value) - - def setEntCreateHandler(self = self, handler = setNewEntityId): - self.entCreateHandlerQ.append(handler) - - old2new = [setEntCreateHandler, (self.editMgrEntity.entId, 'requestNewEntity', {'entType': self.getEntityType(selectedEntId), - 'parentEntId': parentEntId, - 'username': self.editUsername})] - self.setUndoableAttribEdit(old2new, new2old) - - def specPrePickle(self, spec): - for attribName, value in spec.items(): - spec[attribName] = repr(value) - - return spec - - def specPostUnpickle(self, spec): - for attribName, value in spec.items(): - spec[attribName] = eval(value) - - return spec - - def handleImportEntities(self): - try: - selectedEntId = self.selectedEntity.entId - except AttributeError: - self.editor.showWarning('Please select a valid entity first.', 'error') - return - - import tkFileDialog - filename = tkFileDialog.askopenfilename(parent=self.editor.parent, defaultextension='.egroup', filetypes=[('Entity Group', '.egroup'), ('All Files', '*')]) - if len(filename) == 0: - return - try: - import pickle - f = open(filename, 'r') - eTree = pickle.load(f) - eGroup = pickle.load(f) - for entId, spec in eGroup.items(): - eGroup[entId] = self.specPostUnpickle(spec) - - except: - self.editor.showWarning("Error importing entity group from '%s'." % filename, 'error') - return - - oldEntId2new = {} - - def addEntities(treeEntry, parentEntId, eGroup = eGroup): - for entId, children in treeEntry.items(): - spec = eGroup[entId] - entType = spec['type'] - del spec['type'] - del spec['parentEntId'] - typeDesc = self.entTypeReg.getTypeDesc(entType) - for attribName, attribDesc in typeDesc.getAttribDescDict().items(): - if attribDesc.getDatatype() == 'const': - if attribName in spec: - del spec[attribName] - - def handleEntityInsertComplete(newEntId, oldEntId = entId, oldEntId2new = oldEntId2new, spec = spec, treeEntry = treeEntry, addEntities = addEntities): - oldEntId2new[oldEntId] = newEntId - - def assignAttribs(entId = newEntId, oldEntId = oldEntId, spec = spec, treeEntry = treeEntry): - for attribName in spec: - self.setAttribEdit(entId, attribName, spec[attribName]) - - addEntities(treeEntry[oldEntId], newEntId) - - self.acceptOnce(self.getEntityCreateEvent(newEntId), assignAttribs) - - self.insertEntity(entType, parentEntId=parentEntId, callback=handleEntityInsertComplete) - - addEntities(eTree, selectedEntId) - - def handleExportEntity(self): - try: - selectedEntId = self.selectedEntity.entId - except AttributeError: - self.editor.showWarning('Please select a valid entity first.', 'error') - return - - import tkFileDialog - filename = tkFileDialog.asksaveasfilename(parent=self.editor.parent, defaultextension='.egroup', filetypes=[('Entity Group', '.egroup'), ('All Files', '*')]) - if len(filename) == 0: - return - eTree = {selectedEntId: {}} - eGroup = {} - eGroup[selectedEntId] = self.levelSpec.getEntitySpecCopy(selectedEntId) - for entId, spec in eGroup.items(): - eGroup[entId] = self.specPrePickle(spec) - - try: - import pickle - f = open(filename, 'w') - pickle.dump(eTree, f) - pickle.dump(eGroup, f) - except: - self.editor.showWarning("Error exporting entity group to '%s'." % filename, 'error') - return - - def handleExportEntityTree(self): - try: - selectedEntId = self.selectedEntity.entId - except AttributeError: - self.editor.showWarning('Please select a valid entity first.', 'error') - return - - import tkFileDialog - filename = tkFileDialog.asksaveasfilename(parent=self.editor.parent, defaultextension='.egroup', filetypes=[('Entity Group', '.egroup'), ('All Files', '*')]) - if len(filename) == 0: - return - eTree = {} - eGroup = {} - - def addEntity(entId, treeEntry): - treeEntry[entId] = {} - eGroup[entId] = self.levelSpec.getEntitySpecCopy(entId) - entity = self.getEntity(entId) - for child in entity.getChildren(): - addEntity(child.entId, treeEntry[entId]) - - addEntity(selectedEntId, eTree) - for entId, spec in eGroup.items(): - eGroup[entId] = self.specPrePickle(spec) - - try: - import pickle - f = open(filename, 'w') - pickle.dump(eTree, f) - pickle.dump(eGroup, f) - except: - self.editor.showWarning("Error exporting entity group to '%s'." % filename, 'error') - return - - def moveAvToSelected(self): - try: - selectedEntId = self.selectedEntity.entId - except AttributeError: - self.editor.showWarning('Please select a valid entity first.', 'error') - return - - entNp = self.getEntInstanceNP(selectedEntId) - if entNp is None: - zoneEntId = self.levelSpec.getEntityZoneEntId(selectedEntId) - entNp = self.getEntInstanceNP(zoneEntId) - base.localAvatar.setPos(entNp, 0, 0, 0) - base.localAvatar.setHpr(entNp, 0, 0, 0) - zoneNum = self.getEntityZoneEntId(selectedEntId) - self.level.enterZone(zoneNum) - return - - def requestSpecSave(self): - self.privSendAttribEdit(LevelConstants.EditMgrEntId, 'requestSave', None) - self.specModified = 0 - return - - def setAttribChange(self, entId, attrib, valueStr, username): - if username == self.editUsername: - print 'we got our own edit back!' - value = eval(valueStr) - self.levelSpec.setAttribChange(entId, attrib, value, username) - - def getTypeName(self): - return 'Level' diff --git a/toontown/coghq/DistributedLaserFieldAI.py b/toontown/coghq/DistributedLaserFieldAI.py index a0b699ca..17ec5888 100644 --- a/toontown/coghq/DistributedLaserFieldAI.py +++ b/toontown/coghq/DistributedLaserFieldAI.py @@ -135,8 +135,7 @@ class DistributedLaserFieldAI(BattleBlockerAI.BattleBlockerAI, NodePath, BasicEn stage = self.air.getDo(self.level.stageDoId) stage.resetPuzzelReward() self.healReady = 0 - if not __dev__ and 1: - self.canButton = 0 + self.canButton = 0 self.sendUpdate('setActiveLF', [0]) if not self.playedSound: self.sendUpdate('setSuccess', [0]) diff --git a/toontown/coghq/DistributedLawOffice.py b/toontown/coghq/DistributedLawOffice.py index 810e603a..66ae75e2 100644 --- a/toontown/coghq/DistributedLawOffice.py +++ b/toontown/coghq/DistributedLawOffice.py @@ -13,8 +13,6 @@ from otp.level import LevelConstants from toontown.toonbase import TTLocalizer from toontown.coghq import FactoryCameraViews from direct.distributed.DistributedObject import DistributedObject -if __dev__: - from otp.level import EditorGlobals class DistributedLawOffice(DistributedObject, LawOfficeBase.LawOfficeBase): notify = DirectNotifyGlobal.directNotify.newCategory('DistributedLawOffice') diff --git a/toontown/coghq/DistributedLawOfficeFloor.py b/toontown/coghq/DistributedLawOfficeFloor.py index 6d859e38..2795a941 100644 --- a/toontown/coghq/DistributedLawOfficeFloor.py +++ b/toontown/coghq/DistributedLawOfficeFloor.py @@ -12,8 +12,6 @@ from otp.level import LevelSpec from otp.level import LevelConstants from toontown.toonbase import TTLocalizer from toontown.coghq import FactoryCameraViews -if __dev__: - from otp.level import EditorGlobals class DistributedLawOfficeFloor(DistributedLevel.DistributedLevel, LawOfficeBase.LawOfficeBase): notify = DirectNotifyGlobal.directNotify.newCategory('DistributedLawOffice') @@ -36,8 +34,6 @@ class DistributedLawOfficeFloor(DistributedLevel.DistributedLevel, LawOfficeBase DistributedLevel.DistributedLevel.generate(self) self.factoryViews = FactoryCameraViews.FactoryCameraViews(self) base.localAvatar.chatMgr.chatInputSpeedChat.addFactoryMenu() - if __dev__: - bboard.post(EditorGlobals.EditTargetPostName, self) self.accept('SOSPanelEnter', self.handleSOSPanel) def delete(self): @@ -46,8 +42,6 @@ class DistributedLawOfficeFloor(DistributedLevel.DistributedLevel, LawOfficeBase self.factoryViews.delete() del self.factoryViews self.ignore('SOSPanelEnter') - if __dev__: - bboard.removeIfEqual(EditorGlobals.EditTargetPostName, self) def setLawOfficeId(self, id): LawOfficeBase.LawOfficeBase.setLawOfficeId(self, id) @@ -70,16 +64,9 @@ class DistributedLawOfficeFloor(DistributedLevel.DistributedLevel, LawOfficeBase DistributedLevel.DistributedLevel.levelAnnounceGenerate(self) specModule = FactorySpecs.getFactorySpecModule(self.lawOfficeId) factorySpec = LevelSpec.LevelSpec(specModule) - if __dev__: - typeReg = self.getEntityTypeReg() - factorySpec.setEntityTypeReg(typeReg) DistributedLevel.DistributedLevel.initializeLevel(self, factorySpec) def privGotSpec(self, levelSpec): - if __dev__: - if not levelSpec.hasEntityTypeReg(): - typeReg = self.getEntityTypeReg() - levelSpec.setEntityTypeReg(typeReg) firstSetZoneDoneEvent = self.cr.getNextSetZoneDoneEvent() def handleFirstSetZoneDone(): diff --git a/toontown/coghq/DistributedLawOfficeFloorAI.py b/toontown/coghq/DistributedLawOfficeFloorAI.py index 38a8f743..0a5fb334 100644 --- a/toontown/coghq/DistributedLawOfficeFloorAI.py +++ b/toontown/coghq/DistributedLawOfficeFloorAI.py @@ -45,10 +45,6 @@ class DistributedLawOfficeFloorAI(DistributedLevelAI.DistributedLevelAI, LawOffi def startFloor(self): self.notify.info('loading spec') self.factorySpec = LevelSpec.LevelSpec(self.spec) - if __dev__: - self.notify.info('creating entity type registry') - typeReg = self.getEntityTypeReg() - self.factorySpec.setEntityTypeReg(typeReg) self.notify.info('creating entities') DistributedLevelAI.DistributedLevelAI.generate(self, self.factorySpec) self.notify.info('creating cogs') diff --git a/toontown/coghq/DistributedLift.py b/toontown/coghq/DistributedLift.py index 362d750f..c8e02291 100644 --- a/toontown/coghq/DistributedLift.py +++ b/toontown/coghq/DistributedLift.py @@ -199,11 +199,4 @@ class DistributedLift(BasicEntities.DistributedNodePathEntity): self.notify.debug('enterWaiting') def exitWaiting(self): - pass - - if __dev__: - - def attribChanged(self, *args): - BasicEntities.DistributedNodePathEntity.attribChanged(self, *args) - self.destroyPlatform() - self.initPlatform() + pass \ No newline at end of file diff --git a/toontown/coghq/DistributedMintAI.py b/toontown/coghq/DistributedMintAI.py index b670602b..ddaff882 100644 --- a/toontown/coghq/DistributedMintAI.py +++ b/toontown/coghq/DistributedMintAI.py @@ -31,8 +31,6 @@ class DistributedMintAI(DistributedObjectAI.DistributedObjectAI): roomDoIds.append(room.doId) self.sendUpdate('setRoomDoIds', [roomDoIds]) - if __dev__: - simbase.mint = self description = '%s|%s|%s' % (self.mintId, self.floorNum, self.avIds) for avId in self.avIds: self.air.writeServerEvent('mintEntered', avId, description) @@ -46,9 +44,6 @@ class DistributedMintAI(DistributedObjectAI.DistributedObjectAI): def delete(self): self.notify.info('delete: %s' % self.doId) - if __dev__: - if hasattr(simbase, 'mint') and simbase.mint is self: - del simbase.mint del self.rooms del self.layout del self.battleExpAggreg diff --git a/toontown/coghq/DistributedMintRoom.py b/toontown/coghq/DistributedMintRoom.py index ad9247f4..3432f732 100644 --- a/toontown/coghq/DistributedMintRoom.py +++ b/toontown/coghq/DistributedMintRoom.py @@ -13,10 +13,6 @@ from toontown.nametag.NametagGlobals import * from toontown.toonbase import TTLocalizer from toontown.toonbase.ToontownGlobals import * - -if __dev__: - from otp.level import EditorGlobals - def getMintRoomReadyPostName(doId): return 'mintRoomReady-%s' % doId @@ -68,19 +64,12 @@ class DistributedMintRoom(DistributedLevel.DistributedLevel, MintRoomBase.MintRo DistributedLevel.DistributedLevel.levelAnnounceGenerate(self) specModule = MintRoomSpecs.getMintRoomSpecModule(self.roomId) roomSpec = LevelSpec.LevelSpec(specModule) - if __dev__: - typeReg = self.getEntityTypeReg() - roomSpec.setEntityTypeReg(typeReg) DistributedLevel.DistributedLevel.initializeLevel(self, roomSpec) def getReadyPostName(self): return getMintRoomReadyPostName(self.doId) def privGotSpec(self, levelSpec): - if __dev__: - if not levelSpec.hasEntityTypeReg(): - typeReg = self.getEntityTypeReg() - levelSpec.setEntityTypeReg(typeReg) DistributedLevel.DistributedLevel.privGotSpec(self, levelSpec) MintRoom.MintRoom.enter(self) self.acceptOnce('leavingMint', self.announceLeaving) @@ -132,20 +121,14 @@ class DistributedMintRoom(DistributedLevel.DistributedLevel, MintRoomBase.MintRo pass def getParentTokenForEntity(self, entId): - if __dev__: - pass return 1000000 * self.roomNum + entId def enterLtNotPresent(self): MintRoom.MintRoom.enterLtNotPresent(self) - if __dev__: - bboard.removeIfEqual(EditorGlobals.EditTargetPostName, self) self.ignore('f2') def enterLtPresent(self): MintRoom.MintRoom.enterLtPresent(self) - if __dev__: - bboard.post(EditorGlobals.EditTargetPostName, self) if self.mint is not None: self.mint.currentRoomName = MintRoomSpecs.CashbotMintRoomId2RoomName[self.roomId] diff --git a/toontown/coghq/DistributedMintRoomAI.py b/toontown/coghq/DistributedMintRoomAI.py index 68e07401..60216f6c 100644 --- a/toontown/coghq/DistributedMintRoomAI.py +++ b/toontown/coghq/DistributedMintRoomAI.py @@ -31,10 +31,6 @@ class DistributedMintRoomAI(DistributedLevelAI.DistributedLevelAI, MintRoomBase. self.notify.debug('loading spec') specModule = MintRoomSpecs.getMintRoomSpecModule(self.roomId) roomSpec = LevelSpec.LevelSpec(specModule) - if __dev__: - self.notify.debug('creating entity type registry') - typeReg = self.getMintEntityTypeReg() - roomSpec.setEntityTypeReg(typeReg) self.notify.debug('creating entities') DistributedLevelAI.DistributedLevelAI.generate(self, roomSpec) self.notify.debug('creating cogs') diff --git a/toontown/coghq/DistributedStageAI.py b/toontown/coghq/DistributedStageAI.py index 715320d9..c3d1cea3 100644 --- a/toontown/coghq/DistributedStageAI.py +++ b/toontown/coghq/DistributedStageAI.py @@ -39,8 +39,6 @@ class DistributedStageAI(DistributedObjectAI.DistributedObjectAI): self.sendUpdate('setRoomDoIds', [ roomDoIds]) self.placeElevatorsOnMarkers() - if __dev__: - simbase.stage = self description = '%s|%s|%s' % (self.stageId, self.floorNum, self.avIds) for avId in self.avIds: self.air.writeServerEvent('stageEntered', avId, description) @@ -57,9 +55,6 @@ class DistributedStageAI(DistributedObjectAI.DistributedObjectAI): def delete(self): self.notify.info('delete: %s' % self.doId) - if __dev__: - if hasattr(simbase, 'stage') and simbase.stage is self: - del simbase.stage self.air.deallocateZone(self.zoneId) if hasattr(self, 'elevatorList'): del self.elevatorList diff --git a/toontown/coghq/DistributedStageRoom.py b/toontown/coghq/DistributedStageRoom.py index a65ba5a0..fefb98a8 100644 --- a/toontown/coghq/DistributedStageRoom.py +++ b/toontown/coghq/DistributedStageRoom.py @@ -11,8 +11,6 @@ import StageRoomSpecs from otp.level import LevelSpec, LevelConstants from toontown.toonbase import TTLocalizer from toontown.nametag.NametagGlobals import * -if __dev__: - from otp.level import EditorGlobals def getStageRoomReadyPostName(doId): return 'stageRoomReady-%s' % doId @@ -65,19 +63,12 @@ class DistributedStageRoom(DistributedLevel.DistributedLevel, StageRoomBase.Stag DistributedLevel.DistributedLevel.levelAnnounceGenerate(self) specModule = StageRoomSpecs.getStageRoomSpecModule(self.roomId) roomSpec = LevelSpec.LevelSpec(specModule) - if __dev__: - typeReg = self.getEntityTypeReg() - roomSpec.setEntityTypeReg(typeReg) DistributedLevel.DistributedLevel.initializeLevel(self, roomSpec) def getReadyPostName(self): return getStageRoomReadyPostName(self.doId) def privGotSpec(self, levelSpec): - if __dev__: - if not levelSpec.hasEntityTypeReg(): - typeReg = self.getEntityTypeReg() - levelSpec.setEntityTypeReg(typeReg) DistributedLevel.DistributedLevel.privGotSpec(self, levelSpec) StageRoom.StageRoom.enter(self) self.acceptOnce('leavingStage', self.announceLeaving) @@ -129,20 +120,14 @@ class DistributedStageRoom(DistributedLevel.DistributedLevel, StageRoomBase.Stag pass def getParentTokenForEntity(self, entId): - if __dev__: - pass return 1000000 * self.roomNum + entId def enterLtNotPresent(self): StageRoom.StageRoom.enterLtNotPresent(self) - if __dev__: - bboard.removeIfEqual(EditorGlobals.EditTargetPostName, self) self.ignore('f2') def enterLtPresent(self): StageRoom.StageRoom.enterLtPresent(self) - if __dev__: - bboard.post(EditorGlobals.EditTargetPostName, self) if self.stage is not None: self.stage.currentRoomName = StageRoomSpecs.CashbotStageRoomId2RoomName[self.roomId] diff --git a/toontown/coghq/DistributedStageRoomAI.py b/toontown/coghq/DistributedStageRoomAI.py index 3a86eddf..a52b7f37 100644 --- a/toontown/coghq/DistributedStageRoomAI.py +++ b/toontown/coghq/DistributedStageRoomAI.py @@ -39,10 +39,6 @@ class DistributedStageRoomAI(DistributedLevelAI.DistributedLevelAI, StageRoomBas self.notify.debug('loading spec') specModule = StageRoomSpecs.getStageRoomSpecModule(self.roomId) roomSpec = LevelSpec.LevelSpec(specModule) - if __dev__: - self.notify.debug('creating entity type registry') - typeReg = self.getStageEntityTypeReg() - roomSpec.setEntityTypeReg(typeReg) self.notify.debug('creating entities') DistributedLevelAI.DistributedLevelAI.generate(self, roomSpec) self.notify.debug('creating cogs') diff --git a/toontown/coghq/DistributedStomper.py b/toontown/coghq/DistributedStomper.py index 6ad24edf..dd5fac9c 100644 --- a/toontown/coghq/DistributedStomper.py +++ b/toontown/coghq/DistributedStomper.py @@ -344,12 +344,4 @@ class DistributedStomper(DistributedCrusherEntity.DistributedCrusherEntity): yRange = 5 if tPos[2] < zRange and tPos[2] > -zRange and tPos[0] < xRange and tPos[0] > -xRange and tPos[1] < yRange / 10.0 and tPos[1] > -yRange: self.level.b_setOuch(self.damage, 'Squish') - base.localAvatar.setZ(self.getZ(render) + 0.025) - - if __dev__: - - def attribChanged(self, *args): - self.stopStomper() - self.unloadModel() - self.loadModel() - self.startStomper(0) + base.localAvatar.setZ(self.getZ(render) + 0.025) \ No newline at end of file diff --git a/toontown/coghq/DistributedSwitch.py b/toontown/coghq/DistributedSwitch.py index 5fd98bf2..7a1c14e1 100644 --- a/toontown/coghq/DistributedSwitch.py +++ b/toontown/coghq/DistributedSwitch.py @@ -121,10 +121,4 @@ class DistributedSwitch(DistributedSwitchBase.DistributedSwitchBase, BasicEntiti if self.track: self.track.finish() self.track = None - return - - if __dev__: - - def attribChanged(self, attrib, value): - self.takedown() - self.setup() + return \ No newline at end of file diff --git a/toontown/coghq/DistributedSwitchAI.py b/toontown/coghq/DistributedSwitchAI.py index c997d722..54bfd389 100644 --- a/toontown/coghq/DistributedSwitchAI.py +++ b/toontown/coghq/DistributedSwitchAI.py @@ -107,10 +107,4 @@ class DistributedSwitchAI(DistributedSwitchBase.DistributedSwitchBase, Distribut if self.doLaterTask: self.doLaterTask.remove() self.doLaterTask = None - return - - if __dev__: - - def attribChanged(self, attrib, value): - self.takedown() - self.setup() + return \ No newline at end of file diff --git a/toontown/coghq/FactoryBase.py b/toontown/coghq/FactoryBase.py index ae840856..e5254a0a 100644 --- a/toontown/coghq/FactoryBase.py +++ b/toontown/coghq/FactoryBase.py @@ -1,5 +1,3 @@ -import FactorySpecs -from otp.level import LevelSpec from toontown.toonbase import ToontownGlobals class FactoryBase: @@ -16,12 +14,4 @@ class FactoryBase: return self.cogTrack def getFactoryType(self): - return self.factoryType - - if __dev__: - - def getEntityTypeReg(self): - import FactoryEntityTypes - from otp.level import EntityTypeRegistry - typeReg = EntityTypeRegistry.EntityTypeRegistry(FactoryEntityTypes) - return typeReg + return self.factoryType \ No newline at end of file diff --git a/toontown/coghq/FactoryLevelMgr.py b/toontown/coghq/FactoryLevelMgr.py index 39c37ee3..ea6b9c10 100644 --- a/toontown/coghq/FactoryLevelMgr.py +++ b/toontown/coghq/FactoryLevelMgr.py @@ -33,10 +33,4 @@ class FactoryLevelMgr(LevelMgr.LevelMgr): LevelMgr.LevelMgr.destroy(self) def setFarPlaneDistance(self, farPlaneDistance): - base.camLens.setNearFar(ToontownGlobals.DefaultCameraNear, farPlaneDistance) - - if __dev__: - - def setWantDoors(self, wantDoors): - self.wantDoors = wantDoors - messenger.send('wantDoorsChanged') + base.camLens.setNearFar(ToontownGlobals.DefaultCameraNear, farPlaneDistance) \ No newline at end of file diff --git a/toontown/coghq/FactoryMockupSpec.py b/toontown/coghq/FactoryMockupSpec.py index 73124253..a199f53e 100644 --- a/toontown/coghq/FactoryMockupSpec.py +++ b/toontown/coghq/FactoryMockupSpec.py @@ -9,13 +9,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'modelFilename': 'phase_9/models/cogHQ/SelbotLegFactory', 'ouchMultiplier': 1, 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/FactorySpecs.py b/toontown/coghq/FactorySpecs.py index 8e344b21..7761dc43 100644 --- a/toontown/coghq/FactorySpecs.py +++ b/toontown/coghq/FactorySpecs.py @@ -21,10 +21,4 @@ if config.GetBool('want-brutal-factory', True): import SellbotMegaCorpLegSpec import SellbotMegaCorpLegCogs FactorySpecModules[ToontownGlobals.SellbotMegaCorpInt] = SellbotMegaCorpLegSpec - CogSpecModules[ToontownGlobals.SellbotMegaCorpInt] = SellbotMegaCorpLegCogs - -if __dev__: - import FactoryMockupSpec - import FactoryMockupCogs - FactorySpecModules[ToontownGlobals.MockupFactoryId] = FactoryMockupSpec - CogSpecModules[ToontownGlobals.MockupFactoryId] = FactoryMockupCogs + CogSpecModules[ToontownGlobals.SellbotMegaCorpInt] = SellbotMegaCorpLegCogs \ No newline at end of file diff --git a/toontown/coghq/GearEntity.py b/toontown/coghq/GearEntity.py index 126f4351..41c74b04 100644 --- a/toontown/coghq/GearEntity.py +++ b/toontown/coghq/GearEntity.py @@ -82,40 +82,4 @@ class GearEntity(BasicEntities.NodePathEntity): def stopRotate(self): if hasattr(self, 'rotateIval'): self.rotateIval.pause() - del self.rotateIval - - if __dev__: - - def setDegreesPerSec(self, degreesPerSec): - if self.entInitialized: - self.degreesPerSec = degreesPerSec - self.startRotate() - - def setPhaseShift(self, phaseShift): - if self.entInitialized: - self.phaseShift = phaseShift - self.startRotate() - - def attribChanged(self, attrib, value): - self.destroyGear() - self.initGear() - - def setScale(self, *args): - BasicEntities.NodePathEntity.setScale(self, *args) - if self.entInitialized: - self.initGear() - - def setSx(self, *args): - BasicEntities.NodePathEntity.setSx(self, *args) - if self.entInitialized: - self.initGear() - - def setSy(self, *args): - BasicEntities.NodePathEntity.setSy(self, *args) - if self.entInitialized: - self.initGear() - - def setSz(self, *args): - BasicEntities.NodePathEntity.setSz(self, *args) - if self.entInitialized: - self.initGear() + del self.rotateIval \ No newline at end of file diff --git a/toontown/coghq/InGameEditor.py b/toontown/coghq/InGameEditor.py deleted file mode 100644 index 31c21e84..00000000 --- a/toontown/coghq/InGameEditor.py +++ /dev/null @@ -1,1051 +0,0 @@ -from pandac.PandaModules import Point3, Vec3, VBase3 -from direct.tkwidgets.AppShell import * -from direct.showbase.TkGlobal import * -from direct.tkwidgets.Tree import * -from direct.tkwidgets import Slider, Floater -from tkSimpleDialog import askstring -from tkMessageBox import showwarning, askyesno -from Tkinter import * -from direct.showbase.PythonUtil import Functor, list2dict -from direct.gui.DirectGui import DGG -import tkFileDialog -from direct.showbase import DirectObject -import math -import operator -from direct.tkwidgets import Valuator -from direct.tkwidgets import VectorWidgets -from otp.level import LevelConstants -from direct.directtools import DirectSession -import types -import Pmw - -class InGameEditor(AppShell): - appname = 'In-Game Editor' - frameWidth = 900 - frameHeight = 475 - usecommandarea = 1 - usestatusarea = 1 - WantUndo = False - - def __init__(self, level, doneEvent, requestSaveEvent, saveAsEvent, undoEvent, redoEvent, wireframeEvent, oobeEvent, csEvent, runEvent, texEvent, **kw): - DGG.INITOPT = Pmw.INITOPT - optiondefs = (('title', 'In-Game ' + level.getName() + ' Editor', None),) - self.defineoptions(kw, optiondefs) - self.level = level - self.doneEvent = doneEvent - self.requestSaveEvent = requestSaveEvent - self.saveAsEvent = saveAsEvent - self.undoEvent = undoEvent - self.redoEvent = redoEvent - self.wireframeEvent = wireframeEvent - self.oobeEvent = oobeEvent - self.csEvent = csEvent - self.runEvent = runEvent - self.texEvent = texEvent - self.entityCopy = None - self.curEntId = None - self.curEntWidgets = {} - self.visZonesEditor = None - AppShell.__init__(self) - self.initialiseoptions(self.__class__) - self.accept(self.level.getAttribChangeEventName(), self.handleAttribChange) - self.accept('DIRECT_selectedNodePath', self.selectedNodePathHook) - self.accept('DIRECT_manipulateObjectCleanup', self.manipCleanupHook) - self.accept('DIRECT_undo', self.manipCleanupHook) - self.accept('DIRECT_redo', self.manipCleanupHook) - return - - def getEventMsgName(self, event): - return 'InGameEditor%s_%s' % (self.level.getLevelId(), event) - - def getEntityName(self, entId): - return self.level.levelSpec.getEntitySpec(entId)['name'] - - def appInit(self): - from direct.directtools import DirectSession - direct.enableLight() - direct.disable() - bboard.post(DirectSession.DirectSession.DIRECTdisablePost) - - def createMenuBar(self): - menuBar = self.menuBar - menuBar.addmenuitem('File', 'command', 'Save the level spec on the AI', label='Save on AI', command=self.handleRequestSave) - menuBar.addmenuitem('File', 'command', 'Save the level spec locally', label='Save Locally As...', command=self.handleSaveAs) - menuBar.addmenuitem('File', 'separator') - menuBar.addmenuitem('File', 'command', 'Export a single entity', label='Export Entity...', command=self.level.handleExportEntity) - menuBar.addmenuitem('File', 'command', 'Export a tree of entities', label='Export Entity Tree...', command=self.level.handleExportEntityTree) - menuBar.addmenuitem('File', 'separator') - menuBar.addmenuitem('File', 'command', 'Import a tree of entities', label='Import Entities...', command=self.level.handleImportEntities) - menuBar.addmenuitem('File', 'separator') - if InGameEditor.WantUndo: - menuBar.addmenu('Edit', 'Edit Operations') - menuBar.addmenuitem('Edit', 'command', 'Undo the last edit', label='Undo', command=self.doUndo) - menuBar.addmenuitem('Edit', 'command', 'Redo the last undo', label='Redo', command=self.doRedo) - menuBar.addmenu('Entity', 'Entity Operations') - menuBar.addmenuitem('Entity', 'command', 'Duplicate Selected Entity', label='Duplicate Selected Entity', command=self.level.duplicateSelectedEntity) - menuBar.addmenuitem('Entity', 'separator') - permanentTypes = self.level.entTypeReg.getPermanentTypeNames() - entTypes = list(self.level.entTypes) - map(entTypes.remove, permanentTypes) - entTypes.sort() - numEntities = len(entTypes) - cascadeMenu = '' - for index in xrange(numEntities): - type = entTypes[index] - if index % 10 == 0: - lastIndex = min(index + 9, numEntities - 1) - cascadeMenu = '%s->%s' % (entTypes[index], entTypes[lastIndex]) - menuBar.addcascademenu('Entity', cascadeMenu) - - def doInsert(self = self, type = type): - self.level.insertEntity(type) - self.explorer.update(fUseCachedChildren=0) - - menuBar.addmenuitem(cascadeMenu, 'command', 'Insert %s' % type, label='Insert %s' % type, command=doInsert) - - menuBar.addmenuitem('Entity', 'separator') - menuBar.addmenuitem('Entity', 'command', 'Remove Selected Entity', label='Remove Selected Entity', command=self.removeSelectedEntity) - menuBar.addmenuitem('Entity', 'command', 'Remove Selected EntityTree', label='Remove Selected Entity Tree', command=self.removeSelectedEntityTree) - menuBar.addmenuitem('Entity', 'separator') - menuBar.addmenuitem('Entity', 'command', 'Go To Selected Entity', label='Go To Selected Entity', command=self.level.moveAvToSelected) - menuBar.addmenuitem('Entity', 'command', 'Refresh Entity Explorer', label='Refresh Entity Explorer', command=self.refreshExplorer) - self.menuBar.addmenu('DIRECT', 'Direct Session Panel Operations') - self.menuBar.addmenuitem('DIRECT', 'checkbutton', 'DIRECT Enabled', label='Enable', variable=direct.panel.directEnabled, command=direct.panel.toggleDirect) - self.menuBar.addmenuitem('DIRECT', 'checkbutton', 'DIRECT Grid Enabled', label='Enable Grid', variable=direct.panel.directGridEnabled, command=direct.panel.toggleDirectGrid) - self.menuBar.addmenuitem('DIRECT', 'command', 'Toggle Object Handles Visability', label='Toggle Widget Viz', command=direct.toggleWidgetVis) - self.menuBar.addmenuitem('DIRECT', 'command', 'Toggle Widget Move/COA Mode', label='Toggle Widget Mode', command=direct.manipulationControl.toggleObjectHandlesMode) - self.menuBar.addmenuitem('DIRECT', 'checkbutton', 'DIRECT Widget On Top', label='Widget On Top', variable=direct.panel.directWidgetOnTop, command=direct.panel.toggleWidgetOnTop) - self.menuBar.addmenuitem('DIRECT', 'command', 'Deselect All', label='Deselect All', command=direct.deselectAll) - if InGameEditor.WantUndo: - undoFrame = Frame(self.menuFrame) - self.redoButton = Button(undoFrame, text='Redo', command=self.doRedo) - self.redoButton.pack(side=RIGHT, expand=0) - self.undoButton = Button(undoFrame, text='Undo', command=self.doUndo) - self.undoButton.pack(side=RIGHT, expand=0) - undoFrame.pack(side=RIGHT, expand=0) - toggleFrame = Frame(self.menuFrame) - self.wireframeButton = Button(toggleFrame, text='Wire', command=self.doWireframe) - self.wireframeButton.pack(side=RIGHT, expand=0) - self.texButton = Button(toggleFrame, text='Tex', command=self.doTex) - self.texButton.pack(side=RIGHT, expand=0) - self.csButton = Button(toggleFrame, text='Cs', command=self.doCs) - self.csButton.pack(side=RIGHT, expand=0) - self.runButton = Button(toggleFrame, text='Run', command=self.doRun) - self.runButton.pack(side=RIGHT, expand=0) - self.oobeButton = Button(toggleFrame, text='Oobe', command=self.doOobe) - self.oobeButton.pack(side=RIGHT, expand=0) - toggleFrame.pack(side=RIGHT, expand=0, padx=5) - AppShell.createMenuBar(self) - - def createInterface(self): - interior = self.interior() - mainFrame = Frame(interior) - self.framePane = Pmw.PanedWidget(mainFrame, orient=DGG.HORIZONTAL) - self.explorerFrame = self.framePane.add('left', min=250) - self.widgetFrame = self.framePane.add('right', min=300) - self.explorer = LevelExplorer(parent=self.explorerFrame, editor=self) - self.explorer.pack(fill=BOTH, expand=1) - self.explorerFrame.pack(fill=BOTH, expand=1) - self.pageOneFrame = Pmw.ScrolledFrame(self.widgetFrame, borderframe_relief=GROOVE, horizflex='elastic') - self.pageOneFrame.pack(expand=1, fill=BOTH) - self.widgetFrame.pack(fill=BOTH, expand=1) - self.framePane.pack(fill=BOTH, expand=1) - mainFrame.pack(fill=BOTH, expand=1) - self.createButtons() - self.initialiseoptions(self.__class__) - self.attribWidgets = [] - - def selectedNodePathHook(self, nodePath): - np = nodePath.findNetTag('entity') - if not np.isEmpty(): - if np.get_key() != nodePath.get_key(): - np.select() - else: - self.findEntityFromNP(np) - - def findEntityFromNP(self, nodePath): - entId = self.level.nodePathId2EntId.get(nodePath.get_key()) - if entId: - self.selectEntity(entId) - else: - for entId in self.level.levelSpec.getAllEntIds(): - np = self.level.getEntInstanceNP(entId) - if np: - if np.get_key() == nodePath.get_key(): - self.selectEntity(entId) - return - - def manipCleanupHook(self, nodePathList): - if not nodePathList: - return - entId = self.level.nodePathId2EntId.get(nodePathList[0].get_key()) - if entId: - t = nodePathList[0].getTransform() - entSpec = self.level.levelSpec.getEntitySpec(entId) - entPos = entSpec.get('pos') - if entPos and t.getPos() != entPos: - self.level.setAttribEdit(entId, 'pos', Point3(t.getPos())) - entHpr = entSpec.get('hpr') - if entHpr and t.getHpr() != entHpr: - self.level.setAttribEdit(entId, 'hpr', Vec3(t.getHpr())) - entScale = entSpec.get('scale') - if entScale and t.getScale() != entScale: - self.level.setAttribEdit(entId, 'scale', Vec3(t.getScale())) - - def refreshExplorer(self): - self.explorer.update() - - def selectEntity(self, entId): - node = self.explorer._node.find(entId) - if node: - node.reveal() - self.explorer._node.deselecttree() - node.select() - - def removeSelectedEntity(self): - if self.level.selectedEntity: - parentEntId = self.level.selectedEntity.parentEntId - else: - parentEntId = None - if self.level.removeSelectedEntity() != -1: - self.explorer.update(fUseCachedChildren=0) - if parentEntId: - self.selectEntity(parentEntId) - return - - def removeSelectedEntityTree(self): - if self.level.selectedEntity: - parentEntId = self.level.selectedEntity.parentEntId - else: - parentEntId = None - if self.level.removeSelectedEntityTree() != -1: - self.explorer.update(fUseCachedChildren=0) - if parentEntId: - self.selectEntity(parentEntId) - return - - def clearAttribEditPane(self): - for widg in self.attribWidgets: - widg.destroy() - - if self.visZonesEditor: - self.visZonesEditor.destroy() - self.attribWidgets = [] - self.curEntId = None - self.curEntWidgets = {} - self.cbDict = {} - return - - def updateEntityCopy(self, entId): - if self.entityCopy == None: - self.entityCopy = self.level.getEntInstanceNPCopy(entId) - if self.entityCopy is not None: - self.entityCopy.setRenderModeWireframe() - self.entityCopy.setTextureOff(1) - self.entityCopy.setColor(1, 0, 0) - return - - def updateAttribEditPane(self, entId, levelSpec, entTypeReg): - self.clearAttribEditPane() - self.curEntId = entId - widgetSetter = None - entSpec = levelSpec.getEntitySpec(entId) - typeDesc = entTypeReg.getTypeDesc(entSpec['type']) - attribNames = typeDesc.getAttribNames() - attribDescs = typeDesc.getAttribDescDict() - for attribName in attribNames: - desc = attribDescs[attribName] - params = desc.getParams() - datatype = desc.getDatatype() - if datatype == 'int': - self.addIntWidget(levelSpec, entSpec, entId, attribName, params) - elif datatype == 'float': - self.addFloatWidget(levelSpec, entSpec, entId, attribName, params) - elif datatype == 'bool': - self.addBoolWidget(levelSpec, entSpec, entId, attribName, params) - elif datatype == 'choice': - self.addChoiceWidget(levelSpec, entSpec, entId, attribName, params) - elif datatype == 'multiChoice': - self.addMultiChoiceWidget(levelSpec, entSpec, entId, attribName, params) - elif datatype in ['pos', 'hpr', 'scale']: - self.addVec3Widget(levelSpec, entSpec, entId, attribName, params, datatype) - elif datatype == 'color': - self.addColorWidget(levelSpec, entSpec, entId, attribName, params) - elif datatype == 'bamfilename': - self.addFileWidget(levelSpec, entSpec, entId, attribName, params) - elif datatype == 'visZoneList': - self.addVisZoneWidget(levelSpec, entSpec, entId, attribName, params) - elif datatype == 'entId': - self.addEntIdWidget(levelSpec, entSpec, entId, attribName, params, entTypeReg) - elif datatype == 'string': - self.addStringWidget(levelSpec, entSpec, entId, attribName, params) - elif datatype == 'const': - self.addConstWidget(levelSpec, entSpec, entId, attribName, params) - else: - self.addPythonWidget(levelSpec, entSpec, entId, attribName, params) - - return - - def addIntWidget(self, levelSpec, entSpec, entId, attribName, params): - minVal = params.get('min', None) - maxVal = params.get('max', None) - if minVal is not None and maxVal is not None: - widgClass = Slider.Slider - else: - widgClass = Floater.Floater - widg = widgClass(self.pageOneFrame.interior(), text=attribName, value=entSpec[attribName], numDigits=0, label_width=15, label_anchor=W, label_justify=LEFT, label_font=None, min=minVal, max=maxVal, resolution=1.0) - - def clientIntCommand(val): - entity = self.level.getEntInstance(entId) - if entity: - entity.handleAttribChange(attribName, int(val)) - - def finalIntCommand(): - self.level.setAttribEdit(entId, attribName, int(widg.get())) - - widg['command'] = clientIntCommand - widg['postCallback'] = finalIntCommand - widg.pack(fill=X, expand=1) - self.attribWidgets.append(widg) - self.curEntWidgets[attribName] = lambda x: widg.set(x, 0) - return - - def addFloatWidget(self, levelSpec, entSpec, entId, attribName, params): - minVal = params.get('min', None) - maxVal = params.get('max', None) - widg = Floater.Floater(self.pageOneFrame.interior(), text=attribName, value=entSpec[attribName], label_width=15, label_anchor=W, label_justify=LEFT, label_font=None, min=minVal, max=maxVal) - - def clientFloatCommand(val): - entity = self.level.getEntInstance(entId) - if entity: - entity.handleAttribChange(attribName, val) - - def finalFloatCommand(): - self.level.setAttribEdit(entId, attribName, widg.get()) - - widg['command'] = clientFloatCommand - widg['postCallback'] = finalFloatCommand - widg.pack(fill=X, expand=1) - self.attribWidgets.append(widg) - self.curEntWidgets[attribName] = lambda x: widg.set(x, 0) - return - - def addBoolWidget(self, levelSpec, entSpec, entId, attribName, params): - flag = BooleanVar() - flag.set(entSpec[attribName]) - - def booleanCommand(booleanVar = flag): - self.level.setAttribEdit(entId, attribName, flag.get()) - - frame = Frame(self.pageOneFrame.interior()) - label = Label(frame, text=attribName, width=15, anchor=W, justify=LEFT) - label.pack(side=LEFT, expand=0) - trueButton = Radiobutton(frame, text='True', value=1, variable=flag, command=booleanCommand) - trueButton.pack(side=LEFT, expand=0) - falseButton = Radiobutton(frame, text='False', value=0, variable=flag, command=booleanCommand) - falseButton.pack(side=LEFT, expand=0) - frame.pack(fill=X, expand=1) - self.attribWidgets.append(frame) - self.curEntWidgets[attribName] = flag.set - - def addChoiceWidget(self, levelSpec, entSpec, entId, attribName, params): - if attribName in entSpec: - attributeValue = entSpec.get(attribName) - else: - typeDesc = self.level.entTypeReg.getTypeDesc(entSpec['type']) - attribDesc = typeDesc.getAttribDescDict()[attribName] - attributeValue = attribDesc.getDefaultValue() - valueDict = params.get('valueDict', {}) - for key, value in valueDict.items(): - if value == attributeValue: - attributeValue = key - break - - radioVar = StringVar() - radioVar.set(attributeValue) - - def radioCommand(radioVar = radioVar): - value = valueDict.get(radioVar.get(), radioVar.get()) - self.level.setAttribEdit(entId, attribName, value) - - frame = Frame(self.pageOneFrame.interior(), relief=GROOVE, borderwidth=2) - label = Label(frame, text=attribName, width=15, anchor=W, justify=LEFT) - label.pack(side=LEFT, expand=0) - for choice in params.get('choiceSet', []): - if type(choice) is types.StringType: - choiceStr = choice - else: - choiceStr = `choice` - if choiceStr not in valueDict: - valueDict[choiceStr] = choice - choiceButton = Radiobutton(frame, text=choiceStr, value=choiceStr, variable=radioVar, command=radioCommand) - choiceButton.pack(side=LEFT, expand=0) - - frame.pack(fill=X, expand=1) - self.attribWidgets.append(frame) - - def setRadioVar(attributeValue): - for key, value in valueDict.items(): - if value == attributeValue: - attributeValue = key - break - - radioVar.set(attributeValue) - - self.curEntWidgets[attribName] = setRadioVar - - def addMultiChoiceWidget(self, levelSpec, entSpec, entId, attribName, params): - frame = Frame(self.pageOneFrame.interior(), relief=GROOVE, borderwidth=2) - label = Label(frame, text=attribName, width=15, anchor=W, justify=LEFT) - label.pack(side=LEFT, expand=0) - valueDict = params.get('valueDict', {}) - self.cbDict[attribName] = list2dict(entSpec[attribName], value=1) - checkbuttonDict = {} - base.cbButtons = [] - base.checkbuttonDict = checkbuttonDict - for choice in params.get('choiceSet', []): - trueValue = valueDict.get(choice, choice) - cbVar = IntVar() - cbVar.set(trueValue in self.cbDict[attribName]) - checkbuttonDict[trueValue] = cbVar - - def cbCommand(var, trueValue = trueValue): - vd = self.cbDict[attribName] - print vd - if var.get(): - print 'got it', trueValue, vd - vd[trueValue] = 1 - else: - print 'not it', trueValue, vd - if trueValue in vd: - del vd[trueValue] - value = vd.keys() - print 'SENDING', value - self.level.setAttribEdit(entId, attribName, value) - - if type(choice) is types.StringType: - labelStr = choice - else: - labelStr = `choice` - func = Functor(cbCommand, cbVar) - choiceButton = Checkbutton(frame, text=labelStr, variable=cbVar, command=lambda : func()) - choiceButton.pack(side=LEFT, expand=0) - base.cbButtons.append(choiceButton) - - frame.pack(fill=X, expand=1) - self.attribWidgets.append(frame) - - def setCheckbuttonVar(attributeValueList): - print 'COMING BACK', attributeValueList - for attributeValue, cb in checkbuttonDict.items(): - if attributeValue in attributeValueList: - cb.set(1) - else: - cb.set(0) - - self.curEntWidgets[attribName] = setCheckbuttonVar - - def addVec3Widget(self, levelSpec, entSpec, entId, attribName, params, datatype): - - def veCommand(poslist): - self.level.setAttribEdit(entId, attribName, Point3(*poslist)) - - vec = entSpec[attribName] - if not isinstance(vec, VBase3): - vec = Vec3(vec) - value = [vec[0], vec[1], vec[2]] - minVal = maxVal = None - if datatype == 'pos': - floaterLabels = ['x', 'y', 'z'] - floaterType = 'floater' - elif datatype == 'hpr': - floaterLabels = ['h', 'p', 'r'] - floaterType = 'angledial' - else: - floaterLabels = ['sx', 'sy', 'sz'] - floaterType = 'slider' - minVal = 0 - maxVal = 1000 - widg = VectorWidgets.VectorEntry(self.pageOneFrame.interior(), text=attribName, value=value, type=floaterType, bd=0, relief=None, min=minVal, max=maxVal, label_justify=LEFT, label_anchor=W, label_width=14, label_bd=0, labelIpadx=0, floaterGroup_labels=floaterLabels) - widg['command'] = veCommand - widg.pack(fill=X, expand=1) - if attribName in ('pos', 'hpr', 'scale'): - - def placeEntity(): - selectedEntityNP = self.level.getEntInstanceNP(entId) - if selectedEntityNP is not None: - selectedEntityNP.place() - return - - widg.menu.add_command(label='Place...', command=placeEntity) - - def adjustCopy(vec): - self.updateEntityCopy(entId) - if self.entityCopy is not None: - if datatype == 'pos': - self.entityCopy.setPos(vec[0], vec[1], vec[2]) - elif datatype == 'hpr': - self.entityCopy.setHpr(vec[0], vec[1], vec[2]) - elif datatype == 'scale': - self.entityCopy.setScale(vec[0], vec[1], vec[2]) - widg.set(vec, 0) - return - - widg._floaters['command'] = adjustCopy - widg._floaters.component('valuatorGroup')['postCallback'] = lambda x, y, z: veCommand([x, y, z]) - self.attribWidgets.append(widg) - self.curEntWidgets[attribName] = lambda x: widg.set(x, 0) - return - - def addColorWidget(self, levelSpec, entSpec, entId, attribName, params): - - def veCommand(colorlist): - self.level.setAttribEdit(entId, attribName, Vec4(*colorlist) / 255.0) - - vec = entSpec[attribName] - value = [vec[0] * 255.0, - vec[1] * 255.0, - vec[2] * 255.0, - vec[3] * 255.0] - floaterLabels = ['r', - 'g', - 'b', - 'a'] - widg = VectorWidgets.ColorEntry(self.pageOneFrame.interior(), text=attribName, type='slider', relief=None, bd=0, label_justify=LEFT, label_anchor=W, label_width=14, label_bd=0, labelIpadx=0, floaterGroup_labels=floaterLabels, value=value, floaterGroup_value=value) - widg['command'] = veCommand - widg.pack(fill=X, expand=1) - - def adjustEntity(vec): - entity = self.level.getEntInstance(entId) - if entity is not None: - entity.setColor(vec[0] / 255.0, vec[1] / 255.0, vec[2] / 255.0, vec[3] / 255.0) - widg.set(vec, 0) - return - - widg._floaters['command'] = adjustEntity - widg._floaters.component('valuatorGroup')['postCallback'] = lambda x, y, z, a: veCommand([x, - y, - z, - a]) - self.attribWidgets.append(widg) - self.curEntWidgets[attribName] = lambda x: widg.set(x * 255.0, 0) - return - - def addFileWidget(self, levelSpec, entSpec, entId, attribName, params): - text = StringVar() - text.set(repr(entSpec[attribName])) - - def handleReturn(event): - self.handleAttributeChangeSubmit(attribName, text, entId, levelSpec) - - def askFilename(callback = handleReturn): - if text.get() == 'None': - initialDir = Filename.expandFrom('$TTMODELS/built/').toOsSpecific() - else: - initialDir = Filename.expandFrom('$TTMODELS/built/%s' % text.get()[1:-1]).toOsSpecific() - print text, text.get()[1:-1], initialDir - rawFilename = askopenfilename(defaultextension='*', initialdir=initialDir, filetypes=(('Bam Files', '*.bam'), - ('Egg Files', '*.egg'), - ('Maya Binaries', '*.mb'), - ('All files', '*')), title='Load Model File', parent=self.interior()) - if rawFilename != '': - filename = Filename.fromOsSpecific(rawFilename) - filename.findOnSearchpath(getModelPath().getValue()) - text.set("'%s'" % `filename`) - handleReturn(None) - return - - frame = Frame(self.pageOneFrame.interior()) - label = Button(frame, text=attribName, width=14, borderwidth=0, anchor=W, justify=LEFT) - label['command'] = askFilename - label.pack(side=LEFT, expand=0) - - def enterWidget(event, widg = label): - widg['background'] = '#909090' - - def leaveWidget(event, widg = label): - widg['background'] = 'SystemButtonFace' - - label.bind('', enterWidget) - label.bind('', leaveWidget) - widg = Entry(frame, textvariable=text) - widg.bind('', handleReturn) - widg.pack(side=LEFT, fill=X, expand=1) - frame.pack(fill=X, expand=1) - self.attribWidgets.append(frame) - self.curEntWidgets[attribName] = lambda x: text.set(repr(x)) - - def addVisZoneWidget(self, levelSpec, entSpec, entId, attribName, params): - text = StringVar() - text.set(repr(entSpec[attribName])) - - def handleReturn(event): - self.handleAttributeChangeSubmit(attribName, text, entId, levelSpec) - - def handleUpdate(visZoneList): - self.level.setAttribEdit(entId, attribName, visZoneList) - - def getZoneList(callback = handleReturn): - zoneEntIds = list(self.level.entType2ids['zone']) - zoneEntIds.remove(LevelConstants.UberZoneEntId) - zoneEntIds.sort() - self.visZonesEditor = LevelVisZonesEditor(self, entId, entSpec[attribName], modelZones=zoneEntIds, updateCommand=handleUpdate) - - frame = Frame(self.pageOneFrame.interior()) - label = Button(frame, text=attribName, width=14, borderwidth=0, anchor=W, justify=LEFT) - label['command'] = getZoneList - label.pack(side=LEFT, expand=0) - - def enterWidget(event, widg = label): - widg['background'] = '#909090' - - def leaveWidget(event, widg = label): - widg['background'] = 'SystemButtonFace' - - label.bind('', enterWidget) - label.bind('', leaveWidget) - widg = Entry(frame, textvariable=text) - widg.bind('', handleReturn) - widg.pack(side=LEFT, fill=X, expand=1) - frame.pack(fill=X, expand=1) - self.attribWidgets.append(frame) - - def refreshWidget(visZoneList): - text.set(repr(visZoneList)) - if self.visZonesEditor: - self.visZonesEditor.setVisible(visZoneList) - - self.curEntWidgets[attribName] = refreshWidget - - def addEntIdWidget(self, levelSpec, entSpec, entId, attribName, params, entTypeReg): - text = StringVar() - text.set(repr(entSpec[attribName])) - - def handleReturn(event): - self.handleAttributeChangeSubmit(attribName, text, entId, levelSpec) - - def handleMenu(id): - text.set(id) - self.level.setAttribEdit(entId, attribName, id) - - frame = Frame(self.pageOneFrame.interior()) - label = Label(frame, text=attribName, width=15, anchor=W, justify=LEFT) - label.pack(side=LEFT, expand=0) - widg = Entry(frame, textvariable=text) - widg.bind('', handleReturn) - widg.pack(side=LEFT, fill=X, expand=1) - if attribName is 'parentEntId': - buttonText = 'Reparent To' - else: - buttonText = 'Select Entity' - entButton = Menubutton(frame, width=8, text=buttonText, relief=RAISED, borderwidth=2) - entMenu = Menu(entButton, tearoff=0) - entButton['menu'] = entMenu - entButton.pack(side=LEFT, fill='x', expand=1) - entType = params.get('type') - entOutput = params.get('output') - idDict = {} - if entType == 'grid': - for eType in entTypeReg.getDerivedTypeNames('grid'): - idDict[eType] = self.level.entType2ids.get(eType, []) - - elif entType == 'nodepath': - for eType in entTypeReg.getDerivedTypeNames('nodepath'): - idDict[eType] = self.level.entType2ids.get(eType, []) - - elif entOutput == 'bool': - for eType in entTypeReg.getTypeNamesFromOutputType('bool'): - idDict[eType] = self.level.entType2ids.get(eType, []) - - else: - for eType in self.level.entType2ids.keys(): - idDict[eType] = self.level.entType2ids.get(eType, []) - - typeKeys = idDict.keys() - typeKeys.sort() - - def getChildEntIds(entity): - entIds = [] - for child in entity.getChildren(): - entIds.append(child.entId) - entIds.extend(getChildEntIds(child)) - - return entIds - - thisEntity = self.level.getEntity(entId) - forbiddenEntIds = [entId, thisEntity.parentEntId] - forbiddenEntIds.extend(getChildEntIds(thisEntity)) - for eType in typeKeys: - idList = list(idDict[eType]) - for forbiddenId in forbiddenEntIds: - if forbiddenId in idList: - idList.remove(forbiddenId) - - if len(idList) == 0: - continue - subMenu = Menu(entMenu, tearoff=0) - entMenu.add_cascade(label=eType, menu=subMenu) - idList.sort() - numIds = len(idList) - idIndex = 0 - for id in idList: - if idIndex % 10 == 0: - if numIds > 10: - m = Menu(subMenu, tearoff=0) - firstId = idList[idIndex] - lastIndex = min(idIndex + 9, numIds - 1) - lastId = idList[lastIndex] - subMenu.add_cascade(label='Ids %d-%d' % (firstId, lastId), menu=m) - else: - m = subMenu - m.add_command(label='%d: %s' % (id, self.getEntityName(id)), command=lambda id = id, h = handleMenu: h(id)) - idIndex += 1 - - frame.pack(fill=X, expand=1) - self.attribWidgets.append(frame) - self.curEntWidgets[attribName] = text.set - - def addStringWidget(self, levelSpec, entSpec, entId, attribName, params): - text = StringVar() - text.set(str(entSpec[attribName])) - - def handleReturn(event): - self.level.setAttribEdit(entId, attribName, text.get()) - - frame = Frame(self.pageOneFrame.interior()) - label = Label(frame, text=attribName, width=15, anchor=W, justify=LEFT) - label.pack(side=LEFT, expand=0) - widg = Entry(frame, textvariable=text) - widg.bind('', handleReturn) - widg.pack(side=LEFT, fill=X, expand=1) - frame.pack(fill=X, expand=1) - self.attribWidgets.append(frame) - self.curEntWidgets[attribName] = text.set - - def addConstWidget(self, levelSpec, entSpec, entId, attribName, params): - frame = Frame(self.pageOneFrame.interior()) - label = Label(frame, text=attribName, width=15, anchor=W, justify=LEFT) - label.pack(side=LEFT, expand=0) - text = str(entSpec[attribName]) - valueLabel = Label(frame, text=text, anchor=W, justify=LEFT, relief=GROOVE) - valueLabel.pack(side=LEFT, fill=X, expand=1) - frame.pack(fill=X, expand=1) - self.attribWidgets.append(frame) - - def addPythonWidget(self, levelSpec, entSpec, entId, attribName, params): - text = StringVar() - text.set(repr(entSpec[attribName])) - - def handleReturn(event): - self.handleAttributeChangeSubmit(attribName, text, entId, levelSpec) - - frame = Frame(self.pageOneFrame.interior()) - label = Label(frame, text=attribName, width=15, anchor=W, justify=LEFT) - label.pack(side=LEFT, expand=0) - widg = Entry(frame, textvariable=text) - widg.bind('', handleReturn) - widg.pack(side=LEFT, fill=X, expand=1) - frame.pack(fill=X, expand=1) - self.attribWidgets.append(frame) - self.curEntWidgets[attribName] = lambda x: text.set(repr(x)) - - def handleAttributeChangeSubmit(self, attribName, textObj, entId, levelSpec): - newText = textObj.get() - try: - value = eval(newText) - except: - showwarning('ERROR', 'that is not a valid Python object', parent=self.parent) - return - - self.level.setAttribEdit(entId, attribName, value) - - def handleAttribChange(self, entId, attribName, value, username): - if username == self.level.editUsername: - if self.entityCopy: - self.entityCopy.removeNode() - self.entityCopy = None - if entId == self.curEntId: - widgetSetter = self.curEntWidgets[attribName] - if widgetSetter is not None: - widgetSetter(value) - return - - def createButtons(self): - pass - - def toggleBalloon(self): - if self.toggleBalloonVar.get(): - self.balloon().configure(state='both') - else: - self.balloon().configure(state='none') - - def onDestroy(self, event): - from direct.directtools import DirectSession - direct.disable() - bboard.remove(DirectSession.DirectSession.DIRECTdisablePost) - self.ignore(self.level.getAttribChangeEventName()) - self.ignore('DIRECT_selectedNodePath') - self.ignore('DIRECT_manipulateObjectCleanup') - self.ignore('DIRECT_undo') - self.ignore('DIRECT_redo') - print 'InGameEditor.onDestroy()' - if self.visZonesEditor: - self.visZonesEditor.destroy() - self.explorer._node.destroy() - del self.level - messenger.send(self.doneEvent) - - def handleRequestSave(self): - messenger.send(self.requestSaveEvent) - - def handleSaveAs(self): - filename = tkFileDialog.asksaveasfilename(parent=self.parent, defaultextension='.py', filetypes=[('Python Source Files', '.py'), ('All Files', '*')]) - if len(filename) > 0: - messenger.send(self.saveAsEvent, [filename]) - - def doUndo(self): - messenger.send(self.undoEvent) - - def doRedo(self): - messenger.send(self.redoEvent) - - def doWireframe(self): - messenger.send(self.wireframeEvent) - - def doOobe(self): - messenger.send(self.oobeEvent) - - def doCs(self): - messenger.send(self.csEvent) - - def doRun(self): - messenger.send(self.runEvent) - - def doTex(self): - messenger.send(self.texEvent) - - def resetLevel(self): - self.showTodo(what='resetLevel') - - def showTodo(self, what = ''): - self.showWarning('%s\nThis is not yet implemented.' % what, 'TODO') - - def showWarning(self, msg, title = 'Warning'): - showwarning(title, msg, parent=self.parent) - - def askYesNo(self, msg, title = 'Query'): - return askyesno(title, msg, parent=self.parent) - - def popupLevelDialog(self): - data = askstring('Input Level Data', 'Level Data:', parent=self) - if data: - self.messageBar().helpmessage(data) - - -class LevelVisZonesEditor(Pmw.MegaToplevel): - - def __init__(self, editor, entId, visible, modelZones = [], updateCommand = None, parent = None, **kw): - DGG.INITOPT = Pmw_INITOPT - optiondefs = (('title', 'Level Vis-Zone Editor', None),) - self.defineoptions(kw, optiondefs) - Pmw.MegaToplevel.__init__(self, parent, title=self['title']) - self.editor = editor - self.entId = entId - self.modelZones = modelZones - self.modelZones.sort() - self.updateCommand = updateCommand - hull = self.component('hull') - balloon = self.balloon = Pmw.Balloon(hull) - self.balloon.configure(state='none') - menuFrame = Frame(hull, relief=GROOVE, bd=2) - menuFrame.pack(fill=X, expand=1) - menuBar = Pmw.MenuBar(menuFrame, hotkeys=1, balloon=balloon) - menuBar.pack(side=LEFT, expand=1, fill=X) - menuBar.addmenu('Vis Zones Editor', 'Visability Zones Editor Operations') - menuBar.addmenuitem('Vis Zones Editor', 'command', 'Exit Visability Zones Editor', label='Exit', command=self.destroy) - menuBar.addmenu('Help', 'Visibility Zones Editor Help Operations') - self.toggleBalloonVar = IntVar() - self.toggleBalloonVar.set(0) - menuBar.addmenuitem('Help', 'checkbutton', 'Toggle balloon help', label='Balloon Help', variable=self.toggleBalloonVar, command=self.toggleBalloon) - sf = Pmw.ScrolledFrame(hull, horizflex='elastic', usehullsize=1, hull_width=200, hull_height=400) - frame = sf.interior() - sf.pack(padx=5, pady=3, fill=BOTH, expand=1) - self.radioSelect = Pmw.RadioSelect(frame, selectmode=MULTIPLE, orient=DGG.VERTICAL, pady=0, command=self.toggleVisZone) - self.buttons = [] - for modelZoneNum in self.modelZones: - buttonStr = '%d - %s' % (modelZoneNum, self.editor.getEntityName(modelZoneNum)) - button = self.radioSelect.add(buttonStr, width=12) - button.configure(anchor=W, justify=LEFT) - self.buttons.append(button) - - self.radioSelect.pack(expand=1, fill=X) - sf.reposition() - buttonFrame = Frame(hull) - self.showMode = IntVar() - self.showMode.set(self.editor.level.level.getColorZones()) - self.showActiveButton = Radiobutton(buttonFrame, text='Stash Invisible', value=0, indicatoron=1, variable=self.showMode, command=self.setVisRenderMode) - self.showActiveButton.pack(side=LEFT, fill=X, expand=1) - self.showAllButton = Radiobutton(buttonFrame, text='Color Invisible', value=1, indicatoron=1, variable=self.showMode, command=self.setVisRenderMode) - self.showAllButton.pack(side=LEFT, fill=X, expand=1) - buttonFrame.pack(fill=X, expand=1) - self.initialiseoptions(LevelVisZonesEditor) - self.setVisible(visible) - return None - - def toggleVisZone(self, zoneStr, state): - zoneNum = int(zoneStr.split('-')[0]) - if state == 0: - if zoneNum in self.visible: - self.visible.remove(zoneNum) - elif zoneNum not in self.visible: - self.visible.append(zoneNum) - self.visible.sort() - if self.updateCommand: - self.updateCommand(self.visible) - - def setVisible(self, visible): - self.visible = visible - self.refreshVisibility() - - def setVisRenderMode(self): - self.editor.level.level.setColorZones(self.showMode.get()) - - def refreshVisibility(self): - self.radioSelect.selection = [] - for button in self.buttons: - componentName = button['text'] - modelZone = int(componentName.split('-')[0]) - if modelZone in self.visible: - button.configure(relief='sunken') - self.radioSelect.selection.append(componentName) - else: - button.configure(relief='raised') - - def destroy(self): - self.editor.visZonesEditor = None - Pmw.MegaToplevel.destroy(self) - return - - def toggleBalloon(self): - if self.toggleBalloonVar.get(): - self.balloon.configure(state='balloon') - else: - self.balloon.configure(state='none') - - -DEFAULT_MENU_ITEMS = ['Update Explorer', - 'Separator', - 'Select', - 'Deselect', - 'Separator', - 'Delete', - 'Separator', - 'Fit', - 'Flash', - 'Isolate', - 'Toggle Vis', - 'Show All', - 'Separator', - 'Set Reparent Target', - 'Reparent', - 'WRT Reparent', - 'Separator', - 'Place', - 'Set Name', - 'Set Color', - 'Explore', - 'Separator'] - -class LevelExplorer(Pmw.MegaWidget, DirectObject.DirectObject): - - def __init__(self, parent = None, editor = None, **kw): - optiondefs = (('menuItems', [], Pmw.INITOPT),) - self.defineoptions(kw, optiondefs) - Pmw.MegaWidget.__init__(self, parent) - self.editor = editor - interior = self.interior() - interior.configure(relief=GROOVE, borderwidth=2) - self._scrolledCanvas = self.createcomponent('scrolledCanvas', (), None, Pmw.ScrolledCanvas, (interior,), hull_width=300, hull_height=80, usehullsize=1) - self._canvas = self._scrolledCanvas.component('canvas') - self._canvas['scrollregion'] = ('0i', '0i', '2i', '4i') - self._scrolledCanvas.resizescrollregion() - self._scrolledCanvas.pack(padx=3, pady=3, expand=1, fill=BOTH) - self._canvas.bind('', self.mouse2Down) - self._canvas.bind('', self.mouse2Motion) - self._canvas.bind('', lambda e, sc = self._scrolledCanvas: sc.resizescrollregion()) - self.interior().bind('', self.onDestroy) - self._treeItem = LevelExplorerItem(self.editor.level, self.editor) - self._node = TreeNode(self._canvas, None, self._treeItem, DEFAULT_MENU_ITEMS + self['menuItems']) - self._node.expand() - self._parentFrame = Frame(interior) - self.accept('Level_Update Explorer', lambda f, s = self: s.update()) - self.initialiseoptions(LevelExplorer) - return - - def update(self, fUseCachedChildren = 1): - self._node.update(fUseCachedChildren) - self._node.expand() - - def mouse2Down(self, event): - self._width = 1.0 * self._canvas.winfo_width() - self._height = 1.0 * self._canvas.winfo_height() - xview = self._canvas.xview() - yview = self._canvas.yview() - self._left = xview[0] - self._top = yview[0] - self._dxview = xview[1] - xview[0] - self._dyview = yview[1] - yview[0] - self._2lx = event.x - self._2ly = event.y - - def mouse2Motion(self, event): - newx = self._left - (event.x - self._2lx) / self._width * self._dxview - self._canvas.xview_moveto(newx) - newy = self._top - (event.y - self._2ly) / self._height * self._dyview - self._canvas.yview_moveto(newy) - self._2lx = event.x - self._2ly = event.y - self._left = self._canvas.xview()[0] - self._top = self._canvas.yview()[0] - - def onDestroy(self, event): - self.ignore('Level_Update Explorer') - - -class LevelExplorerItem(TreeItem): - - def __init__(self, levelElement, editor): - self.levelElement = levelElement - self.editor = editor - - def GetText(self): - return self.levelElement.getName() - - def GetKey(self): - return self.levelElement.get_key() - - def IsEditable(self): - return 1 - - def SetText(self, text): - self.levelElement.setNewName(text) - - def GetIconName(self): - return 'sphere2' - - def IsExpandable(self): - return self.levelElement.getNumChildren() != 0 - - def GetSubList(self): - sublist = [] - for element in self.levelElement.getChildren(): - item = LevelExplorerItem(element, self.editor) - sublist.append(item) - - return sublist - - def OnSelect(self): - messenger.send(self.editor.getEventMsgName('Select'), [self.levelElement]) - - def MenuCommand(self, command): - messenger.send(self.editor.getEventMsgName(command), [self.levelElement]) diff --git a/toontown/coghq/InGameEditorDCImports.py b/toontown/coghq/InGameEditorDCImports.py deleted file mode 100644 index fd5f7500..00000000 --- a/toontown/coghq/InGameEditorDCImports.py +++ /dev/null @@ -1,3 +0,0 @@ -if __dev__: - from direct.directutil import DistributedLargeBlobSender - import DistributedInGameEditor diff --git a/toontown/coghq/InGameEditorDCImportsAI.py b/toontown/coghq/InGameEditorDCImportsAI.py deleted file mode 100644 index 9ce09416..00000000 --- a/toontown/coghq/InGameEditorDCImportsAI.py +++ /dev/null @@ -1,3 +0,0 @@ -if __dev__: - from direct.directutil import DistributedLargeBlobSenderAI - import DistributedInGameEditorAI diff --git a/toontown/coghq/InGameEditorElements.py b/toontown/coghq/InGameEditorElements.py deleted file mode 100644 index 73cba9f6..00000000 --- a/toontown/coghq/InGameEditorElements.py +++ /dev/null @@ -1,37 +0,0 @@ -from direct.showbase import DirectObject - -class InGameEditorElement(DirectObject.DirectObject): - elementId = 0 - - def __init__(self, children = []): - self.elementId = InGameEditorElement.elementId - InGameEditorElement.elementId += 1 - self.setChildren(children) - self.feName = self.getTypeName() - - def getName(self): - return self.feName - - def setNewName(self, newName): - self.feName = newName - - def getTypeName(self): - return 'Level Element' - - def id(self): - return self.elementId - - def getChildren(self): - return self.children - - def setChildren(self, children): - self.children = list(children) - - def addChild(self, child): - self.children.append(child) - - def removeChild(self, child): - self.children.remove(child) - - def getNumChildren(self): - return len(self.children) diff --git a/toontown/coghq/LawOfficeBase.py b/toontown/coghq/LawOfficeBase.py index 9252a004..768d80c1 100644 --- a/toontown/coghq/LawOfficeBase.py +++ b/toontown/coghq/LawOfficeBase.py @@ -16,12 +16,4 @@ class LawOfficeBase: return self.cogTrack def getFactoryType(self): - return self.factoryType - - if __dev__: - - def getEntityTypeReg(self): - import FactoryEntityTypes - from otp.level import EntityTypeRegistry - typeReg = EntityTypeRegistry.EntityTypeRegistry(FactoryEntityTypes) - return typeReg + return self.factoryType \ No newline at end of file diff --git a/toontown/coghq/LawOffice_Spec_Tier0_a.py b/toontown/coghq/LawOffice_Spec_Tier0_a.py index a9f64577..853b8df6 100644 --- a/toontown/coghq/LawOffice_Spec_Tier0_a.py +++ b/toontown/coghq/LawOffice_Spec_Tier0_a.py @@ -11,14 +11,6 @@ GlobalEntities = { 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/lawbotHQ/LawbotCourtroom3', 'wantDoors': 1 }, - 1001: { - 'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None }, 0: { 'type': 'zone', 'name': 'UberZone', diff --git a/toontown/coghq/LawOffice_Spec_Tier0_b.py b/toontown/coghq/LawOffice_Spec_Tier0_b.py index ff4748c9..ea9296be 100644 --- a/toontown/coghq/LawOffice_Spec_Tier0_b.py +++ b/toontown/coghq/LawOffice_Spec_Tier0_b.py @@ -11,14 +11,6 @@ GlobalEntities = { 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/lawbotHQ/LawbotCourtroom3', 'wantDoors': 1 }, - 1001: { - 'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None }, 0: { 'type': 'zone', 'name': 'UberZone', diff --git a/toontown/coghq/LawbotLegFactorySpec.py b/toontown/coghq/LawbotLegFactorySpec.py index 6cbc91f0..f6a2f821 100644 --- a/toontown/coghq/LawbotLegFactorySpec.py +++ b/toontown/coghq/LawbotLegFactorySpec.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/lawbotHQ/LawbotCourtroom3', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeBoilerRoom_Action01.py b/toontown/coghq/LawbotOfficeBoilerRoom_Action01.py index 541e05fb..5637b9cc 100644 --- a/toontown/coghq/LawbotOfficeBoilerRoom_Action01.py +++ b/toontown/coghq/LawbotOfficeBoilerRoom_Action01.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone08a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeBoilerRoom_Battle00.py b/toontown/coghq/LawbotOfficeBoilerRoom_Battle00.py index f64f44f9..7a34a23a 100644 --- a/toontown/coghq/LawbotOfficeBoilerRoom_Battle00.py +++ b/toontown/coghq/LawbotOfficeBoilerRoom_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone8a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeBoilerRoom_Security00.py b/toontown/coghq/LawbotOfficeBoilerRoom_Security00.py index 892ac7be..785fdac1 100644 --- a/toontown/coghq/LawbotOfficeBoilerRoom_Security00.py +++ b/toontown/coghq/LawbotOfficeBoilerRoom_Security00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone08a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeBoilerRoom_Trap00.py b/toontown/coghq/LawbotOfficeBoilerRoom_Trap00.py index a47bc4b6..4a2118b9 100644 --- a/toontown/coghq/LawbotOfficeBoilerRoom_Trap00.py +++ b/toontown/coghq/LawbotOfficeBoilerRoom_Trap00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE08a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeDiamondRoom_Action00.py b/toontown/coghq/LawbotOfficeDiamondRoom_Action00.py index 488caa09..ee03d077 100644 --- a/toontown/coghq/LawbotOfficeDiamondRoom_Action00.py +++ b/toontown/coghq/LawbotOfficeDiamondRoom_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone13a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeDiamondRoom_Action01.py b/toontown/coghq/LawbotOfficeDiamondRoom_Action01.py index dc182f3d..74773ffa 100644 --- a/toontown/coghq/LawbotOfficeDiamondRoom_Action01.py +++ b/toontown/coghq/LawbotOfficeDiamondRoom_Action01.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone13a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeDiamondRoom_Battle00.py b/toontown/coghq/LawbotOfficeDiamondRoom_Battle00.py index 1e14a195..3761fdf2 100644 --- a/toontown/coghq/LawbotOfficeDiamondRoom_Battle00.py +++ b/toontown/coghq/LawbotOfficeDiamondRoom_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone13a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeDiamondRoom_Security00.py b/toontown/coghq/LawbotOfficeDiamondRoom_Security00.py index 34e98aa8..c62e8284 100644 --- a/toontown/coghq/LawbotOfficeDiamondRoom_Security00.py +++ b/toontown/coghq/LawbotOfficeDiamondRoom_Security00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_10/models/cashbotHQ/ZONE13a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeDiamondRoom_Trap00.py b/toontown/coghq/LawbotOfficeDiamondRoom_Trap00.py index 54853221..f2b2969d 100644 --- a/toontown/coghq/LawbotOfficeDiamondRoom_Trap00.py +++ b/toontown/coghq/LawbotOfficeDiamondRoom_Trap00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone13a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeEntrance_Action00.py b/toontown/coghq/LawbotOfficeEntrance_Action00.py index c942f95a..6deaa3ea 100644 --- a/toontown/coghq/LawbotOfficeEntrance_Action00.py +++ b/toontown/coghq/LawbotOfficeEntrance_Action00.py @@ -8,13 +8,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone03a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeGearRoom_Action00.py b/toontown/coghq/LawbotOfficeGearRoom_Action00.py index 0812b977..a73b84fc 100644 --- a/toontown/coghq/LawbotOfficeGearRoom_Action00.py +++ b/toontown/coghq/LawbotOfficeGearRoom_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone7av2', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeGearRoom_Battle00.py b/toontown/coghq/LawbotOfficeGearRoom_Battle00.py index 39293b13..a3d28188 100644 --- a/toontown/coghq/LawbotOfficeGearRoom_Battle00.py +++ b/toontown/coghq/LawbotOfficeGearRoom_Battle00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone7a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeGearRoom_Platform00.py b/toontown/coghq/LawbotOfficeGearRoom_Platform00.py index 965f5ecf..3269ae39 100644 --- a/toontown/coghq/LawbotOfficeGearRoom_Platform00.py +++ b/toontown/coghq/LawbotOfficeGearRoom_Platform00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone7a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeGearRoom_Security00.py b/toontown/coghq/LawbotOfficeGearRoom_Security00.py index ad9e9e7e..5a02a82c 100644 --- a/toontown/coghq/LawbotOfficeGearRoom_Security00.py +++ b/toontown/coghq/LawbotOfficeGearRoom_Security00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone7a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeLobby_Action00.py b/toontown/coghq/LawbotOfficeLobby_Action00.py index 83310df6..97f1600d 100644 --- a/toontown/coghq/LawbotOfficeLobby_Action00.py +++ b/toontown/coghq/LawbotOfficeLobby_Action00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone04a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeLobby_Action01.py b/toontown/coghq/LawbotOfficeLobby_Action01.py index 49f27f43..65b116a1 100644 --- a/toontown/coghq/LawbotOfficeLobby_Action01.py +++ b/toontown/coghq/LawbotOfficeLobby_Action01.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone04a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeLobby_Lights00.py b/toontown/coghq/LawbotOfficeLobby_Lights00.py index 969bce3c..5e1e9c23 100644 --- a/toontown/coghq/LawbotOfficeLobby_Lights00.py +++ b/toontown/coghq/LawbotOfficeLobby_Lights00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone04a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeLobby_Trap00.py b/toontown/coghq/LawbotOfficeLobby_Trap00.py index 3866cbda..1738326c 100644 --- a/toontown/coghq/LawbotOfficeLobby_Trap00.py +++ b/toontown/coghq/LawbotOfficeLobby_Trap00.py @@ -7,13 +7,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone04a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeOilRoom_Battle00.py b/toontown/coghq/LawbotOfficeOilRoom_Battle00.py index 7d9519ac..9e52c6ee 100644 --- a/toontown/coghq/LawbotOfficeOilRoom_Battle00.py +++ b/toontown/coghq/LawbotOfficeOilRoom_Battle00.py @@ -8,13 +8,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone22a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LawbotOfficeOilRoom_Battle01.py b/toontown/coghq/LawbotOfficeOilRoom_Battle01.py index dce5bc0c..0384a1f5 100644 --- a/toontown/coghq/LawbotOfficeOilRoom_Battle01.py +++ b/toontown/coghq/LawbotOfficeOilRoom_Battle01.py @@ -8,13 +8,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500, 'modelFilename': 'phase_11/models/lawbotHQ/LB_Zone22a', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/LevelSuitPlannerAI.py b/toontown/coghq/LevelSuitPlannerAI.py index 875c2915..1f80419e 100644 --- a/toontown/coghq/LevelSuitPlannerAI.py +++ b/toontown/coghq/LevelSuitPlannerAI.py @@ -44,9 +44,6 @@ class LevelSuitPlannerAI(DirectObject.DirectObject): return joinChances def __genSuitInfos(self, level, track): - if __dev__: - pass - def getSuitDict(spec, cogId, level = level, track = track): suitDict = {} suitDict['track'] = track @@ -152,8 +149,6 @@ class LevelSuitPlannerAI(DirectObject.DirectObject): numSpotsAvailable = 4 - len(battle.suits) if len(cellReserves) > 0 and numSpotsAvailable > 0: self.joinedReserves = [] - if __dev__: - pass if len(battle.suits) == 0: hpPercent = 100 else: diff --git a/toontown/coghq/MintProduct.py b/toontown/coghq/MintProduct.py index f21903b3..bc17789d 100644 --- a/toontown/coghq/MintProduct.py +++ b/toontown/coghq/MintProduct.py @@ -30,11 +30,4 @@ class MintProduct(BasicEntities.NodePathEntity): self.model.setScale(self.Scales[self.mintId]) self.model.flattenStrong() if self.model: - self.model.reparentTo(self) - return - - if __dev__: - - def setMintId(self, mintId): - self.mintId = mintId - self.loadModel() + self.model.reparentTo(self) \ No newline at end of file diff --git a/toontown/coghq/MintRoomBase.py b/toontown/coghq/MintRoomBase.py index 9cc523a1..cec265ef 100644 --- a/toontown/coghq/MintRoomBase.py +++ b/toontown/coghq/MintRoomBase.py @@ -13,12 +13,4 @@ class MintRoomBase: self.roomId = roomId def getCogTrack(self): - return self.cogTrack - - if __dev__: - - def getEntityTypeReg(self): - import FactoryEntityTypes - from otp.level import EntityTypeRegistry - typeReg = EntityTypeRegistry.EntityTypeRegistry(FactoryEntityTypes) - return typeReg + return self.cogTrack \ No newline at end of file diff --git a/toontown/coghq/PathMasterEntity.py b/toontown/coghq/PathMasterEntity.py index e5fa6962..c7288c9f 100644 --- a/toontown/coghq/PathMasterEntity.py +++ b/toontown/coghq/PathMasterEntity.py @@ -62,50 +62,34 @@ class PathMasterEntity(PathEntity.PathEntity): def setPathTarget0(self, targetId): self.pathTarget0 = targetId self.pathTargetList[0] = targetId - if __dev__: - messenger.send(self.getChangeEvent()) def setPathTarget1(self, targetId): self.pathTarget1 = targetId self.pathTargetList[1] = targetId - if __dev__: - messenger.send(self.getChangeEvent()) def setPathTarget2(self, targetId): self.pathTarget2 = targetId self.pathTargetList[2] = targetId - if __dev__: - messenger.send(self.getChangeEvent()) def setPathTarget3(self, targetId): self.pathTarget3 = targetId self.pathTargetList[3] = targetId - if __dev__: - messenger.send(self.getChangeEvent()) def setPathTarget4(self, targetId): self.pathTarget4 = targetId self.pathTargetList[4] = targetId - if __dev__: - messenger.send(self.getChangeEvent()) def setPathTarget5(self, targetId): self.pathTarget5 = targetId self.pathTargetList[5] = targetId - if __dev__: - messenger.send(self.getChangeEvent()) def setPathTarget6(self, targetId): self.pathTarget6 = targetId self.pathTargetList[6] = targetId - if __dev__: - messenger.send(self.getChangeEvent()) def setPathTarget7(self, targetId): self.pathTarget7 = targetId self.pathTargetList[7] = targetId - if __dev__: - messenger.send(self.getChangeEvent()) def getReducedPath(self): returnPath = [] @@ -121,8 +105,6 @@ class PathMasterEntity(PathEntity.PathEntity): pathTableId = GoonPathData.taskZoneId2pathId[self.level.getTaskZoneId()] if self.pathIndex in GoonPathData.Paths[pathTableId]: self.path = GoonPathData.Paths[pathTableId][self.pathIndex] - if __dev__: - messenger.send(self.getChangeEvent()) else: PathEntity.notify.warning('invalid pathIndex: %s' % pathIndex) self.path = None @@ -167,13 +149,4 @@ class PathMasterEntity(PathEntity.PathEntity): duration = distance / velocity track.append(LerpPosInterval(node, duration=duration, pos=endPoint, startPos=startPoint)) - return track - - if __dev__: - - def getChangeEvent(self): - return self.getUniqueName('pathChanged') - - def setPathScale(self, pathScale): - self.pathScale = pathScale - self.setPathIndex(self.pathIndex) + return track \ No newline at end of file diff --git a/toontown/coghq/PlatformEntity.py b/toontown/coghq/PlatformEntity.py index 87a1ef82..5e10f84f 100644 --- a/toontown/coghq/PlatformEntity.py +++ b/toontown/coghq/PlatformEntity.py @@ -40,10 +40,4 @@ class PlatformEntity(BasicEntities.NodePathEntity): del self.moveIval if hasattr(self, 'platform'): self.platform.destroy() - del self.platform - - if __dev__: - - def attribChanged(self, *args): - self.stop() - self.start() + del self.platform \ No newline at end of file diff --git a/toontown/coghq/SellbotBrutalLegFactorySpec.py b/toontown/coghq/SellbotBrutalLegFactorySpec.py index 45659cbc..e25047ae 100644 --- a/toontown/coghq/SellbotBrutalLegFactorySpec.py +++ b/toontown/coghq/SellbotBrutalLegFactorySpec.py @@ -8,13 +8,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500.0, 'modelFilename': 'phase_9/models/cogHQ/SelbotLegFactory', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/SellbotLegFactorySpec.py b/toontown/coghq/SellbotLegFactorySpec.py index 9d8c471c..7356fb61 100644 --- a/toontown/coghq/SellbotLegFactorySpec.py +++ b/toontown/coghq/SellbotLegFactorySpec.py @@ -8,13 +8,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500.0, 'modelFilename': 'phase_9/models/cogHQ/SelbotLegFactory', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/SellbotMegaCorpLegSpec.py b/toontown/coghq/SellbotMegaCorpLegSpec.py index 45659cbc..e25047ae 100644 --- a/toontown/coghq/SellbotMegaCorpLegSpec.py +++ b/toontown/coghq/SellbotMegaCorpLegSpec.py @@ -8,13 +8,6 @@ GlobalEntities = {1000: {'type': 'levelMgr', 'farPlaneDistance': 1500.0, 'modelFilename': 'phase_9/models/cogHQ/SelbotLegFactory', 'wantDoors': 1}, - 1001: {'type': 'editMgr', - 'name': 'EditMgr', - 'parentEntId': 0, - 'insertEntity': None, - 'removeEntity': None, - 'requestNewEntity': None, - 'requestSave': None}, 0: {'type': 'zone', 'name': 'UberZone', 'comment': '', diff --git a/toontown/coghq/StageRoomBase.py b/toontown/coghq/StageRoomBase.py index e51923fa..818ede13 100644 --- a/toontown/coghq/StageRoomBase.py +++ b/toontown/coghq/StageRoomBase.py @@ -13,12 +13,4 @@ class StageRoomBase: self.roomId = roomId def getCogTrack(self): - return self.cogTrack - - if __dev__: - - def getEntityTypeReg(self): - import FactoryEntityTypes - from otp.level import EntityTypeRegistry - typeReg = EntityTypeRegistry.EntityTypeRegistry(FactoryEntityTypes) - return typeReg + return self.cogTrack \ No newline at end of file diff --git a/toontown/estate/DistributedLawnDecor.py b/toontown/estate/DistributedLawnDecor.py index 09cb44ed..1046be9c 100644 --- a/toontown/estate/DistributedLawnDecor.py +++ b/toontown/estate/DistributedLawnDecor.py @@ -94,11 +94,6 @@ class DistributedLawnDecor(DistributedNode.DistributedNode, NodePath, ShadowCast if not self.rotateNode: self.rotateNode = self.plantPath.attachNewNode('rotate') self.model = None - if __dev__: - self.model = loader.loadModel(self.defaultModel) - self.model.setScale(0.4, 0.4, 0.1) - self.model.reparentTo(self.rotateNode) - return def setupShadow(self): self.shadowJoint = self.rotateNode.attachNewNode('shadow') diff --git a/toontown/hood/InteractiveAnimatedProp.py b/toontown/hood/InteractiveAnimatedProp.py index 73e32d99..93f100e8 100644 --- a/toontown/hood/InteractiveAnimatedProp.py +++ b/toontown/hood/InteractiveAnimatedProp.py @@ -274,8 +274,6 @@ class InteractiveAnimatedProp(GenericAnimatedProp.GenericAnimatedProp, FSM.FSM): whichAnim = self.chooseIdleAnimToRun() if self.visId == localAvatar.zoneId: self.notify.debug('whichAnim=%s' % whichAnim) - if __dev__: - self.notify.info('whichAnim=%s %s' % (whichAnim, self.getOrigIdleAnimName(whichAnim))) self.lastPlayingAnimPhase = whichAnim self.curIval = self.createIdleAnimSequence(whichAnim) self.notify.debug('starting curIval of length %s' % self.curIval.getDuration()) diff --git a/toontown/parties/DistributedPartyCatchActivity.py b/toontown/parties/DistributedPartyCatchActivity.py index d723a3da..b4e6f9b0 100644 --- a/toontown/parties/DistributedPartyCatchActivity.py +++ b/toontown/parties/DistributedPartyCatchActivity.py @@ -118,25 +118,6 @@ class DistributedPartyCatchActivity(DistributedPartyActivity, DistributedPartyCa self.notify.info('load()') DistributedPartyCatchActivity.notify.debug('PartyCatch: load') self.activityFSM = CatchActivityFSM(self) - if __dev__: - for o in xrange(3): - print {0: 'SPOTS PER PLAYER', - 1: 'DROPS PER MINUTE PER SPOT DURING NORMAL DROP PERIOD', - 2: 'DROPS PER MINUTE PER PLAYER DURING NORMAL DROP PERIOD'}[o] - for i in xrange(1, self.FallRateCap_Players + 10): - self.defineConstants(forceNumPlayers=i) - numDropLocations = self.DropRows * self.DropColumns - numDropsPerMin = 60.0 / self.DropPeriod - if o == 0: - spotsPerPlayer = numDropLocations / float(i) - print '%2d PLAYERS: %s' % (i, spotsPerPlayer) - elif o == 1: - numDropsPerMinPerSpot = numDropsPerMin / numDropLocations - print '%2d PLAYERS: %s' % (i, numDropsPerMinPerSpot) - elif i > 0: - numDropsPerMinPerPlayer = numDropsPerMin / i - print '%2d PLAYERS: %s' % (i, numDropsPerMinPerPlayer) - self.defineConstants() self.treesAndFence = loader.loadModel('phase_13/models/parties/%s' % arenaModel) self.treesAndFence.setScale(0.9) diff --git a/toontown/pets/DistributedPet.py b/toontown/pets/DistributedPet.py index 87a8f40c..41221d01 100644 --- a/toontown/pets/DistributedPet.py +++ b/toontown/pets/DistributedPet.py @@ -15,8 +15,6 @@ from toontown.toonbase import TTLocalizer from toontown.distributed import DelayDelete from toontown.distributed.DelayDeletable import DelayDeletable import random -if __dev__: - import pdb BeanColors = (VBase4(1.0, 0.2, 0.2, 1.0), VBase4(0.2, 1.0, 0.2, 1.0), VBase4(0.2, 0.2, 1.0, 1.0), diff --git a/toontown/pets/DistributedPetAI.py b/toontown/pets/DistributedPetAI.py index 06301364..0c00a561 100644 --- a/toontown/pets/DistributedPetAI.py +++ b/toontown/pets/DistributedPetAI.py @@ -72,8 +72,6 @@ class DistributedPetAI(DistributedSmoothNodeAI.DistributedSmoothNodeAI, PetLooke self.gaitFSM.enterInitialState() self.unstickFSM = ClassicFSM.ClassicFSM('unstickFSM', [State.State('off', self.unstickEnterOff, self.unstickExitOff), State.State('on', self.unstickEnterOn, self.unstickExitOn)], 'off', 'off') self.unstickFSM.enterInitialState() - if __dev__: - self.pscMoveResc = PStatCollector('App:Show code:petMove:Reschedule') return def setInactive(self): @@ -132,8 +130,6 @@ class DistributedPetAI(DistributedSmoothNodeAI.DistributedSmoothNodeAI, PetLooke broadcastZones = list2dict([newZoneId, oldZoneId]) self.estateOwnerId = simbase.air.estateManager.getOwnerFromZone(newZoneId) if self.estateOwnerId: - if __dev__: - pass self.inEstate = 1 self.estateZones = simbase.air.estateManager.getEstateZones(self.estateOwnerId) else: @@ -438,10 +434,6 @@ class DistributedPetAI(DistributedSmoothNodeAI.DistributedSmoothNodeAI, PetLooke self.d_setTrickAptitudes(aptitudes) def d_setTrickAptitudes(self, aptitudes): - if __dev__: - for aptitude in aptitudes: - pass - while len(aptitudes) < len(PetTricks.Tricks) - 1: aptitudes.append(0.0) @@ -610,8 +602,6 @@ class DistributedPetAI(DistributedSmoothNodeAI.DistributedSmoothNodeAI, PetLooke if self.unstickFSM: self.unstickFSM.requestFinalState() del self.unstickFSM - if __dev__: - del self.pscMoveResc PetLookerAI.PetLookerAI.destroy(self) self.ignoreAll() self._hasCleanedUp = True @@ -629,8 +619,6 @@ class DistributedPetAI(DistributedSmoothNodeAI.DistributedSmoothNodeAI, PetLooke del self.gaitFSM del self.unstickFSM - if __dev__: - del self.pscMoveResc PetLookerAI.PetLookerAI.destroy(self) self.doNotDeallocateChannel = True self.zoneId = None @@ -662,11 +650,7 @@ class DistributedPetAI(DistributedSmoothNodeAI.DistributedSmoothNodeAI, PetLooke self.stopPosHprBroadcast() self.requestDelete() return Task.done - if __dev__: - self.pscMoveResc.start() taskMgr.doMethodLater(simbase.petMovePeriod, self.move, self.getMoveTaskName()) - if __dev__: - self.pscMoveResc.stop() return Task.done def startPosHprBroadcast(self): diff --git a/toontown/pets/DistributedPetProxyAI.py b/toontown/pets/DistributedPetProxyAI.py index 1b9f91b9..4495b197 100644 --- a/toontown/pets/DistributedPetProxyAI.py +++ b/toontown/pets/DistributedPetProxyAI.py @@ -318,10 +318,6 @@ class DistributedPetProxyAI(DistributedObjectAI.DistributedObjectAI): self.d_setTrickAptitudes(aptitudes) def d_setTrickAptitudes(self, aptitudes): - if __dev__: - for aptitude in aptitudes: - pass - while len(aptitudes) < len(PetTricks.Tricks) - 1: aptitudes.append(0.0) diff --git a/toontown/pets/PetBrain.py b/toontown/pets/PetBrain.py index 581f9d6e..fbfa8c13 100644 --- a/toontown/pets/PetBrain.py +++ b/toontown/pets/PetBrain.py @@ -25,18 +25,9 @@ class PetBrain(DirectObject.DirectObject): self.avAwareness = {} self.lastInteractTime = {} self.nextAwarenessIndex = 0 - if __dev__: - self.pscPrior = PStatCollector('App:Show code:petThink:UpdatePriorities') - self.pscAware = PStatCollector('App:Show code:petThink:ShuffleAwareness') - self.pscResc = PStatCollector('App:Show code:petThink:Reschedule') - return def destroy(self): taskMgr.remove(self.getTeleportTaskName()) - if __dev__: - del self.pscPrior - del self.pscAware - del self.pscResc self.stop() self.goalMgr.destroy() self.chaseNode.removeNode() @@ -123,19 +114,11 @@ class PetBrain(DirectObject.DirectObject): def _think(self, task = None): if not self.inMovie: - if __dev__: - self.pscPrior.start() self._updatePriorities() - if __dev__: - self.pscPrior.stop() - if __dev__: - self.pscAware.start() if len(self.nearbyAvs) > PetConstants.MaxAvatarAwareness: self.nextAwarenessIndex %= len(self.nearbyAvs) self._considerBecomeAwareOf(self.nearbyAvs.keys()[self.nextAwarenessIndex]) self.nextAwarenessIndex += 1 - if __dev__: - self.pscAware.stop() curT = globalClock.getFrameTime() tSinceLastLonelinessUpdate = curT - self.tLastLonelinessUpdate if tSinceLastLonelinessUpdate >= PetConstants.LonelinessUpdatePeriod: @@ -146,11 +129,7 @@ class PetBrain(DirectObject.DirectObject): self.pet.lerpMood('loneliness', max(-1.0, dt * -.003 * numLookers)) if numLookers > 5: self.pet.lerpMood('excitement', min(1.0, dt * 0.001 * numLookers)) - if __dev__: - self.pscResc.start() taskMgr.doMethodLater(simbase.petThinkPeriod, self._think, self.getThinkTaskName()) - if __dev__: - self.pscResc.stop() return Task.done def _updatePriorities(self): diff --git a/toontown/pets/PetGoalMgr.py b/toontown/pets/PetGoalMgr.py index cf1f275a..3dc3b49e 100644 --- a/toontown/pets/PetGoalMgr.py +++ b/toontown/pets/PetGoalMgr.py @@ -14,17 +14,8 @@ class PetGoalMgr(DirectObject.DirectObject): self._hasTrickGoal = False self.primaryGoal = None self.primaryStartT = 0 - if __dev__: - self.pscSetup = PStatCollector('App:Show code:petThink:UpdatePriorities:Setup') - self.pscFindPrimary = PStatCollector('App:Show code:petThink:UpdatePriorities:FindPrimary') - self.pscSetPrimary = PStatCollector('App:Show code:petThink:UpdatePriorities:SetPrimary') - return def destroy(self): - if __dev__: - del self.pscSetup - del self.pscFindPrimary - del self.pscSetPrimary goals = self.goals.keys() for goal in goals: self.removeGoal(goal) @@ -53,8 +44,6 @@ class PetGoalMgr(DirectObject.DirectObject): def updatePriorities(self): if len(self.goals) == 0: return - if __dev__: - self.pscSetup.start() if self.primaryGoal is None: highestPriority = -99999.0 candidates = [] @@ -65,10 +54,6 @@ class PetGoalMgr(DirectObject.DirectObject): priFactor = PetConstants.PrimaryGoalScale elapsed = min(decayDur, globalClock.getFrameTime() - self.primaryStartT) highestPriority *= lerp(priFactor, 1.0, elapsed / decayDur) - if __dev__: - self.pscSetup.stop() - if __dev__: - self.pscFindPrimary.start() for goal in self.goals: thisPri = goal.getPriority() if thisPri >= highestPriority: @@ -78,16 +63,10 @@ class PetGoalMgr(DirectObject.DirectObject): else: candidates.append(goal) - if __dev__: - self.pscFindPrimary.stop() - if __dev__: - self.pscSetPrimary.start() newPrimary = random.choice(candidates) if self.primaryGoal != newPrimary: self.pet.notify.debug('new goal: %s, priority=%s' % (newPrimary.__class__.__name__, highestPriority)) self._setPrimaryGoal(newPrimary) - if __dev__: - self.pscSetPrimary.stop() return def _setPrimaryGoal(self, goal): diff --git a/toontown/suit/DistributedCashbotBossAI.py b/toontown/suit/DistributedCashbotBossAI.py index a6d2e811..69eb5004 100644 --- a/toontown/suit/DistributedCashbotBossAI.py +++ b/toontown/suit/DistributedCashbotBossAI.py @@ -46,8 +46,6 @@ class DistributedCashbotBossAI(DistributedBossCogAI.DistributedBossCogAI, FSM.FS def generate(self): DistributedBossCogAI.DistributedBossCogAI.generate(self) - if __dev__: - self.scene.reparentTo(self.getRender()) def getHoodId(self): return ToontownGlobals.CashbotHQ diff --git a/toontown/suit/DistributedGoon.py b/toontown/suit/DistributedGoon.py index 6f4fa6cd..e8d31e03 100644 --- a/toontown/suit/DistributedGoon.py +++ b/toontown/suit/DistributedGoon.py @@ -136,20 +136,8 @@ class DistributedGoon(DistributedCrushableEntity.DistributedCrushableEntity, Goo if self.radar: self.radar.clearClipPlane() - if __dev__: - - def refreshPath(self): - self.setPath() - self.request('Off') - self.request('Walk') - def setPath(self): self.path = self.level.getEntity(self.parentEntId) - if __dev__: - if hasattr(self, 'pathChangeEvent'): - self.ignore(self.pathChangeEvent) - self.pathChangeEvent = self.path.getChangeEvent() - self.accept(self.pathChangeEvent, self.refreshPath) if self.walkTrack: self.walkTrack.pause() self.walkTrack = None @@ -159,7 +147,6 @@ class DistributedGoon(DistributedCrushableEntity.DistributedCrushableEntity, Goo self.path.pos[1], self.path.pos[2], self.path.pathIndex]) - return def disable(self): self.notify.debug('DistributedGoon %d: disabling' % self.getDoId()) diff --git a/toontown/toon/DistributedToon.py b/toontown/toon/DistributedToon.py index 351d0066..059cea24 100644 --- a/toontown/toon/DistributedToon.py +++ b/toontown/toon/DistributedToon.py @@ -2254,10 +2254,6 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute newInvites += 1 elif invite.status == PartyGlobals.InviteStatus.ReadButNotReplied: readButNotRepliedInvites += 1 - if __dev__: - partyInfo = self.getOnePartyInvitedTo(invite.partyId) - if not partyInfo: - self.notify.error('party info not found in partiesInvtedTo, partyId = %s' % str(invite.partyId)) if newInvites: self.setInviteMailNotify(ToontownGlobals.NewItems) diff --git a/toontown/toon/DistributedToonAI.py b/toontown/toon/DistributedToonAI.py index f6c9a0df..900d921d 100644 --- a/toontown/toon/DistributedToonAI.py +++ b/toontown/toon/DistributedToonAI.py @@ -2579,12 +2579,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo if self.isPlayerControlled(): DistributedPlayerAI.DistributedPlayerAI.decrementPopulation(self) - if __dev__: - - def _logGarbage(self): - if self.isPlayerControlled(): - DistributedPlayerAI.DistributedPlayerAI._logGarbage(self) - def reqSCResistance(self, msgIndex, nearbyPlayers): self.d_setSCResistance(msgIndex, nearbyPlayers) @@ -3756,8 +3750,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo def logMessage(self, message): avId = self.air.getAvatarIdFromSender() - if __dev__: - print 'CLIENT LOG MESSAGE %s %s' % (avId, message) try: self.air.writeServerEvent('clientLog', avId, message) except: @@ -3798,10 +3790,6 @@ class DistributedToonAI(DistributedPlayerAI.DistributedPlayerAI, DistributedSmoo newInvites += 1 elif invite.status == PartyGlobals.InviteStatus.ReadButNotReplied: readButNotRepliedInvites += 1 - if __dev__: - partyInfo = self.getOnePartyInvitedTo(invite.partyId) - if not partyInfo: - self.notify.error('party info not found in partiesInvtedTo, partyId = %s' % str(invite.partyId)) if newInvites: self.setInviteMailNotify(ToontownGlobals.NewItems) diff --git a/toontown/toon/LocalToon.py b/toontown/toon/LocalToon.py index 3e966105..cbfb29c1 100644 --- a/toontown/toon/LocalToon.py +++ b/toontown/toon/LocalToon.py @@ -181,18 +181,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar): def startGlitchKiller(self): if localAvatar.getZoneId() not in GlitchKillerZones: return - if __dev__: - self.glitchMessage = 'START GLITCH KILLER' - randChoice = random.randint(0, 3) - if randChoice == 0: - self.glitchMessage = 'START GLITCH KILLER' - elif randChoice == 1: - self.glitchMessage = 'GLITCH KILLER ENGAGED' - elif randChoice == 2: - self.glitchMessage = 'GLITCH KILLER GO!' - elif randChoice == 3: - self.glitchMessage = 'GLITCH IN YO FACE FOOL!' - self.notify.debug(self.glitchMessage) taskMgr.remove(self.uniqueName('glitchKiller')) taskMgr.add(self.glitchKiller, self.uniqueName('glitchKiller')) self.glitchOkay = 1 @@ -204,15 +192,6 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar): self.tempGreySpacing = 0 def stopGlitchKiller(self): - if __dev__ and hasattr(self, 'glitchMessage'): - if self.glitchMessage == 'START GLITCH KILLER': - self.notify.debug('STOP GLITCH KILLER') - elif self.glitchMessage == 'GLITCH KILLER ENGAGED': - self.notify.debug('GLITCH KILLER DISENGAGED') - elif self.glitchMessage == 'GLITCH KILLER GO!': - self.notify.debug('GLITCH KILLER NO GO!') - elif self.glitchMessage == 'GLITCH IN YO FACE FOOL!': - self.notify.debug('GLITCH OFF YO FACE FOOL!') taskMgr.remove(self.uniqueName('glitchKiller')) self.glitchOkay = 1