当前位置: 首页>>代码示例>>Python>>正文


Python NametagGlobals.setOnscreenChatForced方法代码示例

本文整理汇总了Python中src.otp.nametag.NametagGlobals.setOnscreenChatForced方法的典型用法代码示例。如果您正苦于以下问题:Python NametagGlobals.setOnscreenChatForced方法的具体用法?Python NametagGlobals.setOnscreenChatForced怎么用?Python NametagGlobals.setOnscreenChatForced使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在src.otp.nametag.NametagGlobals的用法示例。


在下文中一共展示了NametagGlobals.setOnscreenChatForced方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: exitControlled

# 需要导入模块: from src.otp.nametag import NametagGlobals [as 别名]
# 或者: from src.otp.nametag.NametagGlobals import setOnscreenChatForced [as 别名]
    def exitControlled(self):
        if self.localVehicle:
            self.stopPosHprBroadcast()
            self.__disableControlInterface()
            self.physicsMgr.removePhysicalNode(self.node())
            self.cleanupParticles()
            camera.reparentTo(localAvatar)
            camera.setPos(localAvatar.cameraPositions[0][0])
            camera.setHpr(0, 0, 0)
            self.engineSfxTrack.finish()
            self.engineSfxTrack = self.generateEngineStopTrack()
        else:
            self.stopSmooth()
            taskMgr.remove(self.updateNonLocalTask)
        if self.toon and not self.toon.isDisabled() and not self.toon.isEmpty():
            self.toon.dropShadow.show()
            self.doHeadScale(self.toon, None)
            self.toon.setPosHpr(self.geom[0], 0, 8, 0, 0, 0, 0)
            for feet in self.toon.getPieces(('legs', 'feet')):
                feet.show()

            self.toon.reparentTo(render)
            self.toon.loop('neutral')
            self.toon.startSmooth()
        NametagGlobals.setOnscreenChatForced(0)
        base.camLens.setMinFov(settings['fov']/(4./3.))
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:28,代码来源:DistributedVehicle.py

示例2: enterControlled

# 需要导入模块: from src.otp.nametag import NametagGlobals [as 别名]
# 或者: from src.otp.nametag.NametagGlobals import setOnscreenChatForced [as 别名]
    def enterControlled(self, avId):
        self.avId = avId
        self.toon = base.cr.doId2do.get(avId, None)
        if self.toon:
            self.toon.stopSmooth()
            self.toon.stopPosHprBroadcast()
            for feet in self.toon.getPieces(('legs', 'feet')):
                feet.hide()

            self.toon.reparentTo(self.toonSeat)
            self.toon.dropShadow.hide()
            self.notify.debug('setting pos of toon%s' % self.toon.doId)
            self.toon.setPosHpr(0, 0, 0, 0, 0, 0)
            self.toon.loop('sit')
            if self.toon.doId == localAvatar.doId:
                self.notify.debug('calling send currentPosition')
                self.toon.sendCurrentPosition()
            self.doHeadScale(self.toon, 1.75)
            self.toon.setShear(0, 0, 0)
        NametagGlobals.setOnscreenChatForced(1)
        if self.localVehicle:
            camera.reparentTo(self.cameraNode)
            camera.setPosHpr(0, -33, 16, 0, -10, 0)
            self.physicsMgr.attachPhysicalNode(self.node())
            self.__enableControlInterface()
            self.__createPieWindshield()
            self.startPosHprBroadcast()
            self.engineSfxTrack = self.generateEngineStartTrack()
            self.engineSfxTrack.start()
        else:
            self.startSmooth()
            taskName = 'updateNonlocalVehicle-%s' % avId
            self.updateNonLocalTask = taskMgr.add(self.__updateNonlocalVehicle, taskName)
        return
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:36,代码来源:DistributedVehicle.py

示例3: exitReward

# 需要导入模块: from src.otp.nametag import NametagGlobals [as 别名]
# 或者: from src.otp.nametag.NametagGlobals import setOnscreenChatForced [as 别名]
    def exitReward(self):
        self.ignore('clientCleanup')
        taskMgr.remove('countUpTask')
        taskMgr.remove('countDownTask')
        taskMgr.remove('celebrate')
        taskMgr.remove('purchase-trans')
        taskMgr.remove('delayAdd')
        taskMgr.remove('delaySubtract')
        for toon in self.toons:
            toon.detachNode()

        del self.toons
        if hasattr(self, 'toonsKeep'):
            for delayDelete in self.toonsKeep:
                delayDelete.destroy()

            del self.toonsKeep
        for counter in self.counters:
            counter.reparentTo(hidden)

        for total in self.totalCounters:
            total.reparentTo(hidden)

        self.foreground.reparentTo(hidden)
        self.backgroundL.reparentTo(hidden)
        self.backgroundR.reparentTo(hidden)
        self.sidewalk.reparentTo(hidden)
        self.sidewalkL.reparentTo(hidden)
        self.sidewalkR.reparentTo(hidden)
        self.door.reparentTo(hidden)
        self.title.reparentTo(self.frame)
        self.rewardDoubledJellybeanLabel.hide()
        base.camLens.setMinFov(settings['fov']/(4./3.))
        NametagGlobals.setOnscreenChatForced(0)
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:36,代码来源:Purchase.py

示例4: __disableControlInterface

# 需要导入模块: from src.otp.nametag import NametagGlobals [as 别名]
# 或者: from src.otp.nametag.NametagGlobals import setOnscreenChatForced [as 别名]
 def __disableControlInterface(self):
     self.__turnOffMagnet()
     if self.closeButton:
         self.closeButton.destroy()
         self.closeButton = None
     self.__cleanupCraneAdvice()
     self.__cleanupMagnetAdvice()
     self.ignore('escape')
     self.ignore(base.JUMP)
     self.ignore('control-up')
     self.ignore('InputState-forward')
     self.ignore('InputState-reverse')
     self.ignore('InputState-turnLeft')
     self.ignore('InputState-turnRight')
     self.arrowVert = 0
     self.arrowHorz = 0
     NametagGlobals.setOnscreenChatForced(0)
     taskMgr.remove('watchCraneControls')
     self.__setMoveSound(None)
     return
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:22,代码来源:DistributedCashbotBossCrane.py

示例5: __enableControlInterface

# 需要导入模块: from src.otp.nametag import NametagGlobals [as 别名]
# 或者: from src.otp.nametag.NametagGlobals import setOnscreenChatForced [as 别名]
 def __enableControlInterface(self):
     gui = loader.loadModel('phase_3.5/models/gui/avatar_panel_gui')
     self.closeButton = DirectButton(
         parent=base.a2dBottomRight,
         image=(gui.find('**/CloseBtn_UP'), gui.find('**/CloseBtn_DN'),
                gui.find('**/CloseBtn_Rllvr'), gui.find('**/CloseBtn_UP')),
         relief=None, scale=2, text=TTLocalizer.CashbotCraneLeave, text_scale=0.04,
         text_pos=(0, -0.07), text_fg=VBase4(1, 1, 1, 1), pos=(-0.25, 0, 0.175),
         command=self.__exitCrane)
     self.accept('escape', self.__exitCrane)
     self.accept(base.JUMP, self.__controlPressed)
     self.accept('control-up', self.__controlReleased)
     self.accept('InputState-forward', self.__upArrow)
     self.accept('InputState-reverse', self.__downArrow)
     self.accept('InputState-turnLeft', self.__leftArrow)
     self.accept('InputState-turnRight', self.__rightArrow)
     taskMgr.add(self.__watchControls, 'watchCraneControls')
     taskMgr.doMethodLater(5, self.__displayCraneAdvice, self.craneAdviceName)
     taskMgr.doMethodLater(10, self.__displayMagnetAdvice, self.magnetAdviceName)
     NametagGlobals.setOnscreenChatForced(1)
     self.arrowVert = 0
     self.arrowHorz = 0
     return
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:25,代码来源:DistributedCashbotBossCrane.py

示例6: enterReward

# 需要导入模块: from src.otp.nametag import NametagGlobals [as 别名]
# 或者: from src.otp.nametag.NametagGlobals import setOnscreenChatForced [as 别名]
    def enterReward(self):
        numToons = 0
        toonLayouts = ((2,),
         (1, 3),
         (0, 2, 4),
         (0, 1, 3, 4))
        toonPositions = (5.0,
         1.75,
         -0.25,
         -1.75,
         -5.0)
        self.toons = []
        self.toonsKeep = []
        self.counters = []
        self.totalCounters = []
        camera.reparentTo(render)
        camera.setPos(0, 16.0, 2.0)
        camera.lookAt(0, 0, 0.75)
        base.transitions.irisIn(0.4)
        base.camLens.setMinFov(60/(4./3.))
        base.setBackgroundColor(Vec4(0, 0.6, 1, 1))
        self.title.reparentTo(aspect2d)
        self.foreground.reparentTo(render)
        self.backgroundL.reparentTo(render)
        self.backgroundR.reparentTo(render)
        self.sidewalk.reparentTo(render)
        self.sidewalkL.reparentTo(render)
        self.sidewalkR.reparentTo(render)
        self.door.reparentTo(render)
        size = 20
        z = -2.5
        floor = CollisionPolygon(Point3(-size, -size, z), Point3(size, -size, z), Point3(size, size, z), Point3(-size, size, z))
        floor.setTangible(1)
        floorNode = CollisionNode('collision_floor')
        floorNode.addSolid(floor)
        self.collisionFloor = render.attachNewNode(floorNode)
        NametagGlobals.setOnscreenChatForced(1)
        for index in xrange(len(self.ids)):
            avId = self.ids[index]
            if self.states[index] != PURCHASE_NO_CLIENT_STATE and self.states[index] != PURCHASE_DISCONNECTED_STATE and avId in base.cr.doId2do:
                numToons += 1
                toon = base.cr.doId2do[avId]
                toon.stopSmooth()
                self.toons.append(toon)
                self.toonsKeep.append(DelayDelete.DelayDelete(toon, 'Purchase.enterReward'))
                counter = DirectLabel(parent=hidden, relief=None, pos=(0.0, 0.0, 0.0), text=str(0), text_scale=0.2, text_fg=(0.95, 0.95, 0, 1), text_pos=(0, -0.1, 0), text_font=ToontownGlobals.getSignFont())
                counter['image'] = DGG.getDefaultDialogGeom()
                counter['image_scale'] = (0.33, 1, 0.33)
                counter.setScale(0.5)
                counter.count = 0
                counter.max = self.pointsArray[index]
                self.counters.append(counter)
                money = self.playerMoney[index]
                totalCounter = DirectLabel(parent=hidden, relief=None, pos=(0.0, 0.0, 0.0), text=str(money), text_scale=0.2, text_fg=(0.95, 0.95, 0, 1), text_pos=(0, -0.1, 0), text_font=ToontownGlobals.getSignFont(), image=self.jarImage)
                totalCounter.setScale(0.5)
                totalCounter.count = money
                totalCounter.max = toon.getMaxMoney()
                self.totalCounters.append(totalCounter)

        self.accept('clientCleanup', self._handleClientCleanup)
        pos = 0
        toonLayout = toonLayouts[numToons - 1]
        for toon in self.toons:
            thisPos = toonPositions[toonLayout[pos]]
            toon.setPos(Vec3(thisPos, 1.0, -2.5))
            toon.setHpr(Vec3(0, 0, 0))
            toon.setAnimState('neutral', 1)
            toon.setShadowHeight(0)
            if not toon.isDisabled():
                toon.reparentTo(render)
            self.counters[pos].setPos(thisPos * -0.17, 0, toon.getHeight() / 10 + 0.25)
            self.counters[pos].reparentTo(aspect2d)
            self.totalCounters[pos].setPos(thisPos * -0.17, 0, -0.825)
            self.totalCounters[pos].reparentTo(aspect2d)
            pos += 1

        self.maxPoints = max(self.pointsArray)

        def reqCountUp(state):
            self.countUp()
            return Task.done

        countUpDelay = DELAY_BEFORE_COUNT_UP
        taskMgr.doMethodLater(countUpDelay, reqCountUp, 'countUpTask')

        def reqCountDown(state):
            self.countDown()
            return Task.done

        countDownDelay = countUpDelay + COUNT_UP_DURATION + DELAY_AFTER_COUNT_UP
        taskMgr.doMethodLater(countDownDelay, reqCountDown, 'countDownTask')

        def celebrate(task):
            for counter in task.counters:
                counter.hide()

            winningPoints = max(task.pointsArray)
            for i in xrange(len(task.ids)):
                if task.pointsArray[i] == winningPoints:
                    avId = task.ids[i]
#.........这里部分代码省略.........
开发者ID:ToontownBattlefront,项目名称:Toontown-Battlefront,代码行数:103,代码来源:Purchase.py


注:本文中的src.otp.nametag.NametagGlobals.setOnscreenChatForced方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。