本文整理汇总了Python中src.toontown.hood.ZoneUtil.getBranchZone方法的典型用法代码示例。如果您正苦于以下问题:Python ZoneUtil.getBranchZone方法的具体用法?Python ZoneUtil.getBranchZone怎么用?Python ZoneUtil.getBranchZone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类src.toontown.hood.ZoneUtil
的用法示例。
在下文中一共展示了ZoneUtil.getBranchZone方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enter
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
def enter(self, requestStatus, visibilityFlag = 1, arrowsOn = 1):
teleportDebug(requestStatus, 'Street.enter(%s)' % (requestStatus,))
self._ttfToken = None
self.fsm.enterInitialState()
base.playMusic(self.loader.music, looping=1, volume=0.8)
self.loader.geom.reparentTo(render)
if visibilityFlag:
self.visibilityOn()
base.localAvatar.setGeom(self.loader.geom)
base.localAvatar.setOnLevelGround(1)
self._telemLimiter = TLGatherAllAvs('Street', RotationLimitToH)
NametagGlobals.setMasterArrowsOn(arrowsOn)
self.zone = ZoneUtil.getBranchZone(requestStatus['zoneId'])
def __lightDecorationOn__():
geom = base.cr.playGame.getPlace().loader.geom
self.halloweenLights = geom.findAllMatches('**/*light*')
self.halloweenLights += geom.findAllMatches('**/*lamp*')
self.halloweenLights += geom.findAllMatches('**/prop_snow_tree*')
for light in self.halloweenLights:
light.setColorScaleOff(1)
if base.cr.newsManager.isHolidayRunning(ToontownGlobals.HALLOWEEN) and self.loader.hood.spookySkyFile:
lightsOff = Sequence(LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(0.55, 0.55, 0.65, 1)), Func(self.loader.hood.startSpookySky))
lightsOff.start()
else:
self.loader.hood.startSky()
lightsOn = LerpColorScaleInterval(base.cr.playGame.hood.loader.geom, 0.1, Vec4(1, 1, 1, 1))
lightsOn.start()
self.accept('doorDoneEvent', self.handleDoorDoneEvent)
self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger)
self.enterZone(requestStatus['zoneId'])
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.loader.nodeList)
self.fsm.request(requestStatus['how'], [requestStatus])
示例2: enter
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
def enter(self, requestStatus):
CogHQExterior.CogHQExterior.enter(self, requestStatus)
for train in self.trains:
train.show()
# Load the CogHQ DNA file:
dnaStore = DNAStorage()
dnaFileName = self.genDNAFileName(self.zoneId)
loadDNAFileAI(dnaStore, dnaFileName)
# Collect all of the vis group zone IDs:
self.zoneVisDict = {}
for i in xrange(dnaStore.getNumDNAVisGroupsAI()):
groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i)
visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
visibles = []
for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i)))
visibles.append(ZoneUtil.getBranchZone(visZoneId))
self.zoneVisDict[visZoneId] = visibles
# Next, we want interest in all vis groups due to this being a Cog HQ:
base.cr.sendSetZoneMsg(self.zoneId, self.zoneVisDict.values()[0])
示例3: handleToonInteriorDone
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
def handleToonInteriorDone(self):
status = self.place.doneStatus
if ZoneUtil.getBranchZone(status['zoneId']) == self.hood.hoodId and status['shardId'] == None:
self.fsm.request('quietZone', [status])
else:
self.doneStatus = status
messenger.send(self.doneEvent)
return
示例4: streetDone
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
def streetDone(self):
self.requestStatus = self.place.doneStatus
status = self.place.doneStatus
if status['loader'] == 'townLoader' and ZoneUtil.getBranchZone(status['zoneId']) == self.branchZone and status['shardId'] == None:
self.fsm.request('quietZone', [status])
else:
self.doneStatus = status
messenger.send(self.doneEvent)
return
示例5: handlePlaygroundDone
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
def handlePlaygroundDone(self):
status = self.place.doneStatus
if self.enteringARace(status) and status.get('shardId') == None:
zoneId = status['zoneId']
self.fsm.request('quietZone', [status])
elif ZoneUtil.getBranchZone(status['zoneId']) == self.hood.hoodId and status['shardId'] == None:
self.fsm.request('quietZone', [status])
else:
self.doneStatus = status
messenger.send(self.doneEvent)
示例6: handlePlaygroundDone
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
def handlePlaygroundDone(self):
status = self.place.doneStatus
teleportDebug(status, 'handlePlaygroundDone, doneStatus=%s' % (status,))
if ZoneUtil.getBranchZone(status['zoneId']) == self.hood.hoodId and status['shardId'] == None:
teleportDebug(status, 'same branch')
self.fsm.request('quietZone', [status])
else:
self.doneStatus = status
teleportDebug(status, 'different hood')
messenger.send(self.doneEvent)
return
示例7: load
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
def load(self, zoneId):
self.zoneId = zoneId
self.parentFSMState.addChild(self.fsm)
self.loadBattleAnims()
self.branchZone = ZoneUtil.getBranchZone(zoneId)
self.canonicalBranchZone = ZoneUtil.getCanonicalBranchZone(zoneId)
self.music = base.loadMusic(self.musicFile)
self.activityMusic = base.loadMusic(self.activityMusicFile)
self.battleMusic = base.loadMusic('phase_3.5/audio/bgm/encntr_general_bg.ogg')
self.townBattle = TownBattle.TownBattle(self.townBattleDoneEvent)
self.townBattle.load()
示例8: recoverItems
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
def recoverItems(self, av, suitsKilled, taskZoneId):
# Get the avatars current quests.
avQuests = av.getQuests()
questList = []
recoveredItems = []
unrecoveredItems = []
taskZoneId = ZoneUtil.getBranchZone(taskZoneId)
# Iterate through the avatars current quests.
for i in xrange(0, len(avQuests), 5):
questDesc = avQuests[i : i + 5]
questClass = Quests.getQuest(questDesc[QuestIdIndex], av.doId)
# Check if the Quest isnt already complete
if questClass.getCompletionStatus(av, questDesc) == Quests.INCOMPLETE:
# Check if we are dealing with a RecoverItemQuest
if isinstance(questClass, Quests.RecoverItemQuest):
# Iterate through all the Cogs that were killed in the battle
for suit in suitsKilled:
# Because the RecoveItemQuest class doesn't have a
# function to see if a Cog counts. We need to manually
# check if the Cog is valid for the Quest
if (questClass.getHolder() == Quests.Any) or \
(questClass.getHolderType() == 'type' and \
questClass.getHolder() == suit['type']) or \
(questClass.getHolderType() == 'track' and \
questClass.getHolder() == suit['track']) or \
(questClass.getHolderType() == 'level' and \
questClass.getHolder() <= suit['level']):
# It looks like the Cog was valid. Lets see if they
# found what they were looking for.
baseChance = questClass.getPercentChance()
amountRemaining = questClass.getNumItems() - questDesc[QuestProgressIndex]
chance = Quests.calcRecoverChance(amountRemaining, baseChance)
# They found it! Give them their reward!
if chance >= baseChance:
questDesc[QuestProgressIndex] += 1
recoveredItems.append(questClass.getItem())
# Better luck next time :(
else:
unrecoveredItems.append(questClass.getItem())
questList.append(questDesc)
av.b_setQuests(questList)
return (recoveredItems, unrecoveredItems)
示例9: makeDictionaries
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
def makeDictionaries(self, dnaStore):
self.nodeDict = {}
self.zoneDict = {}
self.zoneVisDict = {}
self.nodeList = []
self.fadeInDict = {}
self.fadeOutDict = {}
a1 = Vec4(1, 1, 1, 1)
a0 = Vec4(1, 1, 1, 0)
numVisGroups = dnaStore.getNumDNAVisGroupsAI()
for i in xrange(numVisGroups):
groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i)
groupName = base.cr.hoodMgr.extractGroupName(groupFullName)
zoneId = int(groupName)
groupNode = self.geom.find('**/' + groupFullName)
if groupNode.isEmpty():
self.notify.error('Could not find visgroup')
else:
if ':' in groupName:
groupName = '%s%s' % (zoneId, groupName[groupName.index(':'):])
else:
groupName = '%s' % zoneId
groupNode.setName(groupName)
groupNode.flattenMedium()
self.nodeDict[zoneId] = []
self.nodeList.append(groupNode)
self.zoneDict[zoneId] = groupNode
visibles = []
for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i)))
visibles.append(ZoneUtil.getBranchZone(zoneId))
self.zoneVisDict[zoneId] = visibles
fadeDuration = 0.5
self.fadeOutDict[groupNode] = Sequence(Func(groupNode.setTransparency, 1), LerpColorScaleInterval(groupNode, fadeDuration, a0, startColorScale=a1), Func(groupNode.clearColorScale), Func(groupNode.clearTransparency), Func(groupNode.stash), name='fadeZone-' + str(zoneId), autoPause=1)
self.fadeInDict[groupNode] = Sequence(Func(groupNode.unstash), Func(groupNode.setTransparency, 1), LerpColorScaleInterval(groupNode, fadeDuration, a1, startColorScale=a0), Func(groupNode.clearColorScale), Func(groupNode.clearTransparency), name='fadeZone-' + str(zoneId), autoPause=1)
for i in xrange(numVisGroups):
groupFullName = dnaStore.getDNAVisGroupName(i)
zoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
for j in xrange(dnaStore.getNumVisiblesInDNAVisGroup(i)):
visName = dnaStore.getVisibleName(i, j)
groupName = base.cr.hoodMgr.extractGroupName(visName)
nextZoneId = int(groupName)
visNode = self.zoneDict[nextZoneId]
self.nodeDict[zoneId].append(visNode)
self.hood.dnaStore.resetPlaceNodes()
self.hood.dnaStore.resetDNAGroups()
self.hood.dnaStore.resetDNAVisGroups()
self.hood.dnaStore.resetDNAVisGroupsAI()
示例10: __teleportOutDone
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
def __teleportOutDone(self, requestStatus):
hoodId = requestStatus['hoodId']
zoneId = requestStatus['zoneId']
shardId = requestStatus['shardId']
if hoodId == self.loader.hood.id and shardId == None:
if zoneId == self.zoneId:
self.fsm.request('teleportIn', [requestStatus])
elif requestStatus['where'] == 'street' and ZoneUtil.getBranchZone(zoneId) == self.loader.branchZone:
self.fsm.request('quietZone', [requestStatus])
else:
self.doneStatus = requestStatus
messenger.send(self.doneEvent)
elif hoodId == ToontownGlobals.MyEstate:
self.getEstateZoneAndGoHome(requestStatus)
else:
self.doneStatus = requestStatus
messenger.send(self.doneEvent)
return
示例11: toonKilledBuilding
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
def toonKilledBuilding(self, av, type, difficulty, floors, zoneId, cogdo):
# Get the avatars current quests.
avQuests = av.getQuests()
questList = []
zoneId = ZoneUtil.getBranchZone(zoneId)
# Iterate through the avatars current quests.
for i in xrange(0, len(avQuests), 5):
questDesc = avQuests[i : i + 5]
questClass = Quests.getQuest(questDesc[QuestIdIndex], av.doId)
if isinstance(questClass, Quests.BuildingQuest) and questClass.getCompletionStatus(av, questDesc) == Quests.INCOMPLETE:
if questClass.isLocationMatch(zoneId) and questClass.doesBuildingTypeCount(type):
if questClass.isCogdo() == cogdo:
if floors >= questClass.getNumFloors():
questDesc[QuestProgressIndex] += 1
questList.append(questDesc)
av.b_setQuests(questList)
示例12: enter
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
def enter(self, requestStatus):
self.zoneId = requestStatus['zoneId']
# Load the CogHQ DNA file:
dnaStore = DNAStorage()
dnaFileName = self.genDNAFileName(self.zoneId)
if not dnaFileName.endswith('13200.pdna'):
loadDNAFileAI(dnaStore, dnaFileName)
# Collect all of the vis group zone IDs:
self.zoneVisDict = {}
for i in xrange(dnaStore.getNumDNAVisGroupsAI()):
groupFullName = dnaStore.getDNAVisGroupName(i)
visGroup = dnaStore.getDNAVisGroupAI(i)
visZoneId = int(base.cr.hoodMgr.extractGroupName(groupFullName))
visibles = []
for i in xrange(visGroup.getNumVisibles()):
visibles.append(int(visGroup.getVisible(i)))
visibles.append(ZoneUtil.getBranchZone(visZoneId))
self.zoneVisDict[visZoneId] = visibles
# Next, we want interest in all vis groups due to this being a Cog HQ:
base.cr.sendSetZoneMsg(self.zoneId, self.zoneVisDict.values()[0])
BattlePlace.BattlePlace.enter(self)
self.fsm.enterInitialState()
base.playMusic(self.loader.music, looping=1, volume=0.8)
self.loader.geom.reparentTo(render)
self.nodeList = [self.loader.geom]
self.loader.hood.startSky()
self._telemLimiter = TLGatherAllAvs('FactoryExterior', RotationLimitToH)
self.accept('doorDoneEvent', self.handleDoorDoneEvent)
self.accept('DistributedDoor_doorTrigger', self.handleDoorTrigger)
NametagGlobals.setMasterArrowsOn(1)
self.tunnelOriginList = base.cr.hoodMgr.addLinkTunnelHooks(self, self.nodeList)
how = requestStatus['how']
self.fsm.request(how, [requestStatus])
示例13: begin
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
#.........这里部分代码省略.........
ToontownGlobals.CashbotHQ: ToontownGlobals.getSuitFont(),
ToontownGlobals.LawbotHQ: ToontownGlobals.getSuitFont(),
ToontownGlobals.BossbotHQ: ToontownGlobals.getSuitFont(),
}
self.zone2fontcolor = {
ToontownGlobals.GoofySpeedway: VBase4(0.2, 0.6, 0.9, 1.0),
ToontownGlobals.ToontownCentral: VBase4(0.9803921568627451, 0.8235294117647059, 0.0392156862745098, 1.0),
ToontownGlobals.SillyStreet: VBase4(0.9803921568627451, 0.8235294117647059, 0.0392156862745098, 1.0),
ToontownGlobals.LoopyLane: VBase4(0.9803921568627451, 0.8235294117647059, 0.0392156862745098, 1.0),
ToontownGlobals.PunchlinePlace: VBase4(0.9803921568627451, 0.8235294117647059, 0.0392156862745098, 1.0),
ToontownGlobals.DonaldsDock: VBase4(0.6901960784313725, 0.4274509803921569, 0.0549019607843137, 1.0),
ToontownGlobals.BarnacleBoulevard: VBase4(0.6901960784313725, 0.4274509803921569, 0.0549019607843137, 1.0),
ToontownGlobals.SeaweedStreet: VBase4(0.6901960784313725, 0.4274509803921569, 0.0549019607843137, 1.0),
ToontownGlobals.LighthouseLane: VBase4(0.6901960784313725, 0.4274509803921569, 0.0549019607843137, 1.0),
ToontownGlobals.DaisyGardens: VBase4(0.1647058823529412, 0.7490196078431373, 0.4509803921568627, 1.0),
ToontownGlobals.ElmStreet: VBase4(0.1647058823529412, 0.7490196078431373, 0.4509803921568627, 1.0),
ToontownGlobals.MapleStreet: VBase4(0.1647058823529412, 0.7490196078431373, 0.4509803921568627, 1.0),
ToontownGlobals.OakStreet: VBase4(0.1647058823529412, 0.7490196078431373, 0.4509803921568627, 1.0),
ToontownGlobals.MinniesMelodyland: VBase4(0.9294117647058824, 0.0196078431372549, 0.7333333333333333, 1.0),
ToontownGlobals.AltoAvenue: VBase4(0.9294117647058824, 0.0196078431372549, 0.7333333333333333, 1.00),
ToontownGlobals.BaritoneBoulevard: VBase4(0.9294117647058824, 0.0196078431372549, 0.7333333333333333, 1.0),
ToontownGlobals.TenorTerrace: VBase4(0.9294117647058824, 0.0196078431372549, 0.7333333333333333, 1.0),
ToontownGlobals.TheBrrrgh: VBase4(0.792156862745098, 0.8823529411764706, 1.0, 1.0),
ToontownGlobals.WalrusWay: VBase4(0.792156862745098, 0.8823529411764706, 1.0, 1.0),
ToontownGlobals.SleetStreet: VBase4(0.792156862745098, 0.8823529411764706, 1.0, 1.0),
ToontownGlobals.PolarPlace: VBase4(0.792156862745098, 0.8823529411764706, 1.0, 1.0),
ToontownGlobals.DonaldsDreamland: VBase4(0.4313725490196078, 0.196078431372549, 0.7607843137254902, 1.0),
ToontownGlobals.LullabyLane: VBase4(0.4313725490196078, 0.196078431372549, 0.7607843137254902, 1.0),
ToontownGlobals.PajamaPlace: VBase4(0.4313725490196078, 0.196078431372549, 0.7607843137254902, 1.0),
ToontownGlobals.OutdoorZone: VBase4(0.4313725490196078, 0.196078431372549, 0.7607843137254902, 1.0),
ToontownGlobals.GolfZone: VBase4(0.2, 0.6, 0.9, 1.0),
ToontownGlobals.SellbotHQ: (0.0056754360035471, 0.0666666666666667, 0.9607843137254902, 1.0),
ToontownGlobals.SellbotFactoryExt: (0.0056754360035471, 0.0666666666666667, 0.9607843137254902, 1.0),
ToontownGlobals.SellbotFactoryInt: (0.0056754360035471, 0.0666666666666667, 0.9607843137254902, 1.0),
ToontownGlobals.SellbotMegaCorpInt: ((0.0056754360035471, 0.0666666666666667, 0.9607843137254902, 1.0)),
ToontownGlobals.CashbotHQ: (0.2274509803921569, 0.7215686274509804, 0.0509803921568627, 1.0),
ToontownGlobals.LawbotHQ: (0.1294117647058824, 0.2549019607843137, 0.8705882352941176, 1.0),
ToontownGlobals.BossbotHQ: (0.7215686274509804, 0.5098039215686275, 0.2509803921568627, 1.0),
}
self.waitBar["range"] = range
self.title["text"] = label
self.loadingScreenTex = self.zone2picture.get(ZoneUtil.getBranchZone(zoneId), self.defaultTex)
self.loadingScreenFont = self.zone2font.get(ZoneUtil.getBranchZone(zoneId), self.defaultFont)
self.loadingScreenFontColor = self.zone2fontcolor.get(ZoneUtil.getBranchZone(zoneId), self.defaultFontColor)
self.background = loader.loadTexture(self.loadingScreenTex)
self.__count = 0
self.__expectedCount = range
if gui:
if base.localAvatarStyle:
from src.toontown.toon import Toon
wave = {"emote": "wave", "frame": 25}
shrug = {"emote": "shrug", "frame": 30}
duck = {"emote": "duck", "frame": 40}
up = {"emote": "up", "frame": 60}
pushup = {"emote": "down", "frame": 23}
bow = {"emote": "bow", "frame": 45}
bored = {"emote": "bored", "frame": 135}
run = {"emote": "run", "frame": 7}
victory = {"emote": "victory", "frame": 10}
applause = {"emote": "applause", "frame": 23}
dust = {"emote": "sprinkle-dust", "frame": 40}
hypno = {"emote": "hypnotize", "frame": 25}
cringe = {"emote": "cringe", "frame": 25}
emotelist = [wave, shrug, duck, up, pushup, bow, bored, run, victory, applause, dust, hypno, cringe]
emotechosen = random.choice(emotelist)
self.toon = Toon.Toon()
self.toon.setDNA(base.localAvatarStyle)
self.toon.pose(emotechosen["emote"], emotechosen["frame"])
self.toon.getGeomNode().setDepthWrite(1)
self.toon.getGeomNode().setDepthTest(1)
self.toon.setHpr(205, 0, 0)
self.toon.setScale(0.18)
self.toon.setPos(base.a2dBottomRight.getX() / 1.25, 0, -0.034)
self.toon.reparentTo(self.waitBar)
self.waitBar["frameSize"] = (
base.a2dLeft + (base.a2dRight / 4.95),
base.a2dRight - (base.a2dRight / 4.95),
-0.03,
0.03,
)
self.title["text_font"] = self.loadingScreenFont
self.title["text_fg"] = self.loadingScreenFontColor
self.title.reparentTo(base.a2dpBottomLeft, LOADING_SCREEN_SORT_INDEX)
self.title.setPos(base.a2dRight / 5, 0, 0.235)
self.tip["text"] = self.getTip(tipCategory)
self.gui.setPos(0, -0.1, 0)
self.gui.reparentTo(aspect2d, LOADING_SCREEN_SORT_INDEX)
self.gui.setTexture(self.background, 1)
# if self.loadingScreenTex == self.defaultTex:
# self.logo.reparentTo(base.a2dpTopCenter, LOADING_SCREEN_SORT_INDEX)
self.logo.reparentTo(base.a2dpTopCenter, LOADING_SCREEN_SORT_INDEX)
else:
self.title.reparentTo(base.a2dpBottomLeft, LOADING_SCREEN_SORT_INDEX)
self.gui.reparentTo(hidden)
self.logo.reparentTo(hidden)
self.tip.reparentTo(base.a2dpBottomCenter, LOADING_SCREEN_SORT_INDEX)
self.waitBar.reparentTo(base.a2dpBottomCenter, LOADING_SCREEN_SORT_INDEX)
self.waitBar.update(self.__count)
示例14: update
# 需要导入模块: from src.toontown.hood import ZoneUtil [as 别名]
# 或者: from src.toontown.hood.ZoneUtil import getBranchZone [as 别名]
def update(self, questDesc):
questId, fromNpcId, toNpcId, rewardId, toonProgress = questDesc
quest = Quests.getQuest(questId)
self.teleportButton['command'] = self.teleportToShop
self.teleportButton['extraArgs'] = [toNpcId]
if quest == None:
self.notify.warning('Tried to display poster for unknown quest %s' % questId)
return
if rewardId == Quests.NA:
finalReward = Quests.getFinalRewardId(questId, fAll=1)
transformedReward = Quests.transformReward(finalReward, base.localAvatar)
reward = Quests.getReward(transformedReward)
else:
reward = Quests.getReward(rewardId)
if reward and questId not in Quests.NoRewardTierZeroQuests:
rewardString = reward.getPosterString()
else:
rewardString = ''
self.rewardText['text'] = rewardString
self.fitLabel(self.rewardText)
if Quests.isQuestJustForFun(questId, rewardId):
self.funQuest.show()
else:
self.funQuest.hide()
if self._deleteCallback:
self.showDeleteButton(questDesc)
else:
self.hideDeleteButton()
if self.laffMeter:
self.laffMeter.destroy()
fComplete = quest.getCompletionStatus(base.localAvatar, questDesc) == Quests.COMPLETE
if Quests.isQuestJustForFun(questId, rewardId):
if fComplete:
self.funQuest.hide()
self.teleportButton.show()
else:
self.teleportButton.hide()
if toNpcId == Quests.ToonHQ:
self.teleportButton.show()
self.teleportButton.setPos(0.285, 0, -0.15)
toNpcName = TTLocalizer.QuestPosterHQOfficer
toNpcBuildingName = TTLocalizer.QuestPosterHQBuildingName
toNpcStreetName = TTLocalizer.QuestPosterHQStreetName
toNpcLocationName = TTLocalizer.QuestPosterHQLocationName
elif toNpcId == Quests.ToonTailor:
self.teleportButton.show()
self.teleportButton.setPos(0.285, 0, -0.15)
toNpcName = TTLocalizer.QuestPosterTailor
toNpcBuildingName = TTLocalizer.QuestPosterTailorBuildingName
toNpcStreetName = TTLocalizer.QuestPosterTailorStreetName
toNpcLocationName = TTLocalizer.QuestPosterTailorLocationName
else:
self.teleportButton.show()
self.teleportButton.setPos(0.285, 0, -0.15)
toNpcName = NPCToons.getNPCName(toNpcId)
toNpcZone = NPCToons.getNPCZone(toNpcId)
toNpcHoodId = ZoneUtil.getCanonicalHoodId(toNpcZone)
toNpcLocationName = base.cr.hoodMgr.getFullnameFromId(toNpcHoodId)
toNpcBuildingName = NPCToons.getBuildingTitle(toNpcZone)
toNpcBranchId = ZoneUtil.getBranchZone(toNpcZone)
toNpcStreetName = ZoneUtil.getStreetName(toNpcBranchId)
lPos = Vec3(0, 0, 0.13)
lIconGeom = None
lIconGeomScale = 1
rIconGeom = None
rIconGeomScale = 1
infoText = ''
infoZ = TTLocalizer.QPinfoZ
auxText = None
auxTextPos = Vec3(0, 0, 0.12)
headlineString = quest.getHeadlineString()
objectiveStrings = quest.getObjectiveStrings()
captions = map(string.capwords, quest.getObjectiveStrings())
imageColor = Vec4(*self.colors['white'])
if isinstance(quest, Quests.TexturedQuest) and quest.hasFrame():
self.teleportButton.hide()
frame = quest.getFrame()
frameBgColor = frame[1]
lIconGeom = frame[0]
lIconGeomScale = 0.13
if not fComplete:
infoText = quest.getLocationName()
if infoText == '':
infoText = TTLocalizer.QuestPosterAnywhere
elif quest.getType() == Quests.DeliverGagQuest or quest.getType() == Quests.DeliverItemQuest:
frameBgColor = 'red'
if fComplete:
self.teleportButton.show()
self.teleportButton.setPos(0.175, 0, -0.125)
if quest.getType() == Quests.DeliverGagQuest:
invModel = loader.loadModel('phase_3.5/models/gui/inventory_icons')
track, item = quest.getGagType()
lIconGeom = invModel.find('**/' + AvPropsNew[track][item])
invModel.removeNode()
else:
bookModel = loader.loadModel('phase_3.5/models/gui/stickerbook_gui')
#.........这里部分代码省略.........