DANIEL: Beginning of chat stuff

This commit is contained in:
John 2015-05-30 19:09:41 +03:00 committed by Loudrob
parent a6e7fb9d83
commit 1b2c00f7a1
19 changed files with 69 additions and 176 deletions

View file

@ -173,8 +173,6 @@ dclass DistributedPlayer : DistributedAvatar {
setWhisperSCCustomFrom(DoId fromAv, uint16 msgIndex) ownrecv clsend;
setWhisperSCEmoteFrom(DoId fromAv, uint16 emoteId) ownrecv clsend;
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;
setSCCustom(uint16 msgIndex) broadcast ownsend airecv;
setFriendsList(FriendEntry[] = []) ownrecv required db airecv;
@ -3363,7 +3361,7 @@ dclass TTSFriendsManager : DistributedObjectGlobal {
friendInfo(Friend);
friendList(Friend []);
friendOnline(uint32, uint8, uint8);
friendOnline(uint32);
friendOffline(uint32);
goingOffline(uint32 avId);

View file

@ -67,7 +67,6 @@ class Avatar(Actor, ShadowCaster):
self.battleTubeHeight = 0.0
self.battleTubeRadius = 0.0
self.style = None
self.commonChatFlags = 0
self.understandable = 1
self.setPlayerType(NametagGlobals.CCNormal)
self.ghostMode = 0
@ -81,7 +80,6 @@ class Avatar(Actor, ShadowCaster):
self.__chatLocal = 0
self.__chatQuitButton = False
self.__currentDialogue = None
self.whitelistChatFlags = 0
def delete(self):
try:
@ -127,50 +125,34 @@ class Avatar(Actor, ShadowCaster):
chatColor = NametagGlobals.ChatColors[self.playerType]
self.nametag.setChatColor(chatColor)
else:
nametagColor = NametagGlobals.NametagColors[NametagGlobals.CCNoChat]
nametagColor = NametagGlobals.NametagColors[NametagGlobals.CCNonPlayer]
self.nametag.setNametagColor(nametagColor)
chatColor = NametagGlobals.ChatColors[NametagGlobals.CCNoChat]
chatColor = NametagGlobals.ChatColors[NametagGlobals.CCNonPlayer]
self.nametag.setChatColor(chatColor)
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):
if self.playerType in (NametagGlobals.CCNormal, NametagGlobals.CCFreeChat, NametagGlobals.CCSpeedChat):
if self.playerType in (NametagGlobals.CCNormal, NametagGlobals.CCSpeedChat):
self.setPlayerType(NametagGlobals.CCSpeedChat)
if hasattr(base, 'localAvatar') and (self == base.localAvatar):
self.understandable = 1
self.setPlayerType(NametagGlobals.CCFreeChat)
self.setPlayerType(NametagGlobals.CCNormal)
elif self.playerType == NametagGlobals.CCSuit:
self.understandable = 1
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.setPlayerType(NametagGlobals.CCNoChat)
elif hasattr(base, 'localAvatar') and self.commonChatFlags & base.localAvatar.commonChatFlags & OTPGlobals.CommonChat:
self.setPlayerType(NametagGlobals.CCNonPlayer)
elif False and hasattr(self, 'adminAccess') and self.adminAccess >= CATEGORY_COMMUNITY_MANAGER:
print 'admin'
self.understandable = 1
self.setPlayerType(NametagGlobals.CCFreeChat)
elif self.commonChatFlags & OTPGlobals.SuperChat:
self.setPlayerType(NametagGlobals.CCNormal)
elif settings['trueFriends'] and base.cr.getFriendFlags(self.doId) & OTPGlobals.FriendChat:
self.understandable = 1
self.setPlayerType(NametagGlobals.CCFreeChat)
elif hasattr(base, 'localAvatar') and base.localAvatar.commonChatFlags & OTPGlobals.SuperChat:
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.setPlayerType(NametagGlobals.CCNormal)
elif settings['speedchatPlus']:
self.understandable = 1
self.setPlayerType(NametagGlobals.CCSpeedChat)
else:
self.understandable = 0
if not hasattr(self, 'nametag'):

View file

@ -71,12 +71,6 @@ class DistributedPlayerAI(DistributedAvatarAI.DistributedAvatarAI, PlayerBase.Pl
def d_setSystemMessage(self, 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):
self.sendUpdate('friendsNotify', [avId, status])

View file

@ -54,7 +54,6 @@ class LocalAvatar(DistributedAvatar.DistributedAvatar, DistributedSmoothNode.Dis
self.customMessages = []
self.chatMgr = chatMgr
base.talkAssistant = talkAssistant
self.commonChatFlags = 0
self.garbleChat = 1
self.teleportAllowed = 1
self.lockedDown = 0
@ -1128,10 +1127,8 @@ class LocalAvatar(DistributedAvatar.DistributedAvatar, DistributedSmoothNode.Dis
self.ccPusherTrav.traverse(n)
return
def __friendOnline(self, doId, commonChatFlags = 0, whitelistChatFlags = 0):
def __friendOnline(self, doId):
friend = base.cr.identifyFriend(doId)
if friend != None and hasattr(friend, 'setCommonAndWhitelistChatFlags'):
friend.setCommonAndWhitelistChatFlags(commonChatFlags, whitelistChatFlags)
if self.oldFriendsList != None:
now = globalClock.getFrameTime()
elapsed = now - self.timeFriendsListChanged

View file

@ -77,9 +77,6 @@ class ChatInputTyped(DirectObject.DirectObject):
self.cancelButton.show()
self.typedChatButton.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):
self.chatEntry.set('')

View file

@ -79,19 +79,6 @@ class ChatInputWhiteListFrame(FSM.FSM, DirectFrame):
def requestMode(self, 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):
self.deactivate()
localAvatar.chatMgr.fsm.request('mainMenu')

View file

@ -204,45 +204,6 @@ class TalkAssistant(DirectObject.DirectObject):
message.getSenderAccountName(),
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):
error = None
if not avatarName and senderAvId:

View file

@ -50,7 +50,7 @@ class FriendManager(DistributedObject.DistributedObject):
def up_inviteeFriendResponse(self, yesNoMaybe, context):
if yesNoMaybe == 1:
base.cr.ttsFriendsManager.friendOnline(self.otherToon, 0, 0)
base.cr.ttsFriendsManager.friendOnline(self.otherToon)
self.sendUpdate('inviteeFriendResponse', [yesNoMaybe, context])
self.notify.debug('Client: inviteeFriendResponse(%d, %d)' % (yesNoMaybe, context))
@ -64,7 +64,7 @@ class FriendManager(DistributedObject.DistributedObject):
def friendResponse(self, yesNoMaybe, context):
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))
messenger.send('friendResponse', [yesNoMaybe, context])

View file

@ -19,7 +19,6 @@ AICollMovePriority = 8
MaxFriends = 200
MaxBackCatalog = 48
FriendChat = 1
CommonChat = 1
SuperChat = 2
MaxCustomMessages = 25
SPInvalid = 0

View file

@ -1024,7 +1024,7 @@ class CatalogScreen(DirectFrame):
def __makeFFlist(self):
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):
for ff in self.ffList:

View file

@ -94,7 +94,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
self.friendsOnline = {}
self.friendsMapPending = 0
self.friendsListError = 0
self.friendPendingChatSettings = {}
self.elderFriendsMap = {}
self.__queryAvatarMap = {}
self.hoodMgr = HoodMgr.HoodMgr(self)
@ -762,9 +761,6 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
self.friendsMap[doId] = handle
if doId in self.friendsOnline:
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():
@ -798,13 +794,11 @@ class ToontownClientRepository(OTPClientRepository.OTPClientRepository):
if avatarHandleList:
messenger.send('gotExtraFriendHandles', [avatarHandleList])
def handleFriendOnline(self, doId, commonChatFlags, whitelistChatFlags):
self.notify.debug('Friend %d now online. common=%d whitelist=%d' % (doId, commonChatFlags, whitelistChatFlags))
def handleFriendOnline(self, doId):
self.notify.debug('Friend %d now online.' % doId)
if doId not in self.friendsOnline:
self.friendsOnline[doId] = self.identifyFriend(doId)
messenger.send('friendOnline', [doId, commonChatFlags, whitelistChatFlags])
if not self.friendsOnline[doId]:
self.friendPendingChatSettings[doId] = (commonChatFlags, whitelistChatFlags)
messenger.send('friendOnline', [doId])
def handleFriendOffline(self, doId):
self.notify.debug('Friend %d now offline.' % doId)

View file

@ -112,7 +112,7 @@ class ToonStatueSelectionGUI(DirectFrame):
if hasattr(handle, 'getName'):
colorCode = NametagGlobals.CCSpeedChat
if flags & ToontownGlobals.FriendChat:
colorCode = NametagGlobals.CCFreeChat
colorCode = NametagGlobals.CCNormal
newFF = (friendPair[0], handle.getName(), colorCode)
self.ffList.append(newFF)
else:

View file

@ -8,8 +8,6 @@ class FriendHandle:
def __init__(self, doId, name, style, petId, isAPet = False):
self.doId = doId
self.style = style
self.commonChatFlags = 0
self.whitelistChatFlags = 0
self.petId = petId
self.isAPet = isAPet
self.chatGarbler = ToonChatGarbler.ToonChatGarbler()
@ -62,19 +60,11 @@ class FriendHandle:
base.cr.ttsFriendsManager.d_teleportGiveup(self.doId)
def isUnderstandable(self):
if self.commonChatFlags & base.localAvatar.commonChatFlags & ToontownGlobals.CommonChat:
understandable = 1
elif self.commonChatFlags & ToontownGlobals.SuperChat:
understandable = 1
elif base.localAvatar.commonChatFlags & ToontownGlobals.SuperChat:
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
if settings['speedchatPlus']:
return 1
elif settings['trueFriends'] and base.cr.getFriendFlags(self.doId) & ToontownGlobals.FriendChat:
return 1
return 0
def scrubTalk(self, message, mods):
scrubbed = 0
@ -117,7 +107,3 @@ class FriendHandle:
newText = ' '.join(newwords)
return newText
def setCommonAndWhitelistChatFlags(self, commonChatFlags, whitelistChatFlags):
self.commonChatFlags = commonChatFlags
self.whitelistChatFlags = whitelistChatFlags

View file

@ -377,7 +377,7 @@ class FriendsListPanel(DirectFrame, StateData.StateData):
else:
self.right['state'] = 'normal'
def __friendOnline(self, doId, commonChatFlags, whitelistChatFlags):
def __friendOnline(self, doId):
if self.panelType == FLPOnline:
self.__updateScrollList()

View file

@ -18,8 +18,8 @@ class TTSFriendsManager(DistributedObjectGlobal):
def friendList(self, resp):
base.cr.handleGetFriendsList(resp)
def friendOnline(self, id, commonChatFlags, whitelistChatFlags):
base.cr.handleFriendOnline(id, commonChatFlags, whitelistChatFlags)
def friendOnline(self, id):
base.cr.handleFriendOnline(id)
def friendOffline(self, id):
base.cr.handleFriendOffline(id)

View file

@ -248,8 +248,7 @@ class TTSFriendsManagerUD(DistributedObjectGlobalUD):
dnaString = fields['setDNAString'][0]
experience = fields['setExperience'][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.air.dbInterface.queryObject(self.air.dbId, avId, handleToon)
@ -287,8 +286,8 @@ class TTSFriendsManagerUD(DistributedObjectGlobalUD):
for friend in friendsList:
friendId = friend[0]
if friend[0] in self.onlineToons:
self.sendUpdateToAvatarId(doId, 'friendOnline', [friendId, 0, 0])
self.sendUpdateToAvatarId(friendId, 'friendOnline', [doId, 0, 0])
self.sendUpdateToAvatarId(doId, 'friendOnline', [friendId])
self.sendUpdateToAvatarId(friendId, 'friendOnline', [doId])
def goingOffline(self, avId):
self.toonOffline(avId)

View file

@ -1,15 +1,13 @@
from pandac.PandaModules import VBase4
from otp.otpbase import OTPGlobals
CCNormal = 0
CCNoChat = 1
CCNonPlayer = 2
CCSuit = 3
CCToonBuilding = 4
CCSuitBuilding = 5
CCHouseBuilding = 6
CCSpeedChat = 7
CCFreeChat = 8
CCNonPlayer = 1
CCSuit = 2
CCToonBuilding = 3
CCSuitBuilding = 4
CCHouseBuilding = 5
CCSpeedChat = 6
CHAT = 0
SPEEDCHAT = 1
@ -135,22 +133,18 @@ def getModelWidthHeight(model):
height = maxPoint.getZ() - minPoint.getZ()
return (width, height)
def getFriendColor(id):
return CCNormal if settings['trueFriends'] and base.cr.getFriendFlags(id) & OTPGlobals.FriendChat else CCNormal
# Foreground, background:
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.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(1.0, 1.0, 1.0, 0.375)) # Disabled
),
CCNoChat: (
(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: (
CCNonPlayer: ( # Orange
(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.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.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.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.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.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: (
(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
@ -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(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
),
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
)
}

View file

@ -6,6 +6,7 @@ from pandac.PandaModules import *
import DisplaySettingsDialog
import ShtikerPage
from otp.avatar import Avatar
from otp.speedchat import SCColorScheme
from otp.speedchat import SCStaticTextTerminal
from otp.speedchat import SpeedChat
@ -762,10 +763,32 @@ class ExtraOptionsTabPage(DirectFrame):
self.settingsChanged = 1
self.__setCogLevelGuiButton()
def __doToggleSpeedchatPlus(self):
messenger.send('wakeup')
settings['speedchatPlus'] = not settings['speedchatPlus']
Avatar.reconsiderAllUnderstandable()
self.settingsChanged = 1
self.__setSpeedchatPlusButton()
def __setCogLevelGuiButton(self):
self.cogLevel_label['text'] = TTLocalizer.CogLevelLabelOn if settings['cogLevel'] else TTLocalizer.CogLevelLabelOff
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):
self.dialog = TTDialog.TTDialog(style=TTDialog.YesNo, text=TTLocalizer.BugReportNotice, command=self.confirmBugReport)
self.dialog.show()

View file

@ -204,7 +204,7 @@ class TownBattleSOSPanel(DirectFrame, StateData.StateData):
else:
self.title['text'] = TTLocalizer.TownBattleSOSWhichFriend
def __friendOnline(self, doId, commonChatFlags, whitelistChatFlags):
def __friendOnline(self, doId):
self.__updateScrollList()
self.__updateTitleText()