This commit is contained in:
DenialMC 2015-04-24 01:18:16 +03:00
parent c2a35f8510
commit dca35c221b
8 changed files with 34 additions and 38 deletions

View file

@ -305,7 +305,22 @@ class DistributedPlayer(DistributedAvatar.DistributedAvatar, PlayerBase.PlayerBa
base.cr.ttuFriendsManager.d_teleportQuery(sendToId)
def teleportQuery(self, requesterId):
pass
avatar = base.cr.identifyFriend(requesterId)
if avatar is None:
self.d_teleportResponse(self.doId, 0, 0, 0, 0, sendToId=requesterId)
elif base.localAvatar.isIgnored(requesterId):
self.d_teleportResponse(self.doId, 2, 0, 0, 0, sendToId=requesterId)
elif hasattr(base, 'distributedParty') and ((base.distributedParty.partyInfo.isPrivate and requesterId not in base.distributedParty.inviteeIds) or base.distributedParty.isPartyEnding):
self.d_teleportResponse(self.doId, 0, 0, 0, 0, sendToId=requesterId)
elif self.__teleportAvailable and not self.ghostMode:
self.setSystemMessage(requesterId, OTPLocalizer.WhisperComingToVisit % avatar.getName())
messenger.send('teleportQuery', [avatar, self])
else:
if self.failedTeleportMessageOk(requesterId):
self.setSystemMessage(requesterId, OTPLocalizer.WhisperFailedVisit % avatar.getName())
self.d_teleportResponse(self.doId, 0, 0, 0, 0, sendToId=requesterId)
def failedTeleportMessageOk(self, fromId):
now = globalClock.getFrameTime()

View file

@ -439,13 +439,13 @@ class TalkAssistant(DirectObject.DirectObject):
def sendAvatarWhisperSpeedChat(self, type, messageIndex, receiverId):
error = None
if type == SPEEDCHAT_NORMAL:
base.localAvatar.whisperSCTo(messageIndex, receiverId, 0)
base.localAvatar.whisperSCTo(messageIndex, receiverId)
message = self.SCDecoder.decodeSCStaticTextMsg(messageIndex)
elif type == SPEEDCHAT_EMOTE:
base.localAvatar.whisperSCEmoteTo(messageIndex, receiverId, 0)
base.localAvatar.whisperSCEmoteTo(messageIndex, receiverId)
message = self.SCDecoder.decodeSCEmoteWhisperMsg(messageIndex, localAvatar.getName())
elif type == SPEEDCHAT_CUSTOM:
base.localAvatar.whisperSCCustomTo(messageIndex, receiverId, 0)
base.localAvatar.whisperSCCustomTo(messageIndex, receiverId)
message = self.SCDecoder.decodeSCCustomMsg(messageIndex)
if self.logWhispers:
avatarName = None

View file

@ -113,7 +113,6 @@ class WhisperPopup(Clickable2d, MarginVisible):
self.senderName = ''
self.fromId = 0
self.isPlayer = 0
self.contents.setScale(self.CONTENTS_SCALE)
@ -234,11 +233,10 @@ class WhisperPopup(Clickable2d, MarginVisible):
self.destroy()
def setClickable(self, senderName, fromId, isPlayer=0):
def setClickable(self, senderName, fromId):
self.senderName = senderName
self.fromId = fromId
self.isPlayer = isPlayer
self.setClickEvent('clickedWhisper', extraArgs=[fromId, isPlayer])
self.setClickEvent('clickedWhisper', extraArgs=[fromId])
self.setActive(True)
def applyClickState(self, clickState):

View file

@ -162,17 +162,14 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
return None
def makeFriendButton(self, friendTuple, colorChoice = None, bold = 0):
toonName = None
if len(friendTuple) == 2:
avId, flags = friendTuple
avId, flags = friendTuple
command = self.__choseFriend
handle = base.cr.identifyFriend(avId)
if handle:
toonName = handle.getName()
if not toonName:
else:
base.cr.fillUpFriendsMap()
return
thing = avId
fg = ToontownGlobals.ColorNoChat
if flags & ToontownGlobals.FriendChat:
fg = ToontownGlobals.ColorAvatar
@ -277,33 +274,23 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
if base.cr.isFriendOnline(friendPair[0]):
if friendPair[1] & ToontownGlobals.FriendChat:
freeChatOneRef.insert(0, (friendPair[0],
friendPair[1],
0,
0))
friendPair[1]))
else:
speedChatOneRef.insert(0, (friendPair[0],
friendPair[1],
0,
0))
friendPair[1]))
elif friendPair[1] & ToontownGlobals.FriendChat:
freeChatOneRef.insert(0, (friendPair[0],
friendPair[1],
0,
0))
friendPair[1]))
else:
speedChatOneRef.insert(0, (friendPair[0],
friendPair[1],
0,
0))
friendPair[1]))
if self.panelType == FLPOnline:
if True:
for friendPair in base.localAvatar.friendsList:
if base.cr.isFriendOnline(friendPair[0]):
offlineFriends.append((friendPair[0],
friendPair[1],
0,
0))
friendPair[1]))
if self.panelType == FLPPets:
for objId, obj in base.cr.doId2do.items():

View file

@ -1038,10 +1038,7 @@ class DistributedBossCog(DistributedAvatar.DistributedAvatar, BossCog.BossCog):
return
if not self.allowClickedNameTag:
return
if self.cr:
place = self.cr.playGame.getPlace()
if place and hasattr(place, 'fsm'):
FriendsListManager.FriendsListManager._FriendsListManager__handleClickedNametag(place, avatar)
FriendsListManager.FriendsListManager._FriendsListManager__handleClickedNametag(avatar)
def __handleFriendAvatar(self, avId, avName, avDisableName):
self.notify.debug('__handleFriendAvatar')

View file

@ -2407,9 +2407,9 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
if base.cr.isFriend(toonId):
if base.cr.isFriendOnline(toonId):
if singleReply.status == InviteStatus.Accepted:
self.whisperSCTo(5302, toonId, 0)
self.whisperSCTo(5302, toonId)
else:
self.whisperSCTo(5302, toonId, 0)
self.whisperSCTo(5302, toonId)
def updateInvite(self, inviteKey, newStatus):
DistributedToon.partyNotify.debug('updateInvite( inviteKey=%d, newStatus=%s )' % (inviteKey, InviteStatus.getString(newStatus)))

View file

@ -869,9 +869,9 @@ class LocalToon(DistributedToon.DistributedToon, LocalAvatar.LocalAvatar):
base.playSfx(sfx)
return
def clickedWhisper(self, doId, isPlayer = None):
def clickedWhisper(self, doId):
if doId > 0:
LocalAvatar.LocalAvatar.clickedWhisper(self, doId, isPlayer)
LocalAvatar.LocalAvatar.clickedWhisper(self, doId)
else:
foundCanStart = False
for partyInfo in self.hostedParties:

View file

@ -365,8 +365,7 @@ class ToonAvatarPanel(AvatarPanelBase.AvatarPanelBase):
messenger.send('clickedNametag', [avatar])
def __handleWhisper(self):
base.localAvatar.chatMgr.whisperTo(self.avName, self.avId, None)
return
base.localAvatar.chatMgr.whisperTo(self.avName, self.avId)
def __handleSecrets(self):
base.localAvatar.chatMgr.noWhisper()