本文整理汇总了Python中toontown.hood.ZoneUtil.getCanonicalHoodId方法的典型用法代码示例。如果您正苦于以下问题:Python ZoneUtil.getCanonicalHoodId方法的具体用法?Python ZoneUtil.getCanonicalHoodId怎么用?Python ZoneUtil.getCanonicalHoodId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.hood.ZoneUtil
的用法示例。
在下文中一共展示了ZoneUtil.getCanonicalHoodId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: canAccess
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def canAccess(self, zoneId=None):
if base.cr.isPaid():
return True
allowed = False
allowedZones = [
ToontownGlobals.ToontownCentral,
ToontownGlobals.MyEstate,
ToontownGlobals.GoofySpeedway,
ToontownGlobals.Tutorial,
]
specialZones = [ToontownGlobals.SellbotLobby]
if hasattr(base.cr, "newsManager") and base.cr.newsManager:
holidayIds = base.cr.newsManager.getHolidayIdList()
if ToontownGlobals.SELLBOT_NERF_HOLIDAY in holidayIds:
specialZones.append(ToontownGlobals.SellbotHQ)
place = base.cr.playGame.getPlace()
if zoneId:
myHoodId = ZoneUtil.getCanonicalHoodId(zoneId)
else:
myHoodId = ZoneUtil.getCanonicalHoodId(place.zoneId)
if hasattr(place, "id"):
myHoodId = place.id
if myHoodId in allowedZones:
allowed = True
elif zoneId and zoneId in specialZones:
allowed = True
return allowed
示例2: teleportToShop
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def teleportToShop(self, npcId):
if base.cr.playGame.getPlace().getState() != 'walk':
return
npcZone = NPCToons.getNPCZone(npcId)
npcHood = ZoneUtil.getCanonicalHoodId(npcZone)
hqZone = {2000:2520, 1000:1507, 3000:3508, 4000:4504, 5000:5502, 7000:7503, 9000:9505}
if npcZone in (-1, 0, None):
zoneId = base.localAvatar.getZoneId()
if ZoneUtil.isDynamicZone(zoneId) or ZoneUtil.isCogHQZone(zoneId):
zoneId = 2000
npcHood = ZoneUtil.getCanonicalHoodId(zoneId)
npcZone = hqZone.get(npcHood, 2520)
cost = ToontownGlobals.getTeleportButtonCost(npcHood)
self.destroyDialog()
base.cr.playGame.getPlace().setState('stopped')
if base.localAvatar.getTotalMoney() < cost:
self.dialog = TTDialog.TTDialog(style=TTDialog.Acknowledge, text=TTLocalizer.TeleportButtonNoMoney % cost, command=self.destroyDialog)
else:
self.dialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.TeleportButtonConfirm % cost, command=lambda value: self.teleportToShopConfirm(npcZone, npcHood, cost, value))
self.dialog.show()
示例3: setup
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def setup(self):
self.dnaStore = base.cr.playGame.dnaStore
self.randomGenerator = random.Random()
self.randomGenerator.seed(self.zoneId)
self.interior = loader.loadModel("phase_4/models/modules/PetShopInterior")
self.interior.reparentTo(render)
self.fish = Actor.Actor(
"phase_4/models/props/interiorfish-zero", {"swim": "phase_4/models/props/interiorfish-swim"}
)
self.fish.reparentTo(self.interior)
self.fish.setColorScale(0.8, 0.9, 1, 0.8)
self.fish.setScale(0.8)
self.fish.setPos(0, 6, -4)
self.fish.setPlayRate(0.7, "swim")
self.fish.loop("swim")
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId)
self.colors = ToonInteriorColors.colors[hoodId]
self.replaceRandomInModel(self.interior)
door = self.chooseDoor()
doorOrigin = render.find("**/door_origin;+s")
doorNP = door.copyTo(doorOrigin)
doorOrigin.setScale(0.8, 0.8, 0.8)
doorOrigin.setPos(doorOrigin, 0, -0.25, 0)
doorColor = self.randomGenerator.choice(self.colors["TI_door"])
setupDoor(doorNP, self.interior, doorOrigin, self.dnaStore, str(self.block), doorColor)
doorFrame = doorNP.find("door_*_flat")
doorFrame.wrtReparentTo(self.interior)
doorFrame.setColor(doorColor)
del self.colors
del self.dnaStore
del self.randomGenerator
self.interior.flattenMedium()
示例4: openToAll
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def openToAll(zoneId, avatar):
allowed = False
canonicalZoneId = ZoneUtil.getCanonicalHoodId(zoneId)
allowedZones = [
ToontownGlobals.ToontownCentral,
ToontownGlobals.MyEstate,
ToontownGlobals.GoofySpeedway,
ToontownGlobals.Tutorial,
]
specialZones = [ToontownGlobals.SellbotLobby]
if ToontownGlobals.SELLBOT_NERF_HOLIDAY in simbase.air.holidayManager.currentHolidays:
specialZones.append(ToontownGlobals.SellbotHQ)
ownerId = simbase.air.estateMgr.getOwnerFromZone(zoneId)
if ownerId:
for zone in simbase.air.estateMgr.getEstateZones(ownerId):
specialZones.append(zone)
if canonicalZoneId in allowedZones or avatar.isInEstate():
allowed = True
elif zoneId in specialZones:
allowed = True
elif canonicalZoneId >= ToontownGlobals.DynamicZonesBegin and not avatar.getTutorialAck():
zoneDict = simbase.air.tutorialManager.playerDict.get(avatar.doId)
if zoneDict:
allowed = True
return allowed
示例5: enter
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def enter(self):
ShtikerPage.ShtikerPage.enter(self)
try:
zone = base.cr.playGame.getPlace().getZoneId()
except:
zone = 0
if base.localAvatar.lastHood >= ToontownGlobals.BossbotHQ:
self.safeZoneButton['text'] = TTLocalizer.MapPageBackToCogHQ
else:
self.safeZoneButton['text'] = TTLocalizer.MapPageBackToPlayground
if zone and ZoneUtil.isPlayground(zone) or self.book.safeMode:
self.safeZoneButton.hide()
else:
self.safeZoneButton.show()
if base.cr.playGame.getPlaceId() == ToontownGlobals.MyEstate and base.cr.playGame.hood.loader.atMyEstate() or self.book.safeMode:
self.goHomeButton.hide()
elif base.housingEnabled:
self.goHomeButton.show()
if base.cr.playGame.getPlaceId() == ToontownGlobals.MyEstate:
if base.cr.playGame.hood.loader.atMyEstate():
self.hoodLabel['text'] = TTLocalizer.MapPageYouAreAtHome
self.hoodLabel.show()
else:
avatar = base.cr.identifyAvatar(base.cr.playGame.hood.loader.estateOwnerId)
if avatar:
avName = avatar.getName()
self.hoodLabel['text'] = TTLocalizer.MapPageYouAreAtSomeonesHome % TTLocalizer.GetPossesive(avName)
self.hoodLabel.show()
elif zone:
hoodName = ToontownGlobals.hoodNameMap.get(ZoneUtil.getCanonicalHoodId(zone), ('',))[-1]
streetName = ToontownGlobals.StreetNames.get(ZoneUtil.getCanonicalBranchZone(zone), ('',))[-1]
if hoodName:
self.hoodLabel['text'] = TTLocalizer.MapPageYouAreHere % (hoodName, streetName)
self.hoodLabel.show()
else:
self.hoodLabel.hide()
else:
self.hoodLabel.hide()
safeZonesVisited = base.localAvatar.hoodsVisited
hoodTeleportList = base.localAvatar.getTeleportAccess()
for hood in self.allZones:
label = self.labels[self.allZones.index(hood)]
clouds = self.clouds[self.allZones.index(hood)]
if not self.book.safeMode and hood in safeZonesVisited:
label['text_fg'] = (0, 0, 0, 1)
label.show()
for cloud in clouds:
cloud.hide()
fullname = base.cr.hoodMgr.getFullnameFromId(hood)
if hood in hoodTeleportList:
text = TTLocalizer.MapPageGoTo % fullname
label['text'] = ('', text, text)
else:
label['text'] = ('', fullname, fullname)
else:
label.hide()
for cloud in clouds:
cloud.show()
示例6: setup
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def setup(self):
self.dnaStore = base.cr.playGame.dnaStore
self.randomGenerator = random.Random()
self.randomGenerator.seed(self.zoneId)
self.interior = loader.loadModel('phase_4/models/modules/PetShopInterior')
self.interior.reparentTo(render)
self.fish = Actor.Actor('phase_4/models/props/interiorfish-zero', {'swim': 'phase_4/models/props/interiorfish-swim'})
self.fish.reparentTo(self.interior)
self.fish.setColorScale(0.8, 0.9, 1, 0.8)
self.fish.setScale(0.8)
self.fish.setPos(0, 6, -4)
self.fish.setPlayRate(0.7, 'swim')
self.fish.loop('swim')
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId)
self.colors = ToonInteriorColors.colors[hoodId]
self.replaceRandomInModel(self.interior)
door = self.chooseDoor()
doorOrigin = render.find('**/door_origin;+s')
doorNP = door.copyTo(doorOrigin)
doorOrigin.setScale(0.8, 0.8, 0.8)
doorOrigin.setPos(doorOrigin, 0, -0.25, 0)
doorColor = self.randomGenerator.choice(self.colors['TI_door'])
setupDoor(doorNP, self.interior, doorOrigin, self.dnaStore, str(self.block), doorColor)
doorFrame = doorNP.find('door_*_flat')
doorFrame.wrtReparentTo(self.interior)
doorFrame.setColor(doorColor)
del self.colors
del self.dnaStore
del self.randomGenerator
self.interior.flattenMedium()
for npcToon in self.cr.doFindAllInstances(DistributedNPCToonBase):
npcToon.initToonState()
示例7: replaceRandom
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def replaceRandom(self, root, generator=random):
for nodePath in root.findAllMatches('**/random_???_*'):
name = nodePath.getName()
category = name[11:]
if name[7] in ('m', 't'):
codeCount = self.cr.playGame.dnaStore.getNumCatalogCodes(
category)
index = generator.randint(0, codeCount - 1)
code = self.cr.playGame.dnaStore.getCatalogCode(
category, index)
if name[7] == 'm':
_nodePath = self.cr.playGame.dnaStore.findNode(
code).copyTo(nodePath)
if name[8] == 'r':
self.replaceRandom(_nodePath, generator=generator)
else:
texture = self.cr.playGame.dnaStore.findTexture(code)
nodePath.setTexture(texture, 100)
_nodePath = nodePath
if name[8] == 'c':
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId)
colors = ToonInteriorColors.colors[hoodId]
_nodePath.setColorScale(generator.choice(colors[category]))
示例8: showChoicePoster
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def showChoicePoster(self, questId, fromNpcId, toNpcId, rewardId, callback):
self.update((questId,
fromNpcId,
toNpcId,
rewardId,
0))
quest = Quests.getQuest(questId)
self.rewardText.show()
self.rewardText.setZ(-0.205)
self.questProgress.hide()
if not hasattr(self, 'chooseButton'):
guiButton = loader.loadModel('phase_3/models/gui/quit_button')
self.chooseButton = DirectButton(parent=self.questFrame, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=(0.7, 1, 1), text=TTLocalizer.QuestPageChoose, text_scale=0.06, text_pos=(0, -0.02), pos=(0.285, 0, 0.245), scale=0.65)
guiButton.removeNode()
npcZone = NPCToons.getNPCZone(toNpcId)
hoodId = ZoneUtil.getCanonicalHoodId(npcZone)
if not base.cr.isPaid() and (questId == 401 or hasattr(quest, 'getLocation') and quest.getLocation() == 1000 or hoodId == 1000):
def showTeaserPanel():
TeaserPanel(pageName='getGags')
self.chooseButton['command'] = showTeaserPanel
else:
self.chooseButton['command'] = callback
self.chooseButton['extraArgs'] = [questId]
self.unbind(DGG.WITHIN)
self.unbind(DGG.WITHOUT)
if not quest.getType() == Quests.TrackChoiceQuest:
self.questInfo.setZ(-0.0625)
return
示例9: announceGenerate
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def announceGenerate(self):
DistributedObject.announceGenerate(self)
self.interior = loader.loadModel('phase_4/models/modules/ttc_library_interior.bam')
self.interior.reparentTo(render)
generator = random.Random()
generator.seed(self.zoneId)
self.replaceRandom(self.interior, generator=generator)
doorOrigin = self.interior.find('**/door_origin;+s')
doorOrigin.setScale(0.8)
doorOrigin.setY(doorOrigin, -0.025)
door = self.cr.playGame.dnaStore.findNode('door_double_round_ur')
doorNodePath = door.copyTo(doorOrigin)
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId)
doorColor = ToonInteriorColors.colors[hoodId]['TI_door'][0]
DNADoor.setupDoor(
doorNodePath, self.interior, doorOrigin, self.cr.playGame.dnaStore,
str(self.block), doorColor)
doorFrame = doorNodePath.find('door_double_round_ur_flat')
doorFrame.wrtReparentTo(self.interior)
doorFrame.setColor(doorColor)
for npcToon in self.cr.doFindAllInstances(DistributedNPCToonBase):
npcToon.initToonState()
示例10: updateMap
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def updateMap(self):
if self.av:
hoodId = ZoneUtil.getCanonicalHoodId(self.av.getLocation()[1])
zoneId = ZoneUtil.getCanonicalBranchZone(self.av.getLocation()[1])
try:
mapsGeom = loader.loadModel('phase_4/models/questmap/%s_maps' % ToontownGlobals.dnaMap[hoodId])
except:
self.stop()
return
mapImage = mapsGeom.find('**/%s_%s_english' % (ToontownGlobals.dnaMap[hoodId], zoneId))
if not mapImage.isEmpty():
self.container['image'] = mapImage
self.resetFrameSize()
self.cornerPosInfo = QuestMapGlobals.CornerPosTable.get('%s_%s_english' % (ToontownGlobals.dnaMap[hoodId], zoneId))
self.hqPosInfo = QuestMapGlobals.HQPosTable.get('%s_%s_english' % (ToontownGlobals.dnaMap[hoodId], zoneId))
self.fishingSpotInfo = QuestMapGlobals.FishingSpotPosTable.get('%s_%s_english' % (ToontownGlobals.dnaMap[hoodId], zoneId))
self.cogInfoPos = QuestMapGlobals.CogInfoPosTable.get('%s_%s_english' % (ToontownGlobals.dnaMap[hoodId], zoneId))
self.cogInfoFrame.setPos(self.cogInfoPos)
self.hide()
self.hoodId = hoodId
self.zoneId = zoneId
self.updateQuestInfo()
self.updateCogInfo()
taskMgr.add(self.update, 'questMapUpdate')
else:
self.stop()
mapsGeom.removeNode()
示例11: setup
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def setup(self):
self.dnaStore = base.cr.playGame.dnaStore
self.randomGenerator = random.Random()
self.randomGenerator.seed(self.zoneId)
self.interior = loader.loadModel(
'phase_4/models/modules/gagShop_interior')
self.interior.reparentTo(render)
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId)
self.colors = ToonInteriorColors.colors[hoodId]
self.replaceRandomInModel(self.interior)
door = self.chooseDoor()
doorOrigin = render.find('**/door_origin;+s')
doorNP = door.copyTo(doorOrigin)
doorOrigin.setScale(0.8, 0.8, 0.8)
doorOrigin.setPos(doorOrigin, 0, -0.025, 0)
doorColor = self.randomGenerator.choice(self.colors['TI_door'])
DNADoor.setupDoor(doorNP, self.interior, doorOrigin,
self.dnaStore, str(self.block), doorColor)
doorFrame = doorNP.find('door_*_flat')
doorFrame.wrtReparentTo(self.interior)
doorFrame.setColor(doorColor)
del self.colors
del self.dnaStore
del self.randomGenerator
self.interior.flattenMedium()
示例12: setup
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def setup(self):
self.dnaStore = base.cr.playGame.dnaStore
self.randomGenerator = random.Random()
self.randomGenerator.seed(self.zoneId)
self.interior = loader.loadModel('phase_3.5/models/modules/toon_interior_tutorial')
self.interior.reparentTo(render)
dnaStore = DNAStorage()
node = loader.loadDNAFile(self.cr.playGame.hood.dnaStore, 'phase_3.5/dna/tutorial_street.pdna')
self.street = render.attachNewNode(node)
self.street.flattenMedium()
self.street.setPosHpr(-17, 42, -0.5, 180, 0, 0)
self.street.find('**/tb2:toon_landmark_TT_A1_DNARoot').stash()
self.street.find('**/tb1:toon_landmark_hqTT_DNARoot/**/door_flat_0').stash()
self.street.findAllMatches('**/+CollisionNode').stash()
self.skyFile = 'phase_3.5/models/props/TT_sky'
self.sky = loader.loadModel(self.skyFile)
self.sky.setScale(0.8)
self.sky.reparentTo(render)
self.sky.setDepthTest(0)
self.sky.setDepthWrite(0)
self.sky.setBin('background', 100)
self.sky.find('**/Sky').reparentTo(self.sky, -1)
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId)
self.colors = ToonInteriorColors.colors[hoodId]
self.replaceRandomInModel(self.interior)
doorModelName = 'door_double_round_ul'
if doorModelName[-1:] == 'r':
doorModelName = doorModelName[:-1] + 'l'
else:
doorModelName = doorModelName[:-1] + 'r'
door = self.dnaStore.findNode(doorModelName)
door_origin = render.find('**/door_origin;+s')
doorNP = door.copyTo(door_origin)
door_origin.setScale(0.8, 0.8, 0.8)
door_origin.setPos(door_origin, 0, -0.025, 0)
color = self.randomGenerator.choice(self.colors['TI_door'])
setupDoor(doorNP, self.interior, door_origin, self.dnaStore, str(self.block), color)
doorFrame = doorNP.find('door_*_flat')
doorFrame.wrtReparentTo(self.interior)
doorFrame.setColor(color)
del self.colors
del self.dnaStore
del self.randomGenerator
self.interior.flattenMedium()
npcOrigin = self.interior.find('**/npc_origin_' + `(self.cr.doId2do[self.npcId].posIndex)`)
if not npcOrigin.isEmpty():
self.cr.doId2do[self.npcId].reparentTo(npcOrigin)
self.cr.doId2do[self.npcId].clearMat()
self.createSuit()
base.localAvatar.setPosHpr(-2, 12, 0, -10, 0, 0)
self.cr.doId2do[self.npcId].setChatAbsolute(TTLocalizer.QuestScript101_0, CFSpeech)
place = base.cr.playGame.getPlace()
if place and hasattr(place, 'fsm') and place.fsm.getCurrentState().getName():
self.notify.info('Tutorial movie: Place ready.')
self.playMovie()
else:
self.notify.info('Tutorial movie: Waiting for place=%s, has fsm=%s' % (place, hasattr(place, 'fsm')))
if hasattr(place, 'fsm'):
self.notify.info('Tutorial movie: place state=%s' % place.fsm.getCurrentState().getName())
self.acceptOnce('enterTutorialInterior', self.playMovie)
示例13: updateQuestInfo
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def updateQuestInfo(self):
for marker in self.buildingMarkers:
marker.destroy()
self.buildingMarkers = []
dnaData = base.cr.playGame.dnaData
for questIndex in self.av.questPage.quests.keys():
questDesc = self.av.questPage.quests.get(questIndex)
if questDesc is None:
continue
mapIndex = questIndex + 1
questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc
quest = Quests.getQuest(questId)
fComplete = quest.getCompletionStatus(self.av, questDesc) == Quests.COMPLETE
if not fComplete:
if quest.getType() == Quests.RecoverItemQuest:
if quest.getHolder() == Quests.AnyFish:
self.putBuildingMarker(self.fishingSpotInfo, mapIndex=mapIndex)
continue
elif quest.getType() != Quests.DeliverGagQuest and quest.getType() != Quests.DeliverItemQuest and quest.getType() != Quests.VisitQuest and quest.getType() != Quests.TrackChoiceQuest:
continue
if toNpcId == Quests.ToonHQ:
self.putBuildingMarker(self.hqPosInfo, mapIndex=mapIndex)
else:
npcZone = NPCToons.getNPCZone(toNpcId)
hoodId = ZoneUtil.getCanonicalHoodId(npcZone)
branchId = ZoneUtil.getCanonicalBranchZone(npcZone)
if self.hoodId == hoodId and self.zoneId == branchId:
for blockId, block in dnaData.getBlocks():
zone = block.zone
branchZone = zone - zone % 100
finalZone = branchZone + 500 + blockId
if npcZone == finalZone:
building = block.node
self.putBuildingMarker(Point3(building.getPos()), building.getHpr(), mapIndex=mapIndex)
示例14: setup
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def setup(self):
self.dnaStore = base.cr.playGame.dnaStore
self.randomGenerator = random.Random()
self.randomGenerator.seed(self.zoneId)
interior = self.randomDNAItem("TI_hall", self.dnaStore.findNode)
self.interior = interior.copyTo(render)
hoodId = ZoneUtil.getCanonicalHoodId(self.zoneId)
self.colors = ToonInteriorColors.colors[hoodId]
self.replaceRandomInModel(self.interior)
doorModelName = "door_double_round_ul"
if doorModelName[-1:] == "r":
doorModelName = doorModelName[:-1] + "l"
else:
doorModelName = doorModelName[:-1] + "r"
door = self.dnaStore.findNode(doorModelName)
door_origin = render.find("**/door_origin;+s")
doorNP = door.copyTo(door_origin)
door_origin.setScale(0.8, 0.8, 0.8)
door_origin.setPos(door_origin, 0, -0.025, 0)
color = self.randomGenerator.choice(self.colors["TI_door"])
DNADoor.setupDoor(doorNP, self.interior, door_origin, self.dnaStore, str(self.block), color)
doorFrame = doorNP.find("door_*_flat")
doorFrame.wrtReparentTo(self.interior)
doorFrame.setColor(color)
del self.colors
del self.dnaStore
del self.randomGenerator
self.interior.flattenMedium()
self.sillyFSM.enterInitialState()
示例15: replaceStreetSignTextures
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import getCanonicalHoodId [as 别名]
def replaceStreetSignTextures(self):
if not hasattr(base.cr, "playGame"):
return None
place = base.cr.playGame.getPlace()
if place is None:
return None
geom = base.cr.playGame.getPlace().loader.geom
signs = geom.findAllMatches("**/*tunnelAheadSign*;+s")
if signs.getNumPaths() > 0:
streetSign = base.cr.streetSign
signTexturePath = streetSign.StreetSignBaseDir + "/" + streetSign.StreetSignFileName
loaderTexturePath = Filename(str(signTexturePath))
alphaPath = "phase_4/maps/tt_t_ara_gen_tunnelAheadSign_a.rgb"
inDreamland = False
if place.zoneId and ZoneUtil.getCanonicalHoodId(place.zoneId) == ToontownGlobals.DonaldsDreamland:
inDreamland = True
alphaPath = "phase_4/maps/tt_t_ara_gen_tunnelAheadSign_a.rgb"
if Filename(signTexturePath).exists():
signTexture = loader.loadTexture(loaderTexturePath, alphaPath)
for sign in signs:
if Filename(signTexturePath).exists():
sign.setTexture(signTexture, 1)
if inDreamland:
sign.setColorScale(0.52500000000000002, 0.52500000000000002, 0.52500000000000002, 1)
continue