def __init__(self, avId, avName, avDisableName):
     DirectFrame.__init__(self, pos=(-1.01, 0.1, -0.35), parent=base.a2dTopRight, image_color=ToontownGlobals.GlobalDialogColor, image_scale=(1.0, 1.0, 0.6), text='', text_wordwrap=13.5, text_scale=0.06, text_pos=(0.0, 0.18))
     messenger.send('releaseDirector')
     self['image'] = DGG.getDefaultDialogGeom()
     self.avId = avId
     self.avName = avName
     self.avDisableName = avDisableName
     self.fsm = ClassicFSM.ClassicFSM('ToonTeleportPanel', [
         State.State('off',
             self.enterOff,
             self.exitOff),
         State.State('begin',
             self.enterBegin,
             self.exitBegin),
         State.State('checkAvailability',
             self.enterCheckAvailability,
             self.exitCheckAvailability),
         State.State('notAvailable',
             self.enterNotAvailable,
             self.exitNotAvailable),
         State.State('ignored',
             self.enterIgnored,
             self.exitIgnored),
         State.State('notOnline',
             self.enterNotOnline,
             self.exitNotOnline),
         State.State('wentAway',
             self.enterWentAway,
             self.exitWentAway),
         State.State('self',
             self.enterSelf,
             self.exitSelf),
         State.State('unknownHood',
             self.enterUnknownHood,
             self.exitUnknownHood),
         State.State('otherShard',
             self.enterOtherShard,
             self.exitOtherShard),
         State.State('teleport',
             self.enterTeleport,
             self.exitTeleport)],
         'off', 'off')
     from toontown.friends import FriendInviter
     FriendInviter.hideFriendInviter()
     ToonAvatarDetailPanel.hideAvatarDetail()
     buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
     self.bOk = DirectButton(self, image=(buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr')), relief=None, text=TTLocalizer.TeleportPanelOK, 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=TTLocalizer.TeleportPanelCancel, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.0, 0.0, -0.1), command=self.__handleCancel)
     self.bCancel.hide()
     self.bYes = DirectButton(self, image=(buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr')), relief=None, text=TTLocalizer.TeleportPanelYes, text_scale=0.05, text_pos=(0.0, -0.1), pos=(-0.15, 0.0, -0.15), 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=TTLocalizer.TeleportPanelNo, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.15, 0.0, -0.15), command=self.__handleNo)
     self.bNo.hide()
     buttons.removeNode()
     self.accept(self.avDisableName, self.__handleDisableAvatar)
     self.show()
     self.fsm.enterInitialState()
     self.fsm.request('begin')
     return
Exemplo n.º 2
0
 def __init__(self, avId, avName, avDisableName):
     DirectFrame.__init__(self, pos=(-1.01, 0.1, -0.35), parent=base.a2dTopRight, image_color=ToontownGlobals.GlobalDialogColor, image_scale=(1.0, 1.0, 0.6), text='', text_wordwrap=13.5, text_scale=0.06, text_pos=(0.0, 0.18))
     messenger.send('releaseDirector')
     self['image'] = DGG.getDefaultDialogGeom()
     self.avId = avId
     self.avName = avName
     self.avDisableName = avDisableName
     self.fsm = ClassicFSM.ClassicFSM('ToonTeleportPanel', [
         State.State('off',
             self.enterOff,
             self.exitOff),
         State.State('begin',
             self.enterBegin,
             self.exitBegin),
         State.State('checkAvailability',
             self.enterCheckAvailability,
             self.exitCheckAvailability),
         State.State('notAvailable',
             self.enterNotAvailable,
             self.exitNotAvailable),
         State.State('ignored',
             self.enterIgnored,
             self.exitIgnored),
         State.State('notOnline',
             self.enterNotOnline,
             self.exitNotOnline),
         State.State('wentAway',
             self.enterWentAway,
             self.exitWentAway),
         State.State('self',
             self.enterSelf,
             self.exitSelf),
         State.State('unknownHood',
             self.enterUnknownHood,
             self.exitUnknownHood),
         State.State('otherShard',
             self.enterOtherShard,
             self.exitOtherShard),
         State.State('teleport',
             self.enterTeleport,
             self.exitTeleport)],
         'off', 'off')
     from src.toontown.friends import FriendInviter
     FriendInviter.hideFriendInviter()
     ToonAvatarDetailPanel.hideAvatarDetail()
     buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
     self.bOk = DirectButton(self, image=(buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr')), relief=None, text=TTLocalizer.TeleportPanelOK, 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=TTLocalizer.TeleportPanelCancel, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.0, 0.0, -0.1), command=self.__handleCancel)
     self.bCancel.hide()
     self.bYes = DirectButton(self, image=(buttons.find('**/ChtBx_OKBtn_UP'), buttons.find('**/ChtBx_OKBtn_DN'), buttons.find('**/ChtBx_OKBtn_Rllvr')), relief=None, text=TTLocalizer.TeleportPanelYes, text_scale=0.05, text_pos=(0.0, -0.1), pos=(-0.15, 0.0, -0.15), 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=TTLocalizer.TeleportPanelNo, text_scale=0.05, text_pos=(0.0, -0.1), pos=(0.15, 0.0, -0.15), command=self.__handleNo)
     self.bNo.hide()
     buttons.removeNode()
     self.accept(self.avDisableName, self.__handleDisableAvatar)
     self.show()
     self.fsm.enterInitialState()
     self.fsm.request('begin')
     return
Exemplo n.º 3
0
    def __init__(self, avId, avName, avDisableName):

        # initialize our base class.
        DirectFrame.__init__(
            self,
            pos=(0.3, 0.1, 0.65),
            image_color=ToontownGlobals.GlobalDialogColor,
            image_scale=(1.0, 1.0, 0.6),
            text='',
            text_wordwrap=13.5,
            text_scale=0.06,
            text_pos=(0.0, 0.18),
        )

        # If we're currently in move-furniture mode, stop it.
        messenger.send("releaseDirector")

        # For some reason, we need to set this after construction to
        # get it to work properly.
        self['image'] = DGG.getDefaultDialogGeom()

        self.avId = avId
        self.avName = avName
        self.avDisableName = avDisableName

        self.fsm = ClassicFSM.ClassicFSM(
            'ToonTeleportPanel',
            [
                State.State('off', self.enterOff, self.exitOff),
                State.State('begin', self.enterBegin, self.exitBegin),
                State.State('checkAvailability', self.enterCheckAvailability,
                            self.exitCheckAvailability),
                State.State('notAvailable', self.enterNotAvailable,
                            self.exitNotAvailable),
                State.State('ignored', self.enterIgnored, self.exitIgnored),
                State.State('notOnline', self.enterNotOnline,
                            self.exitNotOnline),
                State.State('wentAway', self.enterWentAway, self.exitWentAway),
                State.State('self', self.enterSelf, self.exitSelf),
                State.State('unknownHood', self.enterUnknownHood,
                            self.exitUnknownHood),
                State.State('unavailableHood', self.enterUnavailableHood,
                            self.exitUnavailableHood),
                State.State('otherShard', self.enterOtherShard,
                            self.exitOtherShard),
                State.State('teleport', self.enterTeleport, self.exitTeleport),
            ],
            # Initial State
            'off',
            # Final State
            'off',
        )

        # This is imported here instead of at the top of the file to
        # protect against circular imports.
        from toontown.friends import FriendInviter

        # Now set up the panel.
        FriendInviter.hideFriendInviter()
        ToonAvatarDetailPanel.hideAvatarDetail()

        # Create some buttons.
        buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')

        self.bOk = DirectButton(self,
                                image=(buttons.find('**/ChtBx_OKBtn_UP'),
                                       buttons.find('**/ChtBx_OKBtn_DN'),
                                       buttons.find('**/ChtBx_OKBtn_Rllvr')),
                                relief=None,
                                text=TTLocalizer.TeleportPanelOK,
                                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=TTLocalizer.TeleportPanelCancel,
                                    text_scale=0.05,
                                    text_pos=(0.0, -0.1),
                                    pos=(0.0, 0.0, -0.1),
                                    command=self.__handleCancel)
        self.bCancel.hide()

        self.bYes = DirectButton(self,
                                 image=(buttons.find('**/ChtBx_OKBtn_UP'),
                                        buttons.find('**/ChtBx_OKBtn_DN'),
                                        buttons.find('**/ChtBx_OKBtn_Rllvr')),
                                 relief=None,
                                 text=TTLocalizer.TeleportPanelYes,
                                 text_scale=0.05,
                                 text_pos=(0.0, -0.1),
                                 pos=(-0.15, 0.0, -0.15),
                                 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=TTLocalizer.TeleportPanelNo,
                                text_scale=0.05,
                                text_pos=(0.0, -0.1),
                                pos=(0.15, 0.0, -0.15),
                                command=self.__handleNo)
        self.bNo.hide()

        buttons.removeNode()

        self.accept(self.avDisableName, self.__handleDisableAvatar)

        self.show()
        self.fsm.enterInitialState()
        self.fsm.request('begin')