本文整理汇总了Python中toontown.hood.ZoneUtil.isPlayground方法的典型用法代码示例。如果您正苦于以下问题:Python ZoneUtil.isPlayground方法的具体用法?Python ZoneUtil.isPlayground怎么用?Python ZoneUtil.isPlayground使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类toontown.hood.ZoneUtil
的用法示例。
在下文中一共展示了ZoneUtil.isPlayground方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: enter
# 需要导入模块: from toontown.hood import ZoneUtil [as 别名]
# 或者: from toontown.hood.ZoneUtil import isPlayground [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()