Exemplo n.º 1
0
 def __init__(self, text, font, whisperType, timeout = None):
     Clickable2d.__init__(self, 'WhisperPopup')
     MarginVisible.__init__(self)
     self.text = text
     self.font = font
     self.whisperType = whisperType
     if timeout is None:
         self.timeout = len(text) * 0.33
         if self.timeout < self.WHISPER_TIMEOUT_MIN:
             self.timeout = self.WHISPER_TIMEOUT_MIN
         elif self.timeout > self.WHISPER_TIMEOUT_MAX:
             self.timeout = self.WHISPER_TIMEOUT_MAX
     else:
         self.timeout = timeout
     self.active = False
     self.senderName = ''
     self.fromId = 0
     self.isPlayer = 0
     self.contents.setScale(self.CONTENTS_SCALE)
     self.whisperColor = ChatGlobals.WhisperColors[self.whisperType]
     self.textNode = TextNode('text')
     self.textNode.setWordwrap(self.TEXT_WORD_WRAP)
     self.textNode.setTextColor(self.whisperColor[PGButton.SInactive][0])
     self.textNode.setFont(self.font)
     self.textNode.setText(self.text)
     self.chatBalloon = None
     self.quitButton = None
     self.timeoutTaskName = self.getUniqueName() + '-timeout'
     self.timeoutTask = None
     self.quitEvent = self.getUniqueName() + '-quit'
     self.accept(self.quitEvent, self.destroyAnimation)
     self.setPriority(MarginGlobals.MP_high)
     self.setVisible(True)
     self.update()
     self.accept('MarginVisible-update', self.update)
Exemplo n.º 2
0
 def __init__(self, whisperPopup):
     Clickable2d.__init__(self, 'WhisperQuitButton')
     self.whisperPopup = whisperPopup
     self.contents.setScale(self.CONTENTS_SCALE)
     self.contents.hide()
     self.nodePath = None
     self.update()
Exemplo n.º 3
0
 def __init__(self):
     Nametag.__init__(self)
     Clickable2d.__init__(self, 'Nametag2d')
     MarginVisible.__init__(self)
     self.actualChatText = ''
     self.arrow = None
     self.textNodePath = None
     self.contents.setScale(self.CONTENTS_SCALE)
     self.hideThought()
     self.accept('MarginVisible-update', self.update)
Exemplo n.º 4
0
    def __init__(self, whisperPopup):
        Clickable2d.__init__(self, 'WhisperQuitButton')

        self.whisperPopup = whisperPopup

        self.contents.setScale(self.CONTENTS_SCALE)
        self.contents.hide()

        self.nodePath = None

        self.update()
    def __init__(self):
        Nametag.__init__(self)
        Clickable2d.__init__(self, 'Nametag2d')
        MarginVisible.__init__(self)

        self.actualChatText = ''

        self.arrow = None
        self.textNodePath = None

        self.contents.setScale(self.CONTENTS_SCALE)
        self.hideThought()

        self.accept('MarginVisible-update', self.update)
Exemplo n.º 6
0
    def __init__(self, text, font, whisperType, timeout=None):
        Clickable2d.__init__(self, 'WhisperPopup')
        MarginVisible.__init__(self)

        self.text = text
        self.font = font
        self.whisperType = whisperType
        if timeout is None:
            self.timeout = len(text) * 0.33
            if self.timeout < self.WHISPER_TIMEOUT_MIN:
                self.timeout = self.WHISPER_TIMEOUT_MIN
            elif self.timeout > self.WHISPER_TIMEOUT_MAX:
                self.timeout = self.WHISPER_TIMEOUT_MAX
        else:
            self.timeout = timeout

        self.active = False

        self.senderName = ''
        self.fromId = 0
        self.isPlayer = 0

        self.contents.setScale(self.CONTENTS_SCALE)

        self.whisperColor = ChatGlobals.WhisperColors[self.whisperType]

        self.textNode = TextNode('text')
        self.textNode.setWordwrap(self.TEXT_WORD_WRAP)
        self.textNode.setTextColor(self.whisperColor[PGButton.SInactive][0])
        self.textNode.setFont(self.font)
        self.textNode.setText(self.text)

        self.chatBalloon = None
        self.quitButton = None

        self.timeoutTaskName = self.getUniqueName() + '-timeout'
        self.timeoutTask = None

        self.quitEvent = self.getUniqueName() + '-quit'
        self.accept(self.quitEvent, self.destroy)

        self.setPriority(MarginGlobals.MP_high)
        self.setVisible(True)

        self.update()

        self.accept('MarginVisible-update', self.update)