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


Python NametagGroup.getNumChatPages方法代码示例

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


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

示例1: Avatar

# 需要导入模块: from otp.nametag.NametagGroup import NametagGroup [as 别名]
# 或者: from otp.nametag.NametagGroup.NametagGroup import getNumChatPages [as 别名]

#.........这里部分代码省略.........
                name += '\n\x01shadow\x01%s\x02' % OTPLocalizer.AccessToString[access]

        self.nametag.setDisplayName(name)

    def getFont(self):
        return self.__font

    def setFont(self, font):
        self.__font = font
        self.nametag.setFont(font)

    def getSpeechFont(self):
        return self.__speechFont

    def setSpeechFont(self, font):
        self.__speechFont = font
        self.nametag.setSpeechFont(font)

    def getStyle(self):
        return self.style

    def setStyle(self, style):
        self.style = style

    def getDialogueArray(self):
        return None

    def playCurrentDialogue(self, dialogue, chatFlags, interrupt = 1):
        if interrupt and self.__currentDialogue is not None:
            self.__currentDialogue.stop()
        self.__currentDialogue = dialogue
        if dialogue:
            base.playSfx(dialogue, node=self)
        elif chatFlags & CFSpeech != 0 and self.nametag.getNumChatPages() > 0:
            self.playDialogueForString(self.nametag.getChat())
            if self.soundChatBubble != None:
                base.playSfx(self.soundChatBubble, node=self)
        return

    def playDialogueForString(self, chatString):
        searchString = chatString.lower()
        if searchString.find(OTPLocalizer.DialogSpecial) >= 0:
            type = 'special'
        elif searchString.find(OTPLocalizer.DialogExclamation) >= 0:
            type = 'exclamation'
        elif searchString.find(OTPLocalizer.DialogQuestion) >= 0:
            type = 'question'
        elif random.randint(0, 1):
            type = 'statementA'
        else:
            type = 'statementB'
        stringLength = len(chatString)
        if stringLength <= OTPLocalizer.DialogLength1:
            length = 1
        elif stringLength <= OTPLocalizer.DialogLength2:
            length = 2
        elif stringLength <= OTPLocalizer.DialogLength3:
            length = 3
        else:
            length = 4
        self.playDialogue(type, length)

    def playDialogue(self, type, length):
        dialogueArray = self.getDialogueArray()
        if dialogueArray == None:
            return
开发者ID:Toonerz,项目名称:Toontown-World-Online-Leak,代码行数:70,代码来源:Avatar.py


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