Reconsider toons only when switching true friends/speedchat

This commit is contained in:
John 2015-06-18 17:02:51 +03:00
parent 6c94355d39
commit 884e452e32
3 changed files with 9 additions and 5 deletions

View file

@ -6,11 +6,11 @@ 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
from toontown.toonbase import TTLocalizer, ToontownGlobals
from toontown.toon import Toon
from toontown.toontowngui import TTDialog
import webbrowser
@ -790,7 +790,7 @@ class ExtraOptionsTabPage(DirectFrame):
def __doToggleSpeedchatPlus(self):
messenger.send('wakeup')
settings['speedchatPlus'] = not settings['speedchatPlus']
Avatar.reconsiderAllUnderstandable()
Toon.reconsiderAllToonsUnderstandable()
self.settingsChanged = 1
self.__setSpeedchatPlusButton()
@ -801,7 +801,7 @@ class ExtraOptionsTabPage(DirectFrame):
def __doToggleTrueFriends(self):
messenger.send('wakeup')
settings['trueFriends'] = not settings['trueFriends']
Avatar.reconsiderAllUnderstandable()
Toon.reconsiderAllToonsUnderstandable()
self.settingsChanged = 1
self.__setTrueFriendsButton()

View file

@ -65,7 +65,6 @@ from toontown.battle import BattleParticles
if base.wantKarts:
from toontown.racing.KartDNA import *
class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, DistributedSmoothNode.DistributedSmoothNode, DelayDeletable):
notify = DirectNotifyGlobal.directNotify.newCategory('DistributedToon')
partyNotify = DirectNotifyGlobal.directNotify.newCategory('DistributedToon_Party')
@ -2519,7 +2518,7 @@ class DistributedToon(DistributedPlayer.DistributedPlayer, Toon.Toon, Distribute
self.d_setTrueFriends(trueFriends)
def setTrueFriends(self, trueFriends):
Avatar.reconsiderAllUnderstandable()
Toon.reconsiderAllToonsUnderstandable()
self.trueFriends = trueFriends
def d_setTrueFriends(self, trueFriends):

View file

@ -395,6 +395,11 @@ def unloadDialog():
BearDialogueArray = []
PigDialogueArray = []
def reconsiderAllToonsUnderstandable():
for av in Avatar.Avatar.ActiveAvatars:
if isinstance(av, Toon):
av.considerUnderstandable()
class Toon(Avatar.Avatar, ToonHead):
notify = DirectNotifyGlobal.directNotify.newCategory('Toon')
afkTimeout = base.config.GetInt('afk-timeout', 600)