本文整理汇总了Python中toontown.toonbase.ToontownGlobals类的典型用法代码示例。如果您正苦于以下问题:Python ToontownGlobals类的具体用法?Python ToontownGlobals怎么用?Python ToontownGlobals使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ToontownGlobals类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setupButtons
def setupButtons(self):
gui = loader.loadModel('phase_3/models/gui/tt_m_gui_mat_mainGui')
arrowImage = (gui.find('**/tt_t_gui_mat_shuffleArrowUp'), gui.find('**/tt_t_gui_mat_shuffleArrowDown'))
buttonImage = (gui.find('**/tt_t_gui_mat_shuffleUp'), gui.find('**/tt_t_gui_mat_shuffleDown'))
self.title = DirectLabel(aspect2d, relief=None, text=TTLocalizer.GloveGuiTitle,
text_fg=(0, 1, 0, 1), text_scale=0.15, text_font=ToontownGlobals.getSignFont(),
pos=(0, 0, -0.30), text_shadow=(1, 1, 1, 1))
self.notice = DirectLabel(aspect2d, relief=None, text='', text_fg=(1, 0, 0, 1), text_scale=0.11,
text_font=ToontownGlobals.getSignFont(), pos=(0, 0, -0.45), text_shadow=(1, 1, 1, 1))
self.color = DirectLabel(aspect2d, relief=None, text='', text_scale=0.11, text_font=ToontownGlobals.getSignFont(),
pos=(0, 0, -0.70), text_shadow=(1, 1, 1, 1))
self.buyButton = DirectButton(aspect2d, relief=None, image=buttonImage, text=TTLocalizer.GloveGuiBuy,
text_font=ToontownGlobals.getInterfaceFont(), text_scale=0.11, text_pos=(0, -0.02),
pos=(-0.60, 0, -0.90), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1), command=self.__exit, extraArgs=[GloveNPCGlobals.CHANGE])
self.cancelButton = DirectButton(aspect2d, relief=None, image=buttonImage, text=TTLocalizer.lCancel,
text_font=ToontownGlobals.getInterfaceFont(), text_scale=0.11, text_pos=(0, -0.02),
pos=(0.60, 0, -0.90), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1), command=self.__exit, extraArgs=[GloveNPCGlobals.USER_CANCEL])
self.downArrow = DirectButton(aspect2d, relief=None, image=arrowImage, pos=(-0.60, 0, -0.66))
self.upArrow = DirectButton(aspect2d, relief=None, image=arrowImage, pos=(0.60, 0, -0.66), scale=-1)
gui.removeNode()
开发者ID:ponyboy837,项目名称:ToontownStride,代码行数:27,代码来源:GloveShopGui.py
示例2: __createNametag
def __createNametag(self, parent):
if self.nametagGroup == None:
self.nametagGroup = NametagGroup()
self.nametagGroup.setFont(ToontownGlobals.getToonFont())
self.nametagGroup.setSpeechFont(ToontownGlobals.getToonFont())
self.nametagGroup.setActive(0)
self.nametagGroup.setAvatar(self.partyPlannerHead)
self.nametagGroup.manage(base.marginManager)
self.nametagGroup.setColorCode(self.nametagGroup.CCNonPlayer)
self.nametagGroup.getNametag2d().setContents(0)
self.nametagNode = NametagFloat2d()
self.nametagNode.setContents(Nametag.CName)
self.nametagGroup.addNametag(self.nametagNode)
self.nametagGroup.setName(base.cr.partyManager.getPartyPlannerName())
self.nametagNP = parent.attachNewNode(self.nametagNode)
nametagPos = self.gui.find('**/step_01_partymanPeteNametag_locator').getPos()
self.nametagNP.setPosHprScale(nametagPos[0], 0, nametagPos[2], 0, 0, 0, 0.1, 1, 0.1)
self.chatNode = NametagFloat2d()
self.chatNode.setContents(Nametag.CSpeech | Nametag.CThought)
self.nametagGroup.addNametag(self.chatNode)
self.nametagGroup.setChat(TTLocalizer.PartyPlannerInstructions, CFSpeech)
self.chatNP = parent.attachNewNode(self.chatNode)
chatPos = self.gui.find('**/step_01_partymanPeteText_locator').getPos()
self.chatNP.setPosHprScale(chatPos[0], 0, chatPos[2], 0, 0, 0, 0.08, 1, 0.08)
return
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:25,代码来源:PartyPlanner.py
示例3: __init__
def __init__(self, cr):
DistributedObject.DistributedObject.__init__(self, cr)
Level.Level.__init__(self)
self.lastToonZone = None
self.lastCamZone = 0
self.titleColor = (1, 1, 1, 1)
self.titleText = OnscreenText.OnscreenText(
"",
fg=self.titleColor,
shadow=(0, 0, 0, 1),
font=ToontownGlobals.getSuitFont(),
pos=(0, -0.5),
scale=0.16,
drawOrder=0,
mayChange=1,
)
self.smallTitleText = OnscreenText.OnscreenText(
"",
fg=self.titleColor,
font=ToontownGlobals.getSuitFont(),
pos=(0.65000000000000002, 0.90000000000000002),
scale=0.080000000000000002,
drawOrder=0,
mayChange=1,
bg=(0.5, 0.5, 0.5, 0.5),
align=TextNode.ARight,
)
self.zonesEnteredList = []
self.fColorZones = 0
self.scenarioIndex = 0
开发者ID:OldToontown,项目名称:OldToontown,代码行数:30,代码来源:DistributedLevel.py
示例4: __init__
def __init__(self):
Avatar.Avatar.__init__(self)
self.setFont(ToontownGlobals.getSuitFont())
self.nametag.setSpeechFont(ToontownGlobals.getSuitFont())
self.setPlayerType(NametagGroup.CCSuit)
self.setPickable(0)
self.doorA = None
self.doorB = None
self.bubbleL = None
self.bubbleR = None
self.raised = 1
self.forward = 1
self.happy = 1
self.dizzy = 0
self.nowRaised = 1
self.nowForward = 1
self.nowHappy = 1
self.currentAnimIval = None
self.queuedAnimIvals = []
self.treadsLeftPos = 0
self.treadsRightPos = 0
self.healthBar = SuitHealthBar.SuitHealthBar()
self.animDoneEvent = 'BossCogAnimDone'
self.animIvalName = 'BossCogAnimIval'
self.warningSfx = loader.loadSfx('phase_9/audio/sfx/CHQ_GOON_tractor_beam_alarmed.ogg')
开发者ID:Kawaiikat14,项目名称:Toontown-2-Revised,代码行数:25,代码来源:BossCog.py
示例5: setFromAvatar
def setFromAvatar(self, av):
rewardIds = []
for q in av.quests:
questId, fromNpcId, toNpcId, rewardId, toonProgress = q
if rewardId == Quests.NA:
rewardId = Quests.getFinalRewardId(questId, fAll=1)
rewardIds.append(rewardId)
self.notify.debug('Ignoring rewards: %s' % rewardIds)
self.setRewardIndex(av.rewardTier, rewardIds, av.rewardHistory)
fishHp = int(len(av.fishCollection) / FishGlobals.FISH_PER_BONUS)
self.notify.debug('Adding %s hp for fish collection' % fishHp)
self.maxHp += fishHp
flowerHp = int(len(av.flowerCollection) / GardenGlobals.FLOWERS_PER_BONUS)
self.notify.debug('Adding %s hp for fish collection' % flowerHp)
self.maxHp += flowerHp
HQdepts = (ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.SellbotHQ), ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.LawbotHQ), ToontownGlobals.cogHQZoneId2deptIndex(ToontownGlobals.CashbotHQ))
levels = av.getCogLevels()
cogTypes = av.getCogTypes()
suitHp = 0
for dept in HQdepts:
suitHp += levels[dept]
self.notify.debug('Adding %s hp for cog suits' % suitHp)
self.maxHp += suitHp
kartingHp = int(av.kartingTrophies.count(1) / RaceGlobals.TrophiesPerCup)
self.notify.debug('Adding %s hp for karting trophies' % kartingHp)
self.maxHp += kartingHp
golfHp = int(av.golfTrophies.count(True) / GolfGlobals.TrophiesPerCup)
self.notify.debug('Adding %s hp for golf trophies' % golfHp)
self.maxHp += golfHp
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:31,代码来源:QuestRewardCounter.py
示例6: load
def load(self):
gui = loader.loadModel('phase_3/models/gui/tt_m_gui_mat_mainGui')
guiBoyUp = gui.find('**/tt_t_gui_mat_boyUp')
guiBoyDown = gui.find('**/tt_t_gui_mat_boyDown')
guiGirlUp = gui.find('**/tt_t_gui_mat_girlUp')
guiGirlDown = gui.find('**/tt_t_gui_mat_girlDown')
self.boyButton = DirectButton(relief=None, image=(guiBoyUp,
guiBoyDown,
guiBoyUp,
guiBoyDown), image_scale=halfButtonScale, image1_scale=halfButtonHoverScale, image2_scale=halfButtonHoverScale, pos=(-0.4, 0, -0.8), command=self.createRandomBoy, text=('',
TTLocalizer.GenderShopBoyButtonText,
TTLocalizer.GenderShopBoyButtonText,
''), text_font=ToontownGlobals.getInterfaceFont(), text_scale=0.08, text_pos=(0, 0.19), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1))
self.boyButton.hide()
self.girlButton = DirectButton(relief=None, image=(guiGirlUp,
guiGirlDown,
guiGirlUp,
guiGirlDown), image_scale=halfButtonScale, image1_scale=halfButtonHoverScale, image2_scale=halfButtonHoverScale, pos=(0.4, 0, -0.8), command=self.createRandomGirl, text=('',
TTLocalizer.GenderShopGirlButtonText,
TTLocalizer.GenderShopGirlButtonText,
''), text_font=ToontownGlobals.getInterfaceFont(), text_scale=0.08, text_pos=(0, 0.19), text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1))
self.girlButton.hide()
gui.removeNode()
del gui
self.toon = None
return
开发者ID:MasterLoopyBM,项目名称:c0d3,代码行数:26,代码来源:GenderShop.py
示例7: __init__
def __init__(self):
Avatar.Avatar.__init__(self)
self.setFont(ToontownGlobals.getSuitFont())
self.nametag.setSpeechFont(ToontownGlobals.getSuitFont())
self.setPlayerType(NametagGroup.CCSuit)
self.setPickable(0)
self.doorA = None
self.doorB = None
self.bubbleL = None
self.bubbleR = None
self.raised = 1
self.forward = 1
self.happy = 1
self.dizzy = 0
self.nowRaised = 1
self.nowForward = 1
self.nowHappy = 1
self.currentAnimIval = None
self.queuedAnimIvals = []
self.treadsLeftPos = 0
self.treadsRightPos = 0
self.healthBar = None
self.healthCondition = 0
self.animDoneEvent = 'BossCogAnimDone'
self.animIvalName = 'BossCogAnimIval'
self.attackSpeed = 1
return
开发者ID:RandomToon,项目名称:Toontown-2,代码行数:27,代码来源:BossCog.py
示例8: createGui
def createGui(self):
self.title = DirectLabel(aspect2d, relief=None, text=TTLocalizer.GloveGuiTitle,
text_fg=(0, 1, 0, 1), text_scale=0.15, text_font=ToontownGlobals.getSignFont(),
pos=(0, 0, -0.30), text_shadow=(1, 1, 1, 1))
self.notice = DirectLabel(aspect2d, relief=None, text=TTLocalizer.GloveGuiNotice % ToontownGlobals.GloveCost,
text_fg=(1, 0, 0, 1), text_scale=0.11, text_font=ToontownGlobals.getSignFont(),
pos=(0, 0, -0.45), text_shadow=(1, 1, 1, 1))
self.color = DirectLabel(aspect2d, relief=None, text='',
text_scale=0.11, text_font=ToontownGlobals.getSignFont(),
pos=(0, 0, -0.70), text_shadow=(1, 1, 1, 1))
self.buyButton = DirectButton(aspect2d, relief=None, image=(self.shuffleUp, self.shuffleDown),
text=TTLocalizer.GloveGuiBuy, text_font=ToontownGlobals.getInterfaceFont(),
text_scale=0.11, text_pos=(0, -0.02), pos=(-0.60, 0, -0.90), text_fg=(1, 1, 1, 1),
text_shadow=(0, 0, 0, 1), command=self.handleBuy)
self.cancelButton = DirectButton(aspect2d, relief=None, image=(self.shuffleUp, self.shuffleDown),
text=TTLocalizer.GloveGuiCancel, text_font=ToontownGlobals.getInterfaceFont(),
text_scale=0.11, text_pos=(0, -0.02), pos=(0.60, 0, -0.90), text_fg=(1, 1, 1, 1),
text_shadow=(0, 0, 0, 1), command=self.leave)
self.leftButton = DirectButton(aspect2d, relief=None, image=(self.shuffleArrowUp, self.shuffleArrowDown),
pos=(-0.60, 0, -0.66), command=self.handleSetIndex, extraArgs=[-1])
self.rightButton = DirectButton(aspect2d, relief=None, image=(self.shuffleArrowUp, self.shuffleArrowDown),
pos=(0.60, 0, -0.66), scale=-1, command=self.handleSetIndex, extraArgs=[1])
self.updateGuiByIndex()
开发者ID:Teku16,项目名称:Toontown-Crystal-Master,代码行数:30,代码来源:DistributedNPCGlove.py
示例9: __init__
def __init__(self, version='n/a'):
DirectObject.__init__(self)
self.backgroundNodePath = render2d.attachNewNode('background', 0)
self.backgroundModel = loader.loadModel(
'phase_3/models/gui/loading-background.bam')
self.backgroundModel.reparentTo(self.backgroundNodePath)
self.backgroundNodePath.find('**/fg').removeNode()
self.backgroundNodePath.setScale(1, 1, 1)
self.logo = OnscreenImage(
parent=base.a2dTopCenter, image='phase_3/maps/toontown-logo.png',
scale=(1.0, 1, 0.5), pos=(0, 0, -0.85))
self.logo.setTransparency(TransparencyAttrib.MAlpha)
self.label = OnscreenText(
TTLocalizer.ClickToStartLabel, parent=base.a2dBottomCenter,
font=ToontownGlobals.getMinnieFont(), fg=Vec4(1, 1, 1, 1),
scale=0.1, align=TextNode.ACenter)
self.label.setZ(0.35)
self.versionLabel = OnscreenText(
'\x01white_shadow\x01%s\x02' % version, parent=base.a2dBottomRight,
font=ToontownGlobals.getMinnieFont(), fg=Vec4(0, 0, 0, 1),
scale=0.06, align=TextNode.ARight)
self.versionLabel.setPos(-0.025, 0.025)
self.setColorScale(Vec4(0, 0, 0, 0))
self.fadeTrack = None
self.logoPosTrack = None
self.logoScaleTrack = None
self.labelPosTrack = None
self.labelColorScaleTrack = None
开发者ID:NostalgicTTR,项目名称:Toontown-Infinite-2016-Leak,代码行数:34,代码来源:ClickToStart.py
示例10: loadDnaStore
def loadDnaStore(self):
if not hasattr(self, 'dnaStore'):
self.dnaStore = DNAStorage()
loader.loadDNAFile(self.dnaStore, 'phase_4/dna/storage.dna')
self.dnaStore.storeFont('humanist', ToontownGlobals.getInterfaceFont())
self.dnaStore.storeFont('mickey', ToontownGlobals.getSignFont())
self.dnaStore.storeFont('suit', ToontownGlobals.getSuitFont())
loader.loadDNAFile(self.dnaStore, 'phase_3.5/dna/storage_interior.dna')
开发者ID:ponyboy837,项目名称:Toontown-2003-Server,代码行数:8,代码来源:PlayGame.py
示例11: getPicture
def getPicture(self, avatar):
frame = self.makeFrame()
if self.nametagStyle == 100:
inFont = ToontownGlobals.getToonFont()
else:
inFont = ToontownGlobals.getNametagFont(self.nametagStyle)
nameTagDemo = DirectLabel(parent=frame, relief=None, pos=(0, 0, 0.24), scale=0.5, text=localAvatar.getName(), text_fg=(1.0, 1.0, 1.0, 1), text_shadow=(0, 0, 0, 1), text_font=inFont, text_wordwrap=9)
self.hasPicture = True
return (frame, None)
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leaked-Source,代码行数:9,代码来源:CatalogNametagItem.py
示例12: loadDnaStore
def loadDnaStore(self):
if not hasattr(self, "dnaStore"):
self.dnaStore = DNAStorage()
files = ("phase_4/dna/storage.pdna", "phase_3.5/dna/storage_interior.pdna")
dnaBulk = DNABulkLoader(self.dnaStore, files)
dnaBulk.loadDNAFiles()
self.dnaStore.storeFont("humanist", ToontownGlobals.getInterfaceFont())
self.dnaStore.storeFont("mickey", ToontownGlobals.getSignFont())
self.dnaStore.storeFont("suit", ToontownGlobals.getSuitFont())
开发者ID:Teku16,项目名称:ToontownPlanet,代码行数:9,代码来源:PlayGame.py
示例13: loadGUI
def loadGUI(self):
self.gui = loader.loadModel("phase_13/models/parties/trampolineGUI")
self.gui.reparentTo(base.a2dTopLeft)
self.gui.setPos(0.115, 0, -1)
self.gui.hide()
self.toonIndicator = self.gui.find("**/trampolineGUI_MovingBar")
jumpLineLocator = self.gui.find("**/jumpLine_locator")
guiBean = self.gui.find("**/trampolineGUI_GreenJellyBean")
self.gui.find("**/trampolineGUI_GreenJellyBean").stash()
self.guiBeans = [
guiBean.instanceUnderNode(jumpLineLocator, self.uniqueName("guiBean%d" % i))
for i in range(self.numJellyBeans)
]
self.guiBeans[-1].setScale(1.5)
heightTextNode = TextNode(self.uniqueName("TrampolineActivity.heightTextNode"))
heightTextNode.setFont(ToontownGlobals.getSignFont())
heightTextNode.setAlign(TextNode.ALeft)
heightTextNode.setText("0.0")
heightTextNode.setShadow(0.05, 0.05)
heightTextNode.setShadowColor(0.0, 0.0, 0.0, 1.0)
heightTextNode.setTextColor(1.0, 1.0, 1.0, 1.0)
self.heightText = jumpLineLocator.attachNewNode(heightTextNode)
self.heightText.setX(0.15)
self.heightText.setScale(0.1)
self.heightText.setAlphaScale(0.0)
self.quitEarlyButtonModels = loader.loadModel("phase_3.5/models/gui/inventory_gui")
quitEarlyUp = self.quitEarlyButtonModels.find("**//InventoryButtonUp")
quitEarlyDown = self.quitEarlyButtonModels.find("**/InventoryButtonDown")
quitEarlyRollover = self.quitEarlyButtonModels.find("**/InventoryButtonRollover")
self.quitEarlyButton = DirectButton(
parent=base.a2dTopRight,
relief=None,
text=TTLocalizer.PartyTrampolineQuitEarlyButton,
text_fg=(1, 1, 0.65, 1),
text_pos=(0, -0.23),
text_scale=0.7,
image=(quitEarlyUp, quitEarlyDown, quitEarlyRollover),
image_color=(1, 0, 0, 1),
image_scale=(20, 1, 11),
pos=(-0.183, 0, -0.4),
scale=0.09,
command=self.leaveTrampoline,
)
self.quitEarlyButton.stash()
self.flashText = OnscreenText(
text="",
pos=(0.0, -0.45),
scale=0.2,
fg=(1.0, 1.0, 0.65, 1.0),
align=TextNode.ACenter,
font=ToontownGlobals.getSignFont(),
mayChange=True,
)
self.timer = PartyUtils.getNewToontownTimer()
self.timer.posInTopRightCorner()
return
开发者ID:OldToontown,项目名称:OldToontown,代码行数:56,代码来源:DistributedPartyTrampolineActivity.py
示例14: loadNextGameTimer
def loadNextGameTimer(self):
self.nextGame = DirectLabel(parent=self, relief=None, text='', text_font=ToontownGlobals.getSignFont(), text_scale=TTLocalizer.BCGnextGame * BG.CardImageScale[2], text_fg=(1.0, 1.0, 1.0, 1), pos=(BG.GridXOffset, 0, 4 * BG.CardImageScale[2]))
self.nextGameTimer = ToontownTimer.ToontownTimer()
self.nextGameTimer.reparentTo(self.nextGame)
self.nextGameTimer.setPos(0, 0, -5 * BG.CardImageScale[2])
self.nextGameTimer.setProp('image', None)
self.nextGameTimer.setProp('text_font', ToontownGlobals.getSignFont())
self.nextGameTimer.setProp('text_scale', 0.2 * BG.CardImageScale[2])
self.nextGameTimer.setFontColor(Vec4(1.0, 1.0, 1.0, 1))
return
开发者ID:AdrianF98,项目名称:Toontown-Rewritten,代码行数:10,代码来源:BingoCardGui.py
示例15: getFontByName
def getFontByName(self, fontname):
if fontname == "toon":
return ToontownGlobals.getToonFont()
elif fontname == "building":
return ToontownGlobals.getBuildingNametagFont()
elif fontname == "minnie":
return ToontownGlobals.getMinnieFont()
elif fontname == "suit":
return ToontownGlobals.getSuitFont()
else:
return MagicWordManager.MagicWordManager.getFontByName(self, fontname)
开发者ID:BmanGames,项目名称:Toontown-Level-Editor,代码行数:11,代码来源:ToontownMagicWordManager.py
示例16: loadDnaStore
def loadDnaStore(self):
if not hasattr(self, 'dnaStore'):
self.dnaStore = DNAStorage()
loader.loadDNA('phase_4/dna/storage.xml').store(self.dnaStore)
self.dnaStore.storeFont(ToontownGlobals.getInterfaceFont(), 'humanist')
self.dnaStore.storeFont(ToontownGlobals.getSignFont(), 'mickey')
self.dnaStore.storeFont(ToontownGlobals.getSuitFont(), 'suit')
loader.loadDNA('phase_3.5/dna/storage_interior.xml').store(self.dnaStore)
开发者ID:Grant11,项目名称:mf0DJnN,代码行数:11,代码来源:PlayGame.py
示例17: enableRaceMode
def enableRaceMode(self):
self.enableSpeedometer()
self.render2dRoot.show()
self.raceModeRoot.show()
self.maxLapHit = min(self.maxLapHit, self.race.lapCount - 1)
for x in xrange(self.maxLapHit + 1):
for y in self.timeLabels[x]:
y.configure(text_font=ToontownGlobals.getSignFont())
y.show()
for y in self.timeLabels[self.maxLapHit]:
y.configure(text_font=ToontownGlobals.getSignFont())
开发者ID:Kawaiikat14,项目名称:Toontown-2-Revised,代码行数:12,代码来源:RaceGUI.py
示例18: __init__
def __init__(self):
DirectObject.__init__(self)
FSM.__init__(self, self.__class__.__name__)
self.label = OnscreenText(
'', parent=hidden, font=ToontownGlobals.getMinnieFont(),
fg=Vec4(1, 1, 1, 1), scale=0.06, align=TextNode.ACenter,
wordwrap=35)
self.label.setColorScale(Vec4(0, 0, 0, 0))
gui = loader.loadModel('phase_3/models/gui/tt_m_gui_mat_mainGui.bam')
shuffleUp = gui.find('**/tt_t_gui_mat_shuffleUp')
shuffleDown = gui.find('**/tt_t_gui_mat_shuffleDown')
okUp = gui.find('**/tt_t_gui_mat_okUp')
okDown = gui.find('**/tt_t_gui_mat_okDown')
closeUp = gui.find('**/tt_t_gui_mat_closeUp')
closeDown = gui.find('**/tt_t_gui_mat_closeDown')
gui.removeNode()
del gui
self.exitButton = DirectButton(
parent=hidden, relief=None,
image=(shuffleUp, shuffleDown, shuffleUp),
image_scale=(0.6, 0.6, 0.6), image1_scale=(0.63, 0.6, 0.6),
image2_scale=(0.63, 0.6, 0.6),
text=(TTLocalizer.IntroExitButton, TTLocalizer.IntroExitButton,
TTLocalizer.IntroExitButton, ''),
text_font=ToontownGlobals.getInterfaceFont(),
text_scale=TTLocalizer.SBshuffleBtn, text_pos=(0, -0.02),
text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1))
self.yesButton = DirectButton(
parent=hidden, relief=None, image=(okUp, okDown, okUp, okDown),
image_scale=(0.6, 0.6, 0.6), image1_scale=(0.7, 0.7, 0.7),
image2_scale=(0.7, 0.7, 0.7),
text=('', TTLocalizer.IntroYesButton, TTLocalizer.IntroYesButton),
text_font=ToontownGlobals.getInterfaceFont(), text_scale=0.08,
text_align=TextNode.ACenter, text_pos=(0, -0.175),
text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1))
self.noButton = DirectButton(
parent=hidden, relief=None,
image=(closeUp, closeDown, closeUp, closeDown),
image_scale=(0.6, 0.6, 0.6), image1_scale=(0.7, 0.7, 0.7),
image2_scale=(0.7, 0.7, 0.7),
text=('', TTLocalizer.IntroNoButton, TTLocalizer.IntroNoButton),
text_font=ToontownGlobals.getInterfaceFont(), text_scale=0.08,
text_align=TextNode.ACenter, text_pos=(0, -0.175),
text_fg=(1, 1, 1, 1), text_shadow=(0, 0, 0, 1))
self.disclaimerTrack = None
self.presentsTrack = None
开发者ID:NostalgicTTR,项目名称:Toontown-Infinite-2016-Leak,代码行数:51,代码来源:Introduction.py
示例19: knockKnockTrack
def knockKnockTrack(self, avatar, duration):
if avatar is None:
return
self.rimshot = base.loadSfx("phase_5/audio/sfx/AA_heal_telljoke.ogg")
self.knockSfx = base.loadSfx("phase_5/audio/sfx/GUI_knock_%s.ogg" % random.randint(1, 4))
joke = KnockKnockJokes[self.propId % len(KnockKnockJokes)]
place = base.cr.playGame.getPlace()
doorName = TTLocalizer.DoorNametag
self.nametag = None
self.nametagNP = None
doorNP = render.find("**/KnockKnockDoorSphere_" + str(self.propId) + ";+s")
if doorNP.isEmpty():
self.notify.warning("Could not find KnockKnockDoorSphere_%s" % self.propId)
return
self.nametag = NametagGroup()
self.nametag.setAvatar(doorNP)
self.nametag.setFont(ToontownGlobals.getToonFont())
self.nametag.setSpeechFont(ToontownGlobals.getToonFont())
self.nametag.setName(doorName)
self.nametag.setActive(0)
self.nametag.manage(base.marginManager)
self.nametag.getNametag3d().setBillboardOffset(4)
nametagNode = self.nametag.getNametag3d()
self.nametagNP = render.attachNewNode(nametagNode)
self.nametagNP.setName("knockKnockDoor_nt_" + str(self.propId))
pos = doorNP.getBounds().getCenter()
self.nametagNP.setPos(pos + Vec3(0, 0, avatar.getHeight() + 2))
d = duration * 0.125
track = Sequence(
Parallel(
Sequence(Wait(d * 0.5), SoundInterval(self.knockSfx)),
Func(self.nametag.setChat, TTLocalizer.DoorKnockKnock, CFSpeech),
Wait(d),
),
Func(avatar.setChatAbsolute, TTLocalizer.DoorWhosThere, CFSpeech | CFTimeout, openEnded=0),
Wait(d),
Func(self.nametag.setChat, joke[0], CFSpeech),
Wait(d),
Func(avatar.setChatAbsolute, joke[0] + TTLocalizer.DoorWhoAppendix, CFSpeech | CFTimeout, openEnded=0),
Wait(d),
Func(self.nametag.setChat, joke[1], CFSpeech),
)
if avatar == base.localAvatar:
track.append(Func(self.sendUpdate, "requestToonup"))
track.append(Parallel(SoundInterval(self.rimshot, startTime=2.0), Wait(d * 4)))
track.append(Func(self.cleanupTrack))
track.delayDelete = DelayDelete.DelayDelete(avatar, "knockKnockTrack")
return track
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:48,代码来源:DistributedKnockKnockDoor.py
示例20: load
def load(self, loadModels = 1, arenaModel = 'partyCatchTree'):
self.notify.info('load()')
DistributedPartyCatchActivity.notify.debug('PartyCatch: load')
self.activityFSM = CatchActivityFSM(self)
self.defineConstants()
self.treesAndFence = loader.loadModel('phase_13/models/parties/%s' % arenaModel)
self.treesAndFence.setScale(0.9)
self.treesAndFence.find('**/fence_floor').setPos(0.0, 0.0, 0.1)
self.treesAndFence.reparentTo(self.root)
ground = self.treesAndFence.find('**/groundPlane')
ground.setBin('ground', 1)
DistributedPartyActivity.load(self)
exitText = TextNode('PartyCatchExitText')
exitText.setCardAsMargin(0.1, 0.1, 0.1, 0.1)
exitText.setCardDecal(True)
exitText.setCardColor(1.0, 1.0, 1.0, 0.0)
exitText.setText(TTLocalizer.PartyCatchActivityExit)
exitText.setTextColor(0.0, 8.0, 0.0, 0.9)
exitText.setAlign(exitText.ACenter)
exitText.setFont(ToontownGlobals.getBuildingNametagFont())
exitText.setShadowColor(0, 0, 0, 1)
exitText.setBin('fixed')
if TTLocalizer.BuildingNametagShadow:
exitText.setShadow(*TTLocalizer.BuildingNametagShadow)
exitTextLoc = self.treesAndFence.find('**/loc_exitSignText')
exitTextNp = exitTextLoc.attachNewNode(exitText)
exitTextNp.setDepthWrite(0)
exitTextNp.setScale(4)
exitTextNp.setZ(-.5)
self.sign.reparentTo(self.treesAndFence.find('**/loc_eventSign'))
self.sign.wrtReparentTo(self.root)
self.avatarNodePath = NodePath('PartyCatchAvatarNodePath')
self.avatarNodePath.reparentTo(self.root)
self._avatarNodePathParentToken = 3
base.cr.parentMgr.registerParent(self._avatarNodePathParentToken, self.avatarNodePath)
self.toonSDs = {}
self.dropShadow = loader.loadModelOnce('phase_3/models/props/drop_shadow')
self.dropObjModels = {}
if loadModels:
self.__loadDropModels()
self.sndGoodCatch = base.loadSfx('phase_4/audio/sfx/SZ_DD_treasure.ogg')
self.sndOof = base.loadSfx('phase_4/audio/sfx/MG_cannon_hit_dirt.ogg')
self.sndAnvilLand = base.loadSfx('phase_4/audio/sfx/AA_drop_anvil_miss.ogg')
self.sndPerfect = base.loadSfx('phase_4/audio/sfx/ring_perfect.ogg')
self.__textGen = TextNode('partyCatchActivity')
self.__textGen.setFont(ToontownGlobals.getSignFont())
self.__textGen.setAlign(TextNode.ACenter)
self.activityFSM.request('Idle')
开发者ID:BmanGames,项目名称:ToontownStride,代码行数:48,代码来源:DistributedPartyCatchActivity.py
注:本文中的toontown.toonbase.ToontownGlobals类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论