mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 04:02:40 -06:00
DANIEL: Beginning of chat stuff
This commit is contained in:
parent
a6e7fb9d83
commit
1b2c00f7a1
19 changed files with 69 additions and 176 deletions
4
dependencies/astron/dclass/stride.dc
vendored
4
dependencies/astron/dclass/stride.dc
vendored
|
@ -173,8 +173,6 @@ dclass DistributedPlayer : DistributedAvatar {
|
||||||
setWhisperSCCustomFrom(DoId fromAv, uint16 msgIndex) ownrecv clsend;
|
setWhisperSCCustomFrom(DoId fromAv, uint16 msgIndex) ownrecv clsend;
|
||||||
setWhisperSCEmoteFrom(DoId fromAv, uint16 emoteId) ownrecv clsend;
|
setWhisperSCEmoteFrom(DoId fromAv, uint16 emoteId) ownrecv clsend;
|
||||||
setSystemMessage(DoId aboutId, string(0-256) chatString) ownrecv;
|
setSystemMessage(DoId aboutId, string(0-256) chatString) ownrecv;
|
||||||
setCommonChatFlags(uint8) broadcast ownrecv ram airecv;
|
|
||||||
setWhitelistChatFlags(uint8) broadcast ownrecv ram airecv;
|
|
||||||
setSC(uint16 msgIndex) broadcast ownsend airecv;
|
setSC(uint16 msgIndex) broadcast ownsend airecv;
|
||||||
setSCCustom(uint16 msgIndex) broadcast ownsend airecv;
|
setSCCustom(uint16 msgIndex) broadcast ownsend airecv;
|
||||||
setFriendsList(FriendEntry[] = []) ownrecv required db airecv;
|
setFriendsList(FriendEntry[] = []) ownrecv required db airecv;
|
||||||
|
@ -3363,7 +3361,7 @@ dclass TTSFriendsManager : DistributedObjectGlobal {
|
||||||
friendInfo(Friend);
|
friendInfo(Friend);
|
||||||
friendList(Friend []);
|
friendList(Friend []);
|
||||||
|
|
||||||
friendOnline(uint32, uint8, uint8);
|
friendOnline(uint32);
|
||||||
friendOffline(uint32);
|
friendOffline(uint32);
|
||||||
|
|
||||||
goingOffline(uint32 avId);
|
goingOffline(uint32 avId);
|
||||||
|
|
|
@ -67,7 +67,6 @@ class Avatar(Actor, ShadowCaster):
|
||||||
self.battleTubeHeight = 0.0
|
self.battleTubeHeight = 0.0
|
||||||
self.battleTubeRadius = 0.0
|
self.battleTubeRadius = 0.0
|
||||||
self.style = None
|
self.style = None
|
||||||
self.commonChatFlags = 0
|
|
||||||
self.understandable = 1
|
self.understandable = 1
|
||||||
self.setPlayerType(NametagGlobals.CCNormal)
|
self.setPlayerType(NametagGlobals.CCNormal)
|
||||||
self.ghostMode = 0
|
self.ghostMode = 0
|
||||||
|
@ -81,7 +80,6 @@ class Avatar(Actor, ShadowCaster):
|
||||||
self.__chatLocal = 0
|
self.__chatLocal = 0
|
||||||
self.__chatQuitButton = False
|
self.__chatQuitButton = False
|
||||||
self.__currentDialogue = None
|
self.__currentDialogue = None
|
||||||
self.whitelistChatFlags = 0
|
|
||||||
|
|
||||||
def delete(self):
|
def delete(self):
|
||||||
try:
|
try:
|
||||||
|
@ -127,50 +125,34 @@ class Avatar(Actor, ShadowCaster):
|
||||||
chatColor = NametagGlobals.ChatColors[self.playerType]
|
chatColor = NametagGlobals.ChatColors[self.playerType]
|
||||||
self.nametag.setChatColor(chatColor)
|
self.nametag.setChatColor(chatColor)
|
||||||
else:
|
else:
|
||||||
nametagColor = NametagGlobals.NametagColors[NametagGlobals.CCNoChat]
|
nametagColor = NametagGlobals.NametagColors[NametagGlobals.CCNonPlayer]
|
||||||
self.nametag.setNametagColor(nametagColor)
|
self.nametag.setNametagColor(nametagColor)
|
||||||
chatColor = NametagGlobals.ChatColors[NametagGlobals.CCNoChat]
|
chatColor = NametagGlobals.ChatColors[NametagGlobals.CCNonPlayer]
|
||||||
self.nametag.setChatColor(chatColor)
|
self.nametag.setChatColor(chatColor)
|
||||||
self.nametag.updateAll()
|
self.nametag.updateAll()
|
||||||
|
|
||||||
def setCommonChatFlags(self, commonChatFlags):
|
|
||||||
self.commonChatFlags = commonChatFlags
|
|
||||||
self.considerUnderstandable()
|
|
||||||
if self == base.localAvatar:
|
|
||||||
reconsiderAllUnderstandable()
|
|
||||||
|
|
||||||
def setWhitelistChatFlags(self, whitelistChatFlags):
|
|
||||||
self.whitelistChatFlags = whitelistChatFlags
|
|
||||||
self.considerUnderstandable()
|
|
||||||
if self == base.localAvatar:
|
|
||||||
reconsiderAllUnderstandable()
|
|
||||||
|
|
||||||
def considerUnderstandable(self):
|
def considerUnderstandable(self):
|
||||||
if self.playerType in (NametagGlobals.CCNormal, NametagGlobals.CCFreeChat, NametagGlobals.CCSpeedChat):
|
if self.playerType in (NametagGlobals.CCNormal, NametagGlobals.CCSpeedChat):
|
||||||
self.setPlayerType(NametagGlobals.CCSpeedChat)
|
self.setPlayerType(NametagGlobals.CCSpeedChat)
|
||||||
if hasattr(base, 'localAvatar') and (self == base.localAvatar):
|
if hasattr(base, 'localAvatar') and (self == base.localAvatar):
|
||||||
self.understandable = 1
|
self.understandable = 1
|
||||||
self.setPlayerType(NametagGlobals.CCFreeChat)
|
self.setPlayerType(NametagGlobals.CCNormal)
|
||||||
elif self.playerType == NametagGlobals.CCSuit:
|
elif self.playerType == NametagGlobals.CCSuit:
|
||||||
self.understandable = 1
|
self.understandable = 1
|
||||||
self.setPlayerType(NametagGlobals.CCSuit)
|
self.setPlayerType(NametagGlobals.CCSuit)
|
||||||
elif self.playerType not in (NametagGlobals.CCNormal, NametagGlobals.CCFreeChat, NametagGlobals.CCSpeedChat):
|
elif self.playerType not in (NametagGlobals.CCNormal, NametagGlobals.CCSpeedChat):
|
||||||
self.understandable = 1
|
self.understandable = 1
|
||||||
self.setPlayerType(NametagGlobals.CCNoChat)
|
self.setPlayerType(NametagGlobals.CCNonPlayer)
|
||||||
elif hasattr(base, 'localAvatar') and self.commonChatFlags & base.localAvatar.commonChatFlags & OTPGlobals.CommonChat:
|
elif False and hasattr(self, 'adminAccess') and self.adminAccess >= CATEGORY_COMMUNITY_MANAGER:
|
||||||
|
print 'admin'
|
||||||
self.understandable = 1
|
self.understandable = 1
|
||||||
self.setPlayerType(NametagGlobals.CCFreeChat)
|
self.setPlayerType(NametagGlobals.CCNormal)
|
||||||
elif self.commonChatFlags & OTPGlobals.SuperChat:
|
elif settings['trueFriends'] and base.cr.getFriendFlags(self.doId) & OTPGlobals.FriendChat:
|
||||||
self.understandable = 1
|
self.understandable = 1
|
||||||
self.setPlayerType(NametagGlobals.CCFreeChat)
|
self.setPlayerType(NametagGlobals.CCNormal)
|
||||||
elif hasattr(base, 'localAvatar') and base.localAvatar.commonChatFlags & OTPGlobals.SuperChat:
|
elif settings['speedchatPlus']:
|
||||||
self.understandable = 1
|
|
||||||
self.setPlayerType(NametagGlobals.CCFreeChat)
|
|
||||||
elif base.cr.getFriendFlags(self.doId) & OTPGlobals.FriendChat:
|
|
||||||
self.understandable = 1
|
|
||||||
self.setPlayerType(NametagGlobals.CCFreeChat)
|
|
||||||
elif hasattr(base, 'localAvatar') and self.whitelistChatFlags & base.localAvatar.whitelistChatFlags:
|
|
||||||
self.understandable = 1
|
self.understandable = 1
|
||||||
|
self.setPlayerType(NametagGlobals.CCSpeedChat)
|
||||||
else:
|
else:
|
||||||
self.understandable = 0
|
self.understandable = 0
|
||||||
if not hasattr(self, 'nametag'):
|
if not hasattr(self, 'nametag'):
|
||||||
|
|
|
@ -71,12 +71,6 @@ class DistributedPlayerAI(DistributedAvatarAI.DistributedAvatarAI, PlayerBase.Pl
|
||||||
def d_setSystemMessage(self, aboutId, chatString):
|
def d_setSystemMessage(self, aboutId, chatString):
|
||||||
self.sendUpdate('setSystemMessage', [aboutId, chatString])
|
self.sendUpdate('setSystemMessage', [aboutId, chatString])
|
||||||
|
|
||||||
def d_setCommonChatFlags(self, flags):
|
|
||||||
self.sendUpdate('setCommonChatFlags', [flags])
|
|
||||||
|
|
||||||
def setCommonChatFlags(self, flags):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def d_friendsNotify(self, avId, status):
|
def d_friendsNotify(self, avId, status):
|
||||||
self.sendUpdate('friendsNotify', [avId, status])
|
self.sendUpdate('friendsNotify', [avId, status])
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,6 @@ class LocalAvatar(DistributedAvatar.DistributedAvatar, DistributedSmoothNode.Dis
|
||||||
self.customMessages = []
|
self.customMessages = []
|
||||||
self.chatMgr = chatMgr
|
self.chatMgr = chatMgr
|
||||||
base.talkAssistant = talkAssistant
|
base.talkAssistant = talkAssistant
|
||||||
self.commonChatFlags = 0
|
|
||||||
self.garbleChat = 1
|
self.garbleChat = 1
|
||||||
self.teleportAllowed = 1
|
self.teleportAllowed = 1
|
||||||
self.lockedDown = 0
|
self.lockedDown = 0
|
||||||
|
@ -1128,10 +1127,8 @@ class LocalAvatar(DistributedAvatar.DistributedAvatar, DistributedSmoothNode.Dis
|
||||||
self.ccPusherTrav.traverse(n)
|
self.ccPusherTrav.traverse(n)
|
||||||
return
|
return
|
||||||
|
|
||||||
def __friendOnline(self, doId, commonChatFlags = 0, whitelistChatFlags = 0):
|
def __friendOnline(self, doId):
|
||||||
friend = base.cr.identifyFriend(doId)
|
friend = base.cr.identifyFriend(doId)
|
||||||
if friend != None and hasattr(friend, 'setCommonAndWhitelistChatFlags'):
|
|
||||||
friend.setCommonAndWhitelistChatFlags(commonChatFlags, whitelistChatFlags)
|
|
||||||
if self.oldFriendsList != None:
|
if self.oldFriendsList != None:
|
||||||
now = globalClock.getFrameTime()
|
now = globalClock.getFrameTime()
|
||||||
elapsed = now - self.timeFriendsListChanged
|
elapsed = now - self.timeFriendsListChanged
|
||||||
|
|
|
@ -77,9 +77,6 @@ class ChatInputTyped(DirectObject.DirectObject):
|
||||||
self.cancelButton.show()
|
self.cancelButton.show()
|
||||||
self.typedChatButton.hide()
|
self.typedChatButton.hide()
|
||||||
self.typedChatBar.hide()
|
self.typedChatBar.hide()
|
||||||
if self.whisperId and not base.talkAssistant.checkWhisperTypedChatAvatar(self.whisperId):
|
|
||||||
messenger.send('Chat-Failed avatar typed chat test')
|
|
||||||
self.deactivate()
|
|
||||||
|
|
||||||
def deactivate(self):
|
def deactivate(self):
|
||||||
self.chatEntry.set('')
|
self.chatEntry.set('')
|
||||||
|
|
|
@ -79,19 +79,6 @@ class ChatInputWhiteListFrame(FSM.FSM, DirectFrame):
|
||||||
def requestMode(self, mode, *args):
|
def requestMode(self, mode, *args):
|
||||||
return self.request(mode, *args)
|
return self.request(mode, *args)
|
||||||
|
|
||||||
def defaultFilter(self, request, *args):
|
|
||||||
if request == 'AllChat':
|
|
||||||
if not base.talkAssistant.checkAnyTypedChat():
|
|
||||||
messenger.send('Chat-Failed open typed chat test')
|
|
||||||
self.notify.warning('Chat-Failed open typed chat test')
|
|
||||||
return None
|
|
||||||
elif request == 'AvatarWhisper':
|
|
||||||
if not base.talkAssistant.checkWhisperTypedChatAvatar(self.whisperId):
|
|
||||||
messenger.send('Chat-Failed avatar typed chat test')
|
|
||||||
self.notify.warning('Chat-Failed avatar typed chat test')
|
|
||||||
return None
|
|
||||||
return FSM.FSM.defaultFilter(self, request, *args)
|
|
||||||
|
|
||||||
def enterOff(self):
|
def enterOff(self):
|
||||||
self.deactivate()
|
self.deactivate()
|
||||||
localAvatar.chatMgr.fsm.request('mainMenu')
|
localAvatar.chatMgr.fsm.request('mainMenu')
|
||||||
|
|
|
@ -204,45 +204,6 @@ class TalkAssistant(DirectObject.DirectObject):
|
||||||
message.getSenderAccountName(),
|
message.getSenderAccountName(),
|
||||||
message.getBody())
|
message.getBody())
|
||||||
|
|
||||||
def checkOpenTypedChat(self):
|
|
||||||
if base.localAvatar.commonChatFlags & OTPGlobals.CommonChat:
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def checkAnyTypedChat(self):
|
|
||||||
if base.localAvatar.commonChatFlags & OTPGlobals.CommonChat:
|
|
||||||
return True
|
|
||||||
if base.localAvatar.canChat():
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def checkOpenSpeedChat(self):
|
|
||||||
return True
|
|
||||||
|
|
||||||
def checkWhisperTypedChatAvatar(self, avatarId):
|
|
||||||
remoteAvatar = base.cr.doId2do.get(avatarId)
|
|
||||||
if remoteAvatar:
|
|
||||||
if remoteAvatar.isUnderstandable():
|
|
||||||
return True
|
|
||||||
if base.localAvatar.commonChatFlags & OTPGlobals.SuperChat:
|
|
||||||
return True
|
|
||||||
remoteAvatarOrHandleOrInfo = base.cr.identifyAvatar(avatarId)
|
|
||||||
if remoteAvatarOrHandleOrInfo and hasattr(remoteAvatarOrHandleOrInfo, 'isUnderstandable'):
|
|
||||||
if remoteAvatarOrHandleOrInfo.isUnderstandable():
|
|
||||||
return True
|
|
||||||
if base.cr.getFriendFlags(avatarId) & OTPGlobals.FriendChat:
|
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def checkWhisperSpeedChatAvatar(self, avatarId):
|
|
||||||
return True
|
|
||||||
|
|
||||||
def checkOpenSpeedChat(self):
|
|
||||||
return True
|
|
||||||
|
|
||||||
def checkWhisperSpeedChatAvatar(self, avatarId):
|
|
||||||
return True
|
|
||||||
|
|
||||||
def receiveOpenTalk(self, senderAvId, avatarName, accountId, accountName, message, scrubbed = 0):
|
def receiveOpenTalk(self, senderAvId, avatarName, accountId, accountName, message, scrubbed = 0):
|
||||||
error = None
|
error = None
|
||||||
if not avatarName and senderAvId:
|
if not avatarName and senderAvId:
|
||||||
|
|
|
@ -50,7 +50,7 @@ class FriendManager(DistributedObject.DistributedObject):
|
||||||
|
|
||||||
def up_inviteeFriendResponse(self, yesNoMaybe, context):
|
def up_inviteeFriendResponse(self, yesNoMaybe, context):
|
||||||
if yesNoMaybe == 1:
|
if yesNoMaybe == 1:
|
||||||
base.cr.ttsFriendsManager.friendOnline(self.otherToon, 0, 0)
|
base.cr.ttsFriendsManager.friendOnline(self.otherToon)
|
||||||
self.sendUpdate('inviteeFriendResponse', [yesNoMaybe, context])
|
self.sendUpdate('inviteeFriendResponse', [yesNoMaybe, context])
|
||||||
self.notify.debug('Client: inviteeFriendResponse(%d, %d)' % (yesNoMaybe, context))
|
self.notify.debug('Client: inviteeFriendResponse(%d, %d)' % (yesNoMaybe, context))
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ class FriendManager(DistributedObject.DistributedObject):
|
||||||
|
|
||||||
def friendResponse(self, yesNoMaybe, context):
|
def friendResponse(self, yesNoMaybe, context):
|
||||||
if yesNoMaybe == 1:
|
if yesNoMaybe == 1:
|
||||||
base.cr.ttsFriendsManager.friendOnline(self.otherToon, 0, 0)
|
base.cr.ttsFriendsManager.friendOnline(self.otherToon)
|
||||||
self.notify.debug('Client: friendResponse(%d, %d)' % (yesNoMaybe, context))
|
self.notify.debug('Client: friendResponse(%d, %d)' % (yesNoMaybe, context))
|
||||||
messenger.send('friendResponse', [yesNoMaybe, context])
|
messenger.send('friendResponse', [yesNoMaybe, context])
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,6 @@ AICollMovePriority = 8
|
||||||
MaxFriends = 200
|
MaxFriends = 200
|
||||||
MaxBackCatalog = 48
|
MaxBackCatalog = 48
|
||||||
FriendChat = 1
|
FriendChat = 1
|
||||||
CommonChat = 1
|
|
||||||
SuperChat = 2
|
SuperChat = 2
|
||||||
MaxCustomMessages = 25
|
MaxCustomMessages = 25
|
||||||
SPInvalid = 0
|
SPInvalid = 0
|
||||||
|
|
|
@ -1024,7 +1024,7 @@ class CatalogScreen(DirectFrame):
|
||||||
|
|
||||||
def __makeFFlist(self):
|
def __makeFFlist(self):
|
||||||
for id, handle in base.cr.friendsMap.items():
|
for id, handle in base.cr.friendsMap.items():
|
||||||
self.ffList.append((id, handle.getName(), NametagGlobals.CCFreeChat))
|
self.ffList.append((id, handle.getName(), NametagGlobals.getFriendColor(id)))
|
||||||
|
|
||||||
def __makeScrollList(self):
|
def __makeScrollList(self):
|
||||||
for ff in self.ffList:
|
for ff in self.ffList:
|
||||||
|
|
|
@ -94,7 +94,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
||||||
self.friendsOnline = {}
|
self.friendsOnline = {}
|
||||||
self.friendsMapPending = 0
|
self.friendsMapPending = 0
|
||||||
self.friendsListError = 0
|
self.friendsListError = 0
|
||||||
self.friendPendingChatSettings = {}
|
|
||||||
self.elderFriendsMap = {}
|
self.elderFriendsMap = {}
|
||||||
self.__queryAvatarMap = {}
|
self.__queryAvatarMap = {}
|
||||||
self.hoodMgr = HoodMgr.HoodMgr(self)
|
self.hoodMgr = HoodMgr.HoodMgr(self)
|
||||||
|
@ -762,9 +761,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
||||||
self.friendsMap[doId] = handle
|
self.friendsMap[doId] = handle
|
||||||
if doId in self.friendsOnline:
|
if doId in self.friendsOnline:
|
||||||
self.friendsOnline[doId] = handle
|
self.friendsOnline[doId] = handle
|
||||||
if doId in self.friendPendingChatSettings:
|
|
||||||
self.notify.debug('calling setCommonAndWL %s' % str(self.friendPendingChatSettings[doId]))
|
|
||||||
handle.setCommonAndWhitelistChatFlags(*self.friendPendingChatSettings[doId])
|
|
||||||
|
|
||||||
if base.wantPets and base.localAvatar.hasPet():
|
if base.wantPets and base.localAvatar.hasPet():
|
||||||
|
|
||||||
|
@ -798,13 +794,11 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
|
||||||
if avatarHandleList:
|
if avatarHandleList:
|
||||||
messenger.send('gotExtraFriendHandles', [avatarHandleList])
|
messenger.send('gotExtraFriendHandles', [avatarHandleList])
|
||||||
|
|
||||||
def handleFriendOnline(self, doId, commonChatFlags, whitelistChatFlags):
|
def handleFriendOnline(self, doId):
|
||||||
self.notify.debug('Friend %d now online. common=%d whitelist=%d' % (doId, commonChatFlags, whitelistChatFlags))
|
self.notify.debug('Friend %d now online.' % doId)
|
||||||
if doId not in self.friendsOnline:
|
if doId not in self.friendsOnline:
|
||||||
self.friendsOnline[doId] = self.identifyFriend(doId)
|
self.friendsOnline[doId] = self.identifyFriend(doId)
|
||||||
messenger.send('friendOnline', [doId, commonChatFlags, whitelistChatFlags])
|
messenger.send('friendOnline', [doId])
|
||||||
if not self.friendsOnline[doId]:
|
|
||||||
self.friendPendingChatSettings[doId] = (commonChatFlags, whitelistChatFlags)
|
|
||||||
|
|
||||||
def handleFriendOffline(self, doId):
|
def handleFriendOffline(self, doId):
|
||||||
self.notify.debug('Friend %d now offline.' % doId)
|
self.notify.debug('Friend %d now offline.' % doId)
|
||||||
|
|
|
@ -112,7 +112,7 @@ class ToonStatueSelectionGUI(DirectFrame):
|
||||||
if hasattr(handle, 'getName'):
|
if hasattr(handle, 'getName'):
|
||||||
colorCode = NametagGlobals.CCSpeedChat
|
colorCode = NametagGlobals.CCSpeedChat
|
||||||
if flags & ToontownGlobals.FriendChat:
|
if flags & ToontownGlobals.FriendChat:
|
||||||
colorCode = NametagGlobals.CCFreeChat
|
colorCode = NametagGlobals.CCNormal
|
||||||
newFF = (friendPair[0], handle.getName(), colorCode)
|
newFF = (friendPair[0], handle.getName(), colorCode)
|
||||||
self.ffList.append(newFF)
|
self.ffList.append(newFF)
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -8,8 +8,6 @@ class FriendHandle:
|
||||||
def __init__(self, doId, name, style, petId, isAPet = False):
|
def __init__(self, doId, name, style, petId, isAPet = False):
|
||||||
self.doId = doId
|
self.doId = doId
|
||||||
self.style = style
|
self.style = style
|
||||||
self.commonChatFlags = 0
|
|
||||||
self.whitelistChatFlags = 0
|
|
||||||
self.petId = petId
|
self.petId = petId
|
||||||
self.isAPet = isAPet
|
self.isAPet = isAPet
|
||||||
self.chatGarbler = ToonChatGarbler.ToonChatGarbler()
|
self.chatGarbler = ToonChatGarbler.ToonChatGarbler()
|
||||||
|
@ -62,19 +60,11 @@ class FriendHandle:
|
||||||
base.cr.ttsFriendsManager.d_teleportGiveup(self.doId)
|
base.cr.ttsFriendsManager.d_teleportGiveup(self.doId)
|
||||||
|
|
||||||
def isUnderstandable(self):
|
def isUnderstandable(self):
|
||||||
if self.commonChatFlags & base.localAvatar.commonChatFlags & ToontownGlobals.CommonChat:
|
if settings['speedchatPlus']:
|
||||||
understandable = 1
|
return 1
|
||||||
elif self.commonChatFlags & ToontownGlobals.SuperChat:
|
elif settings['trueFriends'] and base.cr.getFriendFlags(self.doId) & ToontownGlobals.FriendChat:
|
||||||
understandable = 1
|
return 1
|
||||||
elif base.localAvatar.commonChatFlags & ToontownGlobals.SuperChat:
|
return 0
|
||||||
understandable = 1
|
|
||||||
elif base.cr.getFriendFlags(self.doId) & ToontownGlobals.FriendChat:
|
|
||||||
understandable = 1
|
|
||||||
elif self.whitelistChatFlags & base.localAvatar.whitelistChatFlags:
|
|
||||||
understandable = 1
|
|
||||||
else:
|
|
||||||
understandable = 0
|
|
||||||
return understandable
|
|
||||||
|
|
||||||
def scrubTalk(self, message, mods):
|
def scrubTalk(self, message, mods):
|
||||||
scrubbed = 0
|
scrubbed = 0
|
||||||
|
@ -117,7 +107,3 @@ class FriendHandle:
|
||||||
|
|
||||||
newText = ' '.join(newwords)
|
newText = ' '.join(newwords)
|
||||||
return newText
|
return newText
|
||||||
|
|
||||||
def setCommonAndWhitelistChatFlags(self, commonChatFlags, whitelistChatFlags):
|
|
||||||
self.commonChatFlags = commonChatFlags
|
|
||||||
self.whitelistChatFlags = whitelistChatFlags
|
|
||||||
|
|
|
@ -377,7 +377,7 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
|
||||||
else:
|
else:
|
||||||
self.right['state'] = 'normal'
|
self.right['state'] = 'normal'
|
||||||
|
|
||||||
def __friendOnline(self, doId, commonChatFlags, whitelistChatFlags):
|
def __friendOnline(self, doId):
|
||||||
if self.panelType == FLPOnline:
|
if self.panelType == FLPOnline:
|
||||||
self.__updateScrollList()
|
self.__updateScrollList()
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,8 @@ class TTSFriendsManager(DistributedObjectGlobal):
|
||||||
def friendList(self, resp):
|
def friendList(self, resp):
|
||||||
base.cr.handleGetFriendsList(resp)
|
base.cr.handleGetFriendsList(resp)
|
||||||
|
|
||||||
def friendOnline(self, id, commonChatFlags, whitelistChatFlags):
|
def friendOnline(self, id):
|
||||||
base.cr.handleFriendOnline(id, commonChatFlags, whitelistChatFlags)
|
base.cr.handleFriendOnline(id)
|
||||||
|
|
||||||
def friendOffline(self, id):
|
def friendOffline(self, id):
|
||||||
base.cr.handleFriendOffline(id)
|
base.cr.handleFriendOffline(id)
|
||||||
|
|
|
@ -248,8 +248,7 @@ class TTSFriendsManagerUD(DistributedObjectGlobalUD):
|
||||||
dnaString = fields['setDNAString'][0]
|
dnaString = fields['setDNAString'][0]
|
||||||
experience = fields['setExperience'][0]
|
experience = fields['setExperience'][0]
|
||||||
trackBonusLevel = fields['setTrackBonusLevel'][0]
|
trackBonusLevel = fields['setTrackBonusLevel'][0]
|
||||||
# We need an actual way to send the fields to the client...............
|
|
||||||
# Inventory, trackAccess, trophies, Hp, maxHp, defaultshard, lastHood, dnastring
|
|
||||||
self.sendUpdateToAvatarId(senderId, 'friendDetails', [avId, inventory, trackAccess, trophies, hp, maxHp, defaultShard, lastHood, dnaString, experience, trackBonusLevel])
|
self.sendUpdateToAvatarId(senderId, 'friendDetails', [avId, inventory, trackAccess, trophies, hp, maxHp, defaultShard, lastHood, dnaString, experience, trackBonusLevel])
|
||||||
self.air.dbInterface.queryObject(self.air.dbId, avId, handleToon)
|
self.air.dbInterface.queryObject(self.air.dbId, avId, handleToon)
|
||||||
|
|
||||||
|
@ -287,8 +286,8 @@ class TTSFriendsManagerUD(DistributedObjectGlobalUD):
|
||||||
for friend in friendsList:
|
for friend in friendsList:
|
||||||
friendId = friend[0]
|
friendId = friend[0]
|
||||||
if friend[0] in self.onlineToons:
|
if friend[0] in self.onlineToons:
|
||||||
self.sendUpdateToAvatarId(doId, 'friendOnline', [friendId, 0, 0])
|
self.sendUpdateToAvatarId(doId, 'friendOnline', [friendId])
|
||||||
self.sendUpdateToAvatarId(friendId, 'friendOnline', [doId, 0, 0])
|
self.sendUpdateToAvatarId(friendId, 'friendOnline', [doId])
|
||||||
|
|
||||||
def goingOffline(self, avId):
|
def goingOffline(self, avId):
|
||||||
self.toonOffline(avId)
|
self.toonOffline(avId)
|
||||||
|
|
|
@ -1,15 +1,13 @@
|
||||||
from pandac.PandaModules import VBase4
|
from pandac.PandaModules import VBase4
|
||||||
|
from otp.otpbase import OTPGlobals
|
||||||
|
|
||||||
CCNormal = 0
|
CCNormal = 0
|
||||||
CCNoChat = 1
|
CCNonPlayer = 1
|
||||||
CCNonPlayer = 2
|
CCSuit = 2
|
||||||
CCSuit = 3
|
CCToonBuilding = 3
|
||||||
CCToonBuilding = 4
|
CCSuitBuilding = 4
|
||||||
CCSuitBuilding = 5
|
CCHouseBuilding = 5
|
||||||
CCHouseBuilding = 6
|
CCSpeedChat = 6
|
||||||
CCSpeedChat = 7
|
|
||||||
CCFreeChat = 8
|
|
||||||
|
|
||||||
CHAT = 0
|
CHAT = 0
|
||||||
SPEEDCHAT = 1
|
SPEEDCHAT = 1
|
||||||
|
@ -135,22 +133,18 @@ def getModelWidthHeight(model):
|
||||||
height = maxPoint.getZ() - minPoint.getZ()
|
height = maxPoint.getZ() - minPoint.getZ()
|
||||||
return (width, height)
|
return (width, height)
|
||||||
|
|
||||||
|
def getFriendColor(id):
|
||||||
|
return CCNormal if settings['trueFriends'] and base.cr.getFriendFlags(id) & OTPGlobals.FriendChat else CCNormal
|
||||||
|
|
||||||
# Foreground, background:
|
# Foreground, background:
|
||||||
NametagColors = {
|
NametagColors = {
|
||||||
CCNormal: (
|
CCNormal: ( # Blue
|
||||||
(VBase4(0.3, 0.3, 0.7, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
|
(VBase4(0.3, 0.3, 0.7, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
|
||||||
(VBase4(0.3, 0.3, 0.7, 1.0), VBase4(0.2, 0.2, 0.2, 0.1875)), # Down
|
(VBase4(0.3, 0.3, 0.7, 1.0), VBase4(0.2, 0.2, 0.2, 0.1875)), # Down
|
||||||
(VBase4(0.5, 0.5, 1.0, 1.0), VBase4(1.0, 1.0, 1.0, 0.5625)), # Rollover
|
(VBase4(0.5, 0.5, 1.0, 1.0), VBase4(1.0, 1.0, 1.0, 0.5625)), # Rollover
|
||||||
(VBase4(0.3, 0.3, 0.7, 1.0), VBase4(1.0, 1.0, 1.0, 0.375)) # Disabled
|
(VBase4(0.3, 0.3, 0.7, 1.0), VBase4(1.0, 1.0, 1.0, 0.375)) # Disabled
|
||||||
),
|
),
|
||||||
CCNoChat: (
|
CCNonPlayer: ( # Orange
|
||||||
(VBase4(0.8, 0.4, 0.0, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
|
|
||||||
(VBase4(1.0, 0.5, 0.5, 1.0), VBase4(0.2, 0.2, 0.2, 0.1875)), # Click
|
|
||||||
(VBase4(1.0, 0.5, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 0.5625)), # Rollover
|
|
||||||
(VBase4(0.8, 0.4, 0.0, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)) # Disabled
|
|
||||||
),
|
|
||||||
CCNonPlayer: (
|
|
||||||
(VBase4(0.8, 0.4, 0.0, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
|
(VBase4(0.8, 0.4, 0.0, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
|
||||||
(VBase4(0.8, 0.4, 0.0, 1.0), VBase4(0.8, 0.8, 0.8, 0.1875)), # Down
|
(VBase4(0.8, 0.4, 0.0, 1.0), VBase4(0.8, 0.8, 0.8, 0.1875)), # Down
|
||||||
(VBase4(0.8, 0.4, 0.0, 1.0), VBase4(0.8, 0.8, 0.8, 0.5625)), # Rollover
|
(VBase4(0.8, 0.4, 0.0, 1.0), VBase4(0.8, 0.8, 0.8, 0.5625)), # Rollover
|
||||||
|
@ -181,17 +175,11 @@ NametagColors = {
|
||||||
(VBase4(0.5, 0.5, 1.0, 1.0), VBase4(1.0, 1.0, 1.0, 0.5625)), # Rollover
|
(VBase4(0.5, 0.5, 1.0, 1.0), VBase4(1.0, 1.0, 1.0, 0.5625)), # Rollover
|
||||||
(VBase4(0.0, 0.6, 0.2, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)) # Disabled
|
(VBase4(0.0, 0.6, 0.2, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)) # Disabled
|
||||||
),
|
),
|
||||||
CCSpeedChat: (
|
CCSpeedChat: ( # Green
|
||||||
(VBase4(0.0, 0.6, 0.2, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
|
(VBase4(0.0, 0.6, 0.2, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
|
||||||
(VBase4(0.0, 0.5, 0.0, 1.0), VBase4(0.5, 0.5, 0.5, 0.1875)), # Down
|
(VBase4(0.0, 0.5, 0.0, 1.0), VBase4(0.5, 0.5, 0.5, 0.1875)), # Down
|
||||||
(VBase4(0.0, 0.7, 0.2, 1.0), VBase4(1.0, 1.0, 1.0, 0.5625)), # Rollover
|
(VBase4(0.0, 0.7, 0.2, 1.0), VBase4(1.0, 1.0, 1.0, 0.5625)), # Rollover
|
||||||
(VBase4(0.0, 0.6, 0.2, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)) # Disabled
|
(VBase4(0.0, 0.6, 0.2, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)) # Disabled
|
||||||
),
|
|
||||||
CCFreeChat: (
|
|
||||||
(VBase4(0.3, 0.3, 0.7, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)), # Normal
|
|
||||||
(VBase4(0.2, 0.2, 0.5, 1.0), VBase4(0.2, 0.2, 0.2, 0.1875)), # Down
|
|
||||||
(VBase4(0.5, 0.5, 1.0, 1.0), VBase4(1.0, 1.0, 1.0, 0.5625)), # Rollover
|
|
||||||
(VBase4(0.3, 0.3, 0.7, 1.0), VBase4(0.8, 0.8, 0.8, 0.375)) # Disabled
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -203,12 +191,6 @@ ChatColors = {
|
||||||
(VBase4(0.0, 0.6, 0.6, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
|
(VBase4(0.0, 0.6, 0.6, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
|
||||||
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
|
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
|
||||||
),
|
),
|
||||||
CCNoChat: (
|
|
||||||
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Normal
|
|
||||||
(VBase4(1.0, 0.5, 0.5, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Click
|
|
||||||
(VBase4(0.0, 0.6, 0.6, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
|
|
||||||
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
|
|
||||||
),
|
|
||||||
CCNonPlayer: (
|
CCNonPlayer: (
|
||||||
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Normal
|
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Normal
|
||||||
(VBase4(1.0, 0.5, 0.5, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Click
|
(VBase4(1.0, 0.5, 0.5, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Click
|
||||||
|
@ -244,11 +226,5 @@ ChatColors = {
|
||||||
(VBase4(1.0, 0.5, 0.5, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Down
|
(VBase4(1.0, 0.5, 0.5, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Down
|
||||||
(VBase4(0.0, 0.6, 0.6, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
|
(VBase4(0.0, 0.6, 0.6, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
|
||||||
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
|
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
|
||||||
),
|
|
||||||
CCFreeChat: (
|
|
||||||
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Normal
|
|
||||||
(VBase4(1.0, 0.5, 0.5, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Down
|
|
||||||
(VBase4(0.0, 0.6, 0.6, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)), # Rollover
|
|
||||||
(VBase4(0.0, 0.0, 0.0, 1.0), VBase4(1.0, 1.0, 1.0, 1.0)) # Disabled
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ from pandac.PandaModules import *
|
||||||
|
|
||||||
import DisplaySettingsDialog
|
import DisplaySettingsDialog
|
||||||
import ShtikerPage
|
import ShtikerPage
|
||||||
|
from otp.avatar import Avatar
|
||||||
from otp.speedchat import SCColorScheme
|
from otp.speedchat import SCColorScheme
|
||||||
from otp.speedchat import SCStaticTextTerminal
|
from otp.speedchat import SCStaticTextTerminal
|
||||||
from otp.speedchat import SpeedChat
|
from otp.speedchat import SpeedChat
|
||||||
|
@ -762,10 +763,32 @@ class ExtraOptionsTabPage(DirectFrame):
|
||||||
self.settingsChanged = 1
|
self.settingsChanged = 1
|
||||||
self.__setCogLevelGuiButton()
|
self.__setCogLevelGuiButton()
|
||||||
|
|
||||||
|
def __doToggleSpeedchatPlus(self):
|
||||||
|
messenger.send('wakeup')
|
||||||
|
settings['speedchatPlus'] = not settings['speedchatPlus']
|
||||||
|
Avatar.reconsiderAllUnderstandable()
|
||||||
|
self.settingsChanged = 1
|
||||||
|
self.__setSpeedchatPlusButton()
|
||||||
|
|
||||||
def __setCogLevelGuiButton(self):
|
def __setCogLevelGuiButton(self):
|
||||||
self.cogLevel_label['text'] = TTLocalizer.CogLevelLabelOn if settings['cogLevel'] else TTLocalizer.CogLevelLabelOff
|
self.cogLevel_label['text'] = TTLocalizer.CogLevelLabelOn if settings['cogLevel'] else TTLocalizer.CogLevelLabelOff
|
||||||
self.cogLevel_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['cogLevel'] else TTLocalizer.OptionsPageToggleOn
|
self.cogLevel_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['cogLevel'] else TTLocalizer.OptionsPageToggleOn
|
||||||
|
|
||||||
|
def __setSpeedchatPlusButton(self):
|
||||||
|
self.speedchatPlus_label['text'] = TTLocalizer.SpeedchatPlusLabelOn if settings['speedchatPlus'] else TTLocalizer.SpeedchatPlusLabelOff
|
||||||
|
self.speedchatPlus_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['speedchatPlus'] else TTLocalizer.OptionsPageToggleOn
|
||||||
|
|
||||||
|
def __doToggleTrueFriends(self):
|
||||||
|
messenger.send('wakeup')
|
||||||
|
settings['trueFriends'] = not settings['trueFriends']
|
||||||
|
Avatar.reconsiderAllUnderstandable()
|
||||||
|
self.settingsChanged = 1
|
||||||
|
self.__setTrueFriendsButton()
|
||||||
|
|
||||||
|
def __setTrueFriendsButton(self):
|
||||||
|
self.trueFriends_label['text'] = TTLocalizer.TrueFriendsLabelOn if settings['trueFriends'] else TTLocalizer.TrueFriendsLabelOff
|
||||||
|
self.trueFriends_toggleButton['text'] = TTLocalizer.OptionsPageToggleOff if settings['trueFriends'] else TTLocalizer.OptionsPageToggleOn
|
||||||
|
|
||||||
def showReportNotice(self):
|
def showReportNotice(self):
|
||||||
self.dialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.BugReportNotice, command=self.confirmBugReport)
|
self.dialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.BugReportNotice, command=self.confirmBugReport)
|
||||||
self.dialog.show()
|
self.dialog.show()
|
||||||
|
|
|
@ -204,7 +204,7 @@ class TownBattleSOSPanel(DirectFrame, StateData.StateData):
|
||||||
else:
|
else:
|
||||||
self.title['text'] = TTLocalizer.TownBattleSOSWhichFriend
|
self.title['text'] = TTLocalizer.TownBattleSOSWhichFriend
|
||||||
|
|
||||||
def __friendOnline(self, doId, commonChatFlags, whitelistChatFlags):
|
def __friendOnline(self, doId):
|
||||||
self.__updateScrollList()
|
self.__updateScrollList()
|
||||||
self.__updateTitleText()
|
self.__updateTitleText()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue