mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-25 04:32:33 -06:00
parent
0a248d7391
commit
5d8bcfc500
1 changed files with 31 additions and 29 deletions
|
@ -309,20 +309,17 @@ class Avatar(Actor, ShadowCaster):
|
||||||
self.playCurrentDialogue(dialogue, chatFlags, interrupt)
|
self.playCurrentDialogue(dialogue, chatFlags, interrupt)
|
||||||
|
|
||||||
def displayTalk(self, chatString):
|
def displayTalk(self, chatString):
|
||||||
if not base.cr.avatarFriendsManager.checkIgnored(self.doId):
|
if not base.localAvatar.isIgnored(self.doId):
|
||||||
if base.talkAssistant.isThought(chatString):
|
self.clearChat()
|
||||||
self.nametag.setChat(base.talkAssistant.removeThoughtPrefix(chatString), CFThought)
|
if ChatUtil.isThought(chatString):
|
||||||
|
chatString = ChatUtil.removeThoughtPrefix(chatString)
|
||||||
|
self.nametag.setChat(chatString, CFThought)
|
||||||
else:
|
else:
|
||||||
self.nametag.setChat(chatString, CFSpeech | CFTimeout)
|
self.nametag.setChat(chatString, CFSpeech | CFTimeout)
|
||||||
|
|
||||||
def clearChat(self):
|
def clearChat(self):
|
||||||
self.nametag.clearChat()
|
self.nametag.clearChat()
|
||||||
|
|
||||||
def isInView(self):
|
|
||||||
pos = self.getPos(camera)
|
|
||||||
eyePos = Point3(pos[0], pos[1], pos[2] + self.getHeight())
|
|
||||||
return base.camNode.isInView(eyePos)
|
|
||||||
|
|
||||||
def getNameVisible(self):
|
def getNameVisible(self):
|
||||||
return self.__nameVisible
|
return self.__nameVisible
|
||||||
|
|
||||||
|
@ -334,30 +331,36 @@ class Avatar(Actor, ShadowCaster):
|
||||||
self.hideName()
|
self.hideName()
|
||||||
|
|
||||||
def hideName(self):
|
def hideName(self):
|
||||||
self.nametag.getNametag3d().setContents(Nametag.CSpeech | Nametag.CThought)
|
nametag3d = self.nametag.getNametag3d()
|
||||||
|
nametag3d.setContents(Nametag.CSpeech | Nametag.CThought)
|
||||||
|
|
||||||
def showName(self):
|
def showName(self):
|
||||||
if self.__nameVisible and not self.ghostMode:
|
if self.__nameVisible and (not self.ghostMode):
|
||||||
self.nametag.getNametag3d().setContents(Nametag.CName | Nametag.CSpeech | Nametag.CThought)
|
nametag3d = self.nametag.getNametag3d()
|
||||||
|
nametag3d.setContents(Nametag.CName | Nametag.CSpeech | Nametag.CThought)
|
||||||
|
|
||||||
def hideNametag2d(self):
|
def hideNametag2d(self):
|
||||||
|
nametag2d = self.nametag.getNametag2d()
|
||||||
self.nametag2dContents = 0
|
self.nametag2dContents = 0
|
||||||
self.nametag.getNametag2d().setContents(self.nametag2dContents & self.nametag2dDist)
|
nametag2d.setContents(self.nametag2dContents & self.nametag2dDist)
|
||||||
|
|
||||||
def showNametag2d(self):
|
def showNametag2d(self):
|
||||||
|
nametag2d = self.nametag.getNametag2d()
|
||||||
self.nametag2dContents = self.nametag2dNormalContents
|
self.nametag2dContents = self.nametag2dNormalContents
|
||||||
if self.ghostMode:
|
if self.ghostMode:
|
||||||
self.nametag2dContents = Nametag.CSpeech
|
self.nametag2dContents = Nametag.CSpeech
|
||||||
self.nametag.getNametag2d().setContents(self.nametag2dContents & self.nametag2dDist)
|
nametag2d.setContents(self.nametag2dContents & self.nametag2dDist)
|
||||||
|
|
||||||
def hideNametag3d(self):
|
def hideNametag3d(self):
|
||||||
self.nametag.getNametag3d().setContents(0)
|
nametag3d = self.nametag.getNametag3d()
|
||||||
|
nametag3d.setContents(0)
|
||||||
|
|
||||||
def showNametag3d(self):
|
def showNametag3d(self):
|
||||||
if self.__nameVisible and not self.ghostMode:
|
nametag3d = self.nametag.getNametag3d()
|
||||||
self.nametag.getNametag3d().setContents(Nametag.CName | Nametag.CSpeech | Nametag.CThought)
|
if self.__nameVisible and (not self.ghostMode):
|
||||||
|
nametag3d.setContents(Nametag.CName | Nametag.CSpeech | Nametag.CThought)
|
||||||
else:
|
else:
|
||||||
self.nametag.getNametag3d().setContents(0)
|
nametag3d.setContents(0)
|
||||||
|
|
||||||
def setPickable(self, flag):
|
def setPickable(self, flag):
|
||||||
self.nametag.setActive(flag)
|
self.nametag.setActive(flag)
|
||||||
|
@ -369,7 +372,8 @@ class Avatar(Actor, ShadowCaster):
|
||||||
elif self.nametag.isActive():
|
elif self.nametag.isActive():
|
||||||
messenger.send('clickedNametag', [self])
|
messenger.send('clickedNametag', [self])
|
||||||
|
|
||||||
def setPageChat(self, addressee, paragraph, message, quitButton, extraChatFlags = None, dialogueList = [], pageButton = True):
|
def setPageChat(self, addressee, paragraph, message, quitButton,
|
||||||
|
extraChatFlags=None, dialogueList=[], pageButton=True):
|
||||||
self.__chatAddressee = addressee
|
self.__chatAddressee = addressee
|
||||||
self.__chatPageNumber = None
|
self.__chatPageNumber = None
|
||||||
self.__chatParagraph = paragraph
|
self.__chatParagraph = paragraph
|
||||||
|
@ -390,9 +394,9 @@ class Avatar(Actor, ShadowCaster):
|
||||||
elif quitButton:
|
elif quitButton:
|
||||||
self.__chatFlags |= CFQuitButton
|
self.__chatFlags |= CFQuitButton
|
||||||
self.b_setPageNumber(self.__chatParagraph, 0)
|
self.b_setPageNumber(self.__chatParagraph, 0)
|
||||||
return
|
|
||||||
|
|
||||||
def setLocalPageChat(self, message, quitButton, extraChatFlags = None, dialogueList = []):
|
def setLocalPageChat(self, message, quitButton, extraChatFlags=None,
|
||||||
|
dialogueList=[]):
|
||||||
self.__chatAddressee = base.localAvatar.doId
|
self.__chatAddressee = base.localAvatar.doId
|
||||||
self.__chatPageNumber = None
|
self.__chatPageNumber = None
|
||||||
self.__chatParagraph = None
|
self.__chatParagraph = None
|
||||||
|
@ -416,10 +420,9 @@ class Avatar(Actor, ShadowCaster):
|
||||||
self.clearChat()
|
self.clearChat()
|
||||||
self.setChatAbsolute(message, self.__chatFlags, dialogue)
|
self.setChatAbsolute(message, self.__chatFlags, dialogue)
|
||||||
self.setPageNumber(None, 0)
|
self.setPageNumber(None, 0)
|
||||||
return
|
|
||||||
|
|
||||||
def setPageNumber(self, paragraph, pageNumber, timestamp=None):
|
def setPageNumber(self, paragraph, pageNumber, timestamp=None):
|
||||||
if timestamp == None:
|
if timestamp is None:
|
||||||
elapsed = 0.0
|
elapsed = 0.0
|
||||||
else:
|
else:
|
||||||
elapsed = ClockDelta.globalClockDelta.localElapsedTime(timestamp)
|
elapsed = ClockDelta.globalClockDelta.localElapsedTime(timestamp)
|
||||||
|
@ -434,10 +437,11 @@ class Avatar(Actor, ShadowCaster):
|
||||||
messenger.send('nextChatPage', [pageNumber, elapsed])
|
messenger.send('nextChatPage', [pageNumber, elapsed])
|
||||||
else:
|
else:
|
||||||
messenger.send('doneChatPage', [elapsed])
|
messenger.send('doneChatPage', [elapsed])
|
||||||
return
|
|
||||||
|
|
||||||
def advancePageNumber(self):
|
def advancePageNumber(self):
|
||||||
if self.__chatAddressee == base.localAvatar.doId and self.__chatPageNumber != None and self.__chatPageNumber[0] == self.__chatParagraph:
|
if (self.__chatAddressee == base.localAvatar.doId) and (
|
||||||
|
self.__chatPageNumber is not None) and (
|
||||||
|
self.__chatPageNumber[0] == self.__chatParagraph):
|
||||||
pageNumber = self.__chatPageNumber[1]
|
pageNumber = self.__chatPageNumber[1]
|
||||||
if pageNumber >= 0:
|
if pageNumber >= 0:
|
||||||
pageNumber += 1
|
pageNumber += 1
|
||||||
|
@ -447,10 +451,10 @@ class Avatar(Actor, ShadowCaster):
|
||||||
self.setPageNumber(self.__chatParagraph, pageNumber)
|
self.setPageNumber(self.__chatParagraph, pageNumber)
|
||||||
else:
|
else:
|
||||||
self.b_setPageNumber(self.__chatParagraph, pageNumber)
|
self.b_setPageNumber(self.__chatParagraph, pageNumber)
|
||||||
return
|
|
||||||
|
|
||||||
def __updatePageChat(self):
|
def __updatePageChat(self):
|
||||||
if self.__chatPageNumber != None and self.__chatPageNumber[0] == self.__chatParagraph:
|
if (self.__chatPageNumber is not None) and (
|
||||||
|
self.__chatPageNumber[0] == self.__chatParagraph):
|
||||||
pageNumber = self.__chatPageNumber[1]
|
pageNumber = self.__chatPageNumber[1]
|
||||||
if pageNumber >= 0:
|
if pageNumber >= 0:
|
||||||
if not self.__chatSet:
|
if not self.__chatSet:
|
||||||
|
@ -472,7 +476,6 @@ class Avatar(Actor, ShadowCaster):
|
||||||
self.clearChat()
|
self.clearChat()
|
||||||
else:
|
else:
|
||||||
self.clearChat()
|
self.clearChat()
|
||||||
return
|
|
||||||
|
|
||||||
def getAirborneHeight(self):
|
def getAirborneHeight(self):
|
||||||
height = self.getPos(self.shadowPlacer.shadowNodePath)
|
height = self.getPos(self.shadowPlacer.shadowNodePath)
|
||||||
|
@ -491,7 +494,6 @@ class Avatar(Actor, ShadowCaster):
|
||||||
if self.nametagNodePath:
|
if self.nametagNodePath:
|
||||||
self.nametagNodePath.removeNode()
|
self.nametagNodePath.removeNode()
|
||||||
self.nametagNodePath = None
|
self.nametagNodePath = None
|
||||||
return
|
|
||||||
|
|
||||||
def initializeBodyCollisions(self, collIdStr):
|
def initializeBodyCollisions(self, collIdStr):
|
||||||
self.collTube = CollisionTube(0, 0, 0.5, 0, 0, self.height - self.getRadius(), self.getRadius())
|
self.collTube = CollisionTube(0, 0, 0.5, 0, 0, self.height - self.getRadius(), self.getRadius())
|
||||||
|
|
Loading…
Reference in a new issue