示例#1
0
 def displayWhisper(self, fromId, chatString, whisperType):
     sender = None
     sfx = self.soundWhisper
     if whisperType == WhisperPopup.WTNormal or whisperType == WhisperPopup.WTQuickTalker:
         if sender == None:
             return
         chatString = sender.getName() + ': ' + chatString
     whisper = WhisperPopup(chatString, OTPGlobals.getInterfaceFont(),
                            whisperType)
     if sender != None:
         whisper.setClickable(sender.getName(), fromId)
     whisper.manage(base.marginManager)
     base.playSfx(sfx)
     return
示例#2
0
    def displayWhisper(self, fromId, chatString, whisperType):
        sender = None

        if isinstance(fromId, numbers.Number):
            sender = base.cr.identifyAvatar(fromId)

            if whisperType == WTNormal:
                chatString = '%s: %s' % (sender.getName(), chatString)

        whisper = WhisperPopup(chatString, OTPGlobals.getInterfaceFont(), whisperType)

        if sender or isinstance(fromId, basestring):
            whisper.setClickable(fromId)

        whisper.manage(base.marginManager)
        base.playSfx(self.soundSystemMessage if whisperType == WTSystem else self.soundWhisper)
    def displayWhisper(self, fromId, chatString, whisperType):
        sender = None

        if isinstance(fromId, numbers.Number):
            sender = base.cr.identifyAvatar(fromId)

            if whisperType == WTNormal:
                chatString = '%s: %s' % (sender.getName(), chatString)

        whisper = WhisperPopup(chatString, OTPGlobals.getInterfaceFont(),
                               whisperType)

        if sender or isinstance(fromId, basestring):
            whisper.setClickable(fromId)

        whisper.manage(base.marginManager)
        base.playSfx(self.soundSystemMessage if whisperType ==
                     WTSystem else self.soundWhisper)
示例#4
0
 def displayWhisperPlayer(self, fromId, chatString, whisperType):
     sender = None
     playerInfo = None
     sfx = self.soundWhisper
     playerInfo = base.cr.playerFriendsManager.playerId2Info.get(
         fromId, None)
     if playerInfo == None:
         return
     senderName = playerInfo.playerName
     if whisperType == WhisperPopup.WTNormal or whisperType == WhisperPopup.WTQuickTalker:
         chatString = senderName + ': ' + chatString
     whisper = WhisperPopup(chatString, OTPGlobals.getInterfaceFont(),
                            whisperType)
     if sender != None:
         whisper.setClickable(senderName, fromId)
     whisper.manage(base.marginManager)
     base.playSfx(sfx)
     return