def exitFLM(self):
     self.notify.debug('FriendsListManager: exitFLM()')
     if self._preserveFriendsList:
         return
     if not self._entered:
         return
     self._entered = False
     self.ignore('openFriendsList')
     self.ignore('clickedNametag')
     base.localAvatar.setFriendsListButtonActive(0)
     NametagGlobals.setMasterNametagsActive(0)
     if self.avatarPanel:
         self.avatarPanel.cleanup()
         self.avatarPanel = None
     self.ignore('gotoAvatar')
     self.ignore('friendAvatar')
     self.ignore('avatarDetails')
     FriendsListPanel.hideFriendsList()
     if base.cr.friendManager:
         base.cr.friendManager.setAvailable(0)
     self.ignore('friendInvitation')
     FriendInviter.hideFriendInviter()
     ToonAvatarDetailPanel.hideAvatarDetail()
     ToonTeleportPanel.hideTeleportPanel()
     return
 def __init__(self, avId, avName, avDisableName):
     DirectFrame.__init__(self, pos=(-1.033, 0.1, -0.35), parent=base.a2dTopRight, image_color=GlobalDialogColor, image_scale=(1.0, 1.0, 0.6), text='', text_wordwrap=TTLocalizer.FIdirectFrameWordwrap, text_scale=TTLocalizer.FIdirectFrame, text_pos=TTLocalizer.FIdirectFramePos)
     self['image'] = DGG.getDefaultDialogGeom()
     self.avId = avId
     self.toonName = avName
     avatar = base.cr.doId2do.get(self.avId)
     self.avDisableName = avDisableName
     self.fsm = ClassicFSM.ClassicFSM('FriendInviter', [State.State('off', self.enterOff, self.exitOff),
      State.State('getNewFriend', self.enterGetNewFriend, self.exitGetNewFriend),
      State.State('check', self.enterCheck, self.exitCheck),
      State.State('tooMany', self.enterTooMany, self.exitTooMany),
      State.State('checkAvailability', self.enterCheckAvailability, self.exitCheckAvailability),
      State.State('notAvailable', self.enterNotAvailable, self.exitNotAvailable),
      State.State('notAcceptingFriends', self.enterNotAcceptingFriends, self.exitNotAcceptingFriends),
      State.State('wentAway', self.enterWentAway, self.exitWentAway),
      State.State('already', self.enterAlready, self.exitAlready),
      State.State('askingCog', self.enterAskingCog, self.exitAskingCog),
      State.State('askingPet', self.enterAskingPet, self.exitAskingPet),
      State.State('endFriendship', self.enterEndFriendship, self.exitEndFriendship),
      State.State('friendsNoMore', self.enterFriendsNoMore, self.exitFriendsNoMore),
      State.State('self', self.enterSelf, self.exitSelf),
      State.State('ignored', self.enterIgnored, self.exitIgnored),
      State.State('asking', self.enterAsking, self.exitAsking),
      State.State('yes', self.enterYes, self.exitYes),
      State.State('no', self.enterNo, self.exitNo),
      State.State('otherTooMany', self.enterOtherTooMany, self.exitOtherTooMany),
      State.State('maybe', self.enterMaybe, self.exitMaybe),
      State.State('down', self.enterDown, self.exitDown),
      State.State('cancel', self.enterCancel, self.exitCancel)], 'off', 'off')
     self.context = None
     from src.toontown.toon import ToonAvatarDetailPanel
     ToonTeleportPanel.hideTeleportPanel()
     ToonAvatarDetailPanel.hideAvatarDetail()
     buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
     gui = loader.loadModel('phase_3.5/models/gui/avatar_panel_gui')
     self.bOk = DirectButton(self, image=(buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr')), relief=None, text=OTPLocalizer.FriendInviterOK, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.0, 0.0, -0.1), command=self.__handleOk)
     self.bOk.hide()
     self.bCancel = DirectButton(self, image=(buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr')), relief=None, text=OTPLocalizer.FriendInviterCancel, text_scale=0.05, text_pos=(0.0, -0.1), pos=TTLocalizer.FIbCancelPos, command=self.__handleCancel)
     self.bCancel.hide()
     self.bStop = DirectButton(self, image=(gui.find('**/Ignore_Btn_UP'), gui.find('**/Ignore_Btn_DN'), gui.find('**/Ignore_Btn_RLVR')), relief=None, text=OTPLocalizer.FriendInviterStopBeingFriends, text_align=TextNode.ALeft, text_scale=TTLocalizer.FIbStop, text_pos=TTLocalizer.FIbStopTextPos, pos=TTLocalizer.FIbStopPos, command=self.__handleStop)
     self.bStop.hide()
     self.bYes = DirectButton(self, image=(buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr')), relief=None, text=OTPLocalizer.FriendInviterYes, text_scale=0.05, text_pos=(0.0, -0.1), pos=TTLocalizer.FIbYesPos, command=self.__handleYes)
     self.bYes.hide()
     self.bNo = DirectButton(self, image=(buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr')), relief=None, text=OTPLocalizer.FriendInviterNo, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.15, 0.0, -0.1), command=self.__handleNo)
     self.bNo.hide()
     buttons.removeNode()
     gui.removeNode()
     self.fsm.enterInitialState()
     if self.avId == None:
         self.fsm.request('getNewFriend')
     else:
         self.fsm.request('check')
     return
Example #3
0
 def __init__(self, avId, avName, avDisableName):
     DirectFrame.__init__(self,
                          pos=(-1.033, 0.1, -0.35),
                          parent=base.a2dTopRight,
                          image_color=GlobalDialogColor,
                          image_scale=(1.0, 1.0, 0.6),
                          text='',
                          text_wordwrap=TTLocalizer.FIdirectFrameWordwrap,
                          text_scale=TTLocalizer.FIdirectFrame,
                          text_pos=TTLocalizer.FIdirectFramePos)
     self['image'] = DGG.getDefaultDialogGeom()
     self.avId = avId
     self.toonName = avName
     avatar = base.cr.doId2do.get(self.avId)
     self.avDisableName = avDisableName
     self.fsm = ClassicFSM.ClassicFSM('FriendInviter', [
         State.State('off', self.enterOff, self.exitOff),
         State.State('getNewFriend', self.enterGetNewFriend,
                     self.exitGetNewFriend),
         State.State('check', self.enterCheck, self.exitCheck),
         State.State('tooMany', self.enterTooMany, self.exitTooMany),
         State.State('checkAvailability', self.enterCheckAvailability,
                     self.exitCheckAvailability),
         State.State('notAvailable', self.enterNotAvailable,
                     self.exitNotAvailable),
         State.State('notAcceptingFriends', self.enterNotAcceptingFriends,
                     self.exitNotAcceptingFriends),
         State.State('wentAway', self.enterWentAway, self.exitWentAway),
         State.State('already', self.enterAlready, self.exitAlready),
         State.State('askingCog', self.enterAskingCog, self.exitAskingCog),
         State.State('askingPet', self.enterAskingPet, self.exitAskingPet),
         State.State('endFriendship', self.enterEndFriendship,
                     self.exitEndFriendship),
         State.State('friendsNoMore', self.enterFriendsNoMore,
                     self.exitFriendsNoMore),
         State.State('self', self.enterSelf, self.exitSelf),
         State.State('ignored', self.enterIgnored, self.exitIgnored),
         State.State('asking', self.enterAsking, self.exitAsking),
         State.State('yes', self.enterYes, self.exitYes),
         State.State('no', self.enterNo, self.exitNo),
         State.State('otherTooMany', self.enterOtherTooMany,
                     self.exitOtherTooMany),
         State.State('maybe', self.enterMaybe, self.exitMaybe),
         State.State('down', self.enterDown, self.exitDown),
         State.State('cancel', self.enterCancel, self.exitCancel)
     ], 'off', 'off')
     self.context = None
     from src.toontown.toon import ToonAvatarDetailPanel
     ToonTeleportPanel.hideTeleportPanel()
     ToonAvatarDetailPanel.hideAvatarDetail()
     buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
     gui = loader.loadModel('phase_3.5/models/gui/avatar_panel_gui')
     self.bOk = DirectButton(self,
                             image=(buttons.find('**/ChtBx_OKBtn_UP'),
                                    buttons.find('**/ChtBx_OKBtn_DN'),
                                    buttons.find('**/ChtBx_OKBtn_Rllvr')),
                             relief=None,
                             text=OTPLocalizer.FriendInviterOK,
                             text_scale=0.05,
                             text_pos=(0.0, -0.1),
                             pos=(0.0, 0.0, -0.1),
                             command=self.__handleOk)
     self.bOk.hide()
     self.bCancel = DirectButton(self,
                                 image=(buttons.find('**/CloseBtn_UP'),
                                        buttons.find('**/CloseBtn_DN'),
                                        buttons.find('**/CloseBtn_Rllvr')),
                                 relief=None,
                                 text=OTPLocalizer.FriendInviterCancel,
                                 text_scale=0.05,
                                 text_pos=(0.0, -0.1),
                                 pos=TTLocalizer.FIbCancelPos,
                                 command=self.__handleCancel)
     self.bCancel.hide()
     self.bStop = DirectButton(
         self,
         image=(gui.find('**/Ignore_Btn_UP'), gui.find('**/Ignore_Btn_DN'),
                gui.find('**/Ignore_Btn_RLVR')),
         relief=None,
         text=OTPLocalizer.FriendInviterStopBeingFriends,
         text_align=TextNode.ALeft,
         text_scale=TTLocalizer.FIbStop,
         text_pos=TTLocalizer.FIbStopTextPos,
         pos=TTLocalizer.FIbStopPos,
         command=self.__handleStop)
     self.bStop.hide()
     self.bYes = DirectButton(self,
                              image=(buttons.find('**/ChtBx_OKBtn_UP'),
                                     buttons.find('**/ChtBx_OKBtn_DN'),
                                     buttons.find('**/ChtBx_OKBtn_Rllvr')),
                              relief=None,
                              text=OTPLocalizer.FriendInviterYes,
                              text_scale=0.05,
                              text_pos=(0.0, -0.1),
                              pos=TTLocalizer.FIbYesPos,
                              command=self.__handleYes)
     self.bYes.hide()
     self.bNo = DirectButton(self,
                             image=(buttons.find('**/CloseBtn_UP'),
                                    buttons.find('**/CloseBtn_DN'),
                                    buttons.find('**/CloseBtn_Rllvr')),
                             relief=None,
                             text=OTPLocalizer.FriendInviterNo,
                             text_scale=0.05,
                             text_pos=(0.0, -0.1),
                             pos=(0.15, 0.0, -0.1),
                             command=self.__handleNo)
     self.bNo.hide()
     buttons.removeNode()
     gui.removeNode()
     self.fsm.enterInitialState()
     if self.avId == None:
         self.fsm.request('getNewFriend')
     else:
         self.fsm.request('check')
     return