Beispiel #1
0
 def __init__(self, avId, avName, parent=base.a2dTopRight, **kw):
     buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
     gui = loader.loadModel('phase_3.5/models/gui/avatar_panel_gui')
     detailPanel = gui.find('**/avatarInfoPanel')
     textScale = 0.095
     textWrap = 16.4
     optiondefs = (('pos', (-0.79, 0.0, -0.47), None), ('scale', 0.5, None),
                   ('relief', None, None), ('image', detailPanel, None),
                   ('image_color', GlobalDialogColor, None),
                   ('text', '', None), ('text_wordwrap', textWrap, None),
                   ('text_scale', textScale, None), ('text_pos',
                                                     (-0.125, 0.775), None))
     self.defineoptions(kw, optiondefs)
     DirectFrame.__init__(self, parent)
     self.dataText = DirectLabel(self,
                                 text='',
                                 text_scale=0.09,
                                 text_align=TextNode.ALeft,
                                 text_wordwrap=15,
                                 relief=None,
                                 pos=(-0.85, 0.0, 0.645))
     self.avId = avId
     self.avName = avName
     self.avatar = None
     self.createdAvatar = None
     self.fsm = ClassicFSM.ClassicFSM('ToonAvatarDetailPanel', [
         State.State('off', self.enterOff, self.exitOff, ['begin']),
         State.State('begin', self.enterBegin, self.exitBegin,
                     ['query', 'data', 'off']),
         State.State('query', self.enterQuery, self.exitQuery,
                     ['data', 'invalid', 'off']),
         State.State('data', self.enterData, self.exitData, ['off']),
         State.State('invalid', self.enterInvalid, self.exitInvalid,
                     ['off'])
     ], 'off', 'off')
     ToonTeleportPanel.hideTeleportPanel()
     FriendInviter.hideFriendInviter()
     self.bCancel = DirectButton(self,
                                 image=(buttons.find('**/CloseBtn_UP'),
                                        buttons.find('**/CloseBtn_DN'),
                                        buttons.find('**/CloseBtn_Rllvr')),
                                 image_scale=1.1,
                                 relief=None,
                                 text=TTLocalizer.AvatarDetailPanelCancel,
                                 text_scale=TTLocalizer.TADPbCancel,
                                 text_pos=(0.12, -0.01),
                                 pos=TTLocalizer.TADPbCancelPos,
                                 scale=2.0,
                                 command=self.__handleCancel)
     self.bCancel.hide()
     self.initialiseoptions(ToonAvatarDetailPanel)
     self.fsm.enterInitialState()
     self.fsm.request('begin')
     buttons.removeNode()
     gui.removeNode()
Beispiel #2
0
 def __init__(self, avId, avName, playerId = None, parent = aspect2dp, **kw):
     self.playerId = playerId
     self.isPlayer = 0
     self.playerInfo = None
     if playerId:
         self.isPlayer = 1
         if playerId in base.cr.playerFriendsManager.playerId2Info:
             self.playerInfo = base.cr.playerFriendsManager.playerId2Info[playerId]
             if not self.playerInfo.onlineYesNo:
                 avId = None
         else:
             avId = None
     self.avId = avId
     self.avName = avName
     self.avatar = None
     self.createdAvatar = None
     buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
     gui = loader.loadModel('phase_3.5/models/gui/avatar_panel_gui')
     detailPanel = gui.find('**/avatarInfoPanel')
     textScale = 0.132
     textWrap = 10.4
     if self.playerId:
         textScale = 0.1
         textWrap = 18.0
     optiondefs = (('pos', (0.525, 0.0, 0.525), None),
      ('scale', 0.5, None),
      ('relief', None, None),
      ('image', detailPanel, None),
      ('image_color', GlobalDialogColor, None),
      ('text', '', None),
      ('text_wordwrap', textWrap, None),
      ('text_scale', textScale, None),
      ('text_pos', (-0.125, 0.75), None))
     self.defineoptions(kw, optiondefs)
     DirectFrame.__init__(self, parent)
     self.dataText = DirectLabel(self, text='', text_scale=0.085, text_align=TextNode.ALeft, text_wordwrap=15, relief=None, pos=(-0.85, 0.0, 0.725))
     if self.avId:
         self.avText = DirectLabel(self, text=TTLocalizer.PlayerToonName % {'toonname': self.avName}, text_scale=0.09, text_align=TextNode.ALeft, text_wordwrap=15, relief=None, pos=(-0.85, 0.0, 0.56))
         guiButton = loader.loadModel('phase_3/models/gui/quit_button')
         self.gotoToonButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=1.15, text=TTLocalizer.PlayerShowToon, text_scale=0.08, text_pos=(0.0, -0.02), textMayChange=0, pos=(0.43, 0, 0.415), command=self.__showToon)
     ToonTeleportPanel.hideTeleportPanel()
     FriendInviter.hideFriendInviter()
     self.bCancel = DirectButton(self, image=(buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr')), relief=None, text=TTLocalizer.AvatarDetailPanelCancel, text_scale=0.05, text_pos=(0.12, -0.01), pos=(-0.865, 0.0, -0.765), scale=2.0, command=self.__handleCancel)
     self.bCancel.show()
     self.initialiseoptions(PlayerDetailPanel)
     self.__showData()
     buttons.removeNode()
     gui.removeNode()
     return
 def __init__(self, avId, avName, playerId = None, parent = aspect2dp, **kw):
     self.playerId = playerId
     self.isPlayer = 0
     self.playerInfo = None
     if playerId:
         self.isPlayer = 1
         if base.cr.playerFriendsManager.playerId2Info.has_key(playerId):
             self.playerInfo = base.cr.playerFriendsManager.playerId2Info[playerId]
             if not self.playerInfo.onlineYesNo:
                 avId = None
         else:
             avId = None
     self.avId = avId
     self.avName = avName
     self.avatar = None
     self.createdAvatar = None
     buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
     gui = loader.loadModel('phase_3.5/models/gui/avatar_panel_gui')
     detailPanel = gui.find('**/avatarInfoPanel')
     textScale = 0.132
     textWrap = 10.4
     if self.playerId:
         textScale = 0.1
         textWrap = 18.0
     optiondefs = (('pos', (0.525, 0.0, 0.525), None),
      ('scale', 0.5, None),
      ('relief', None, None),
      ('image', detailPanel, None),
      ('image_color', GlobalDialogColor, None),
      ('text', '', None),
      ('text_wordwrap', textWrap, None),
      ('text_scale', textScale, None),
      ('text_pos', (-0.125, 0.75), None))
     self.defineoptions(kw, optiondefs)
     DirectFrame.__init__(self, parent)
     self.dataText = DirectLabel(self, text='', text_scale=0.085, text_align=TextNode.ALeft, text_wordwrap=15, relief=None, pos=(-0.85, 0.0, 0.725))
     if self.avId:
         self.avText = DirectLabel(self, text=TTLocalizer.PlayerToonName % {'toonname': self.avName}, text_scale=0.09, text_align=TextNode.ALeft, text_wordwrap=15, relief=None, pos=(-0.85, 0.0, 0.56))
         guiButton = loader.loadModel('phase_3/models/gui/quit_button')
         self.gotoToonButton = DirectButton(parent=self, relief=None, image=(guiButton.find('**/QuitBtn_UP'), guiButton.find('**/QuitBtn_DN'), guiButton.find('**/QuitBtn_RLVR')), image_scale=1.15, text=TTLocalizer.PlayerShowToon, text_scale=0.08, text_pos=(0.0, -0.02), textMayChange=0, pos=(0.43, 0, 0.415), command=self.__showToon)
     ToonTeleportPanel.hideTeleportPanel()
     FriendInviter.hideFriendInviter()
     self.bCancel = DirectButton(self, image=(buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr')), relief=None, text=TTLocalizer.AvatarDetailPanelCancel, text_scale=0.05, text_pos=(0.12, -0.01), pos=(-0.865, 0.0, -0.765), scale=2.0, command=self.__handleCancel)
     self.bCancel.show()
     self.initialiseoptions(PlayerDetailPanel)
     self.__showData()
     buttons.removeNode()
     gui.removeNode()
     return
 def __init__(self, avId, avName, parent = base.a2dTopRight, **kw):
     buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
     gui = loader.loadModel('phase_3.5/models/gui/avatar_panel_gui')
     sosGui = loader.loadModel('phase_3.5/models/gui/playingCard')
     detailPanel = gui.find('**/avatarInfoPanel')
     textScale = 0.095
     textWrap = 16.4
     optiondefs = (('pos', (-0.79, 0.0, -0.47), None),
      ('scale', 0.5, None),
      ('relief', None, None),
      ('image', detailPanel, None),
      ('image_color', GlobalDialogColor, None),
      ('text', '', None),
      ('text_wordwrap', textWrap, None),
      ('text_scale', textScale, None),
      ('text_pos', (-0.125, 0.775), None))
     self.defineoptions(kw, optiondefs)
     DirectFrame.__init__(self, parent)
     self.dataText = DirectLabel(self, text='', text_scale=0.09, text_align=TextNode.ALeft, text_wordwrap=15, relief=None, pos=(-0.85, 0.0, 0.645))
     self.avId = avId
     self.avName = avName
     self.avatar = None
     self.createdAvatar = None
     self.fsm = ClassicFSM.ClassicFSM('ToonAvatarDetailPanel', [State.State('off', self.enterOff, self.exitOff, ['begin']),
      State.State('begin', self.enterBegin, self.exitBegin, ['query', 'data', 'off']),
      State.State('query', self.enterQuery, self.exitQuery, ['data', 'invalid', 'off']),
      State.State('data', self.enterData, self.exitData, ['off']),
      State.State('invalid', self.enterInvalid, self.exitInvalid, ['off'])], 'off', 'off')
     ToonTeleportPanel.hideTeleportPanel()
     FriendInviter.hideFriendInviter()
     self.bCancel = DirectButton(self, image=(buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr')), image_scale=1.1, relief=None, text=TTLocalizer.AvatarDetailPanelCancel, text_scale=TTLocalizer.TADPbCancel, text_pos=(0.12, -0.01), pos=TTLocalizer.TADPbCancelPos, scale=2.0, command=self.__handleCancel)
     self.bCancel.hide()
     self.sosButton = DirectButton(self, relief=None, image=sosGui.find('**/card_back'), scale=0.05, pos=(0.3, 0, -0.76), text=('', TTLocalizer.DetailPanelSOS, TTLocalizer.DetailPanelSOS, ''), text_fg=(1, 1, 0.5, 1), text_shadow=(0, 0, 0, 1), text_scale=2, text_pos=(0, -3.4), text_align=TextNode.ACenter, state=DGG.NORMAL, command=self.__toggleSOSGui)
     self.sosButton.hide()
     self.sosFrame = DirectFrame(self, relief=None, image=DGG.getDefaultDialogGeom(), image_scale=(2.6, 1, 1.87), image_color=ToontownGlobals.GlobalDialogColor, pos=(0.2, 0, 0.8))
     self.sosFrame.setBin('background', 10)
     self.sosFrame.setScale(0.5)
     self.sosPage = NPCFriendPanel.NPCFriendPanel(parent=self.sosFrame, callable=False)
     self.sosPage.setScale(0.18)
     self.sosPage.setPos(0, 0, 0.05)
     self.initialiseoptions(ToonAvatarDetailPanel)
     self.fsm.enterInitialState()
     self.fsm.request('begin')
     buttons.removeNode()
     gui.removeNode()
     sosGui.removeNode()
 def __init__(self, avId, avName, playerId = None, parent = aspect2dp, **kw):
     print 'ToonAvatarDetailPanel %s' % playerId
     buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
     gui = loader.loadModel('phase_3.5/models/gui/avatar_panel_gui')
     detailPanel = gui.find('**/avatarInfoPanel')
     self.playerId = playerId
     textScale = 0.095000000000000001
     textWrap = 16.399999999999999
     self.playerInfo = None
     if self.playerId:
         self.playerInfo = base.cr.playerFriendsManager.playerId2Info.get(playerId)
     
     optiondefs = (('pos', (0.52500000000000002, 0.0, 0.52500000000000002), None), ('scale', 0.5, None), ('relief', None, None), ('image', detailPanel, None), ('image_color', GlobalDialogColor, None), ('text', '', None), ('text_wordwrap', textWrap, None), ('text_scale', textScale, None), ('text_pos', (-0.125, 0.77500000000000002), None))
     self.defineoptions(kw, optiondefs)
     DirectFrame.__init__(self, parent)
     self.dataText = DirectLabel(self, text = '', text_scale = 0.089999999999999997, text_align = TextNode.ALeft, text_wordwrap = 15, relief = None, pos = (-0.84999999999999998, 0.0, 0.64500000000000002))
     self.avId = avId
     self.avName = avName
     self.avatar = None
     self.createdAvatar = None
     self.fsm = ClassicFSM.ClassicFSM('ToonAvatarDetailPanel', [
         State.State('off', self.enterOff, self.exitOff, [
             'begin']),
         State.State('begin', self.enterBegin, self.exitBegin, [
             'query',
             'data',
             'off']),
         State.State('query', self.enterQuery, self.exitQuery, [
             'data',
             'invalid',
             'off']),
         State.State('data', self.enterData, self.exitData, [
             'off']),
         State.State('invalid', self.enterInvalid, self.exitInvalid, [
             'off'])], 'off', 'off')
     ToonTeleportPanel.hideTeleportPanel()
     FriendInviter.hideFriendInviter()
     self.bCancel = DirectButton(self, image = (buttons.find('**/CloseBtn_UP'), buttons.find('**/CloseBtn_DN'), buttons.find('**/CloseBtn_Rllvr')), image_scale = 1.1000000000000001, relief = None, text = TTLocalizer.AvatarDetailPanelCancel, text_scale = TTLocalizer.TADPbCancel, text_pos = (0.12, -0.01), pos = TTLocalizer.TADPbCancelPos, scale = 2.0, command = self._ToonAvatarDetailPanel__handleCancel)
     self.bCancel.hide()
     self.initialiseoptions(ToonAvatarDetailPanel)
     self.fsm.enterInitialState()
     self.fsm.request('begin')
     buttons.removeNode()
     gui.removeNode()
    def __init__(self, avId, avName, playerId=None, parent=aspect2dp, **kw):
        # Inherits from DirectFrame
        # Must specify avId and avName on creation
        print("ToonAvatarDetailPanel %s" % (playerId))

        # Load required models
        buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
        gui = loader.loadModel('phase_3.5/models/gui/avatar_panel_gui')
        detailPanel = gui.find('**/avatarInfoPanel')
        self.playerId = playerId
        textScale = 0.095
        textWrap = 16.4
        self.playerInfo = None
        if self.playerId:
            #textScale = 0.100
            #textWrap = 18.0
            #self.isPlayer = 1
            self.playerInfo = base.cr.playerFriendsManager.playerId2Info.get(
                playerId)
        # Specify default options
        optiondefs = (
            ('pos', (0.525, 0.0, 0.525), None),
            ('scale', 0.5, None),
            ('relief', None, None),
            ('image', detailPanel, None),
            ('image_color', GlobalDialogColor, None),
            ('text', '', None),
            ('text_wordwrap', textWrap, None),
            ('text_scale', textScale, None),
            ('text_pos', (-0.125, 0.775), None),
        )
        # Merge keyword options with default options
        self.defineoptions(kw, optiondefs)

        # initialize our base class.
        DirectFrame.__init__(self, parent)

        # Information about avatar
        self.dataText = DirectLabel(
            self,
            text='',
            text_scale=0.09,
            text_align=TextNode.ALeft,
            text_wordwrap=15,
            relief=None,
            pos=(-0.85, 0.0, 0.645),
        )

        self.avId = avId
        self.avName = avName
        self.avatar = None
        self.createdAvatar = None

        self.fsm = ClassicFSM.ClassicFSM(
            'ToonAvatarDetailPanel',
            [
                State.State('off', self.enterOff, self.exitOff, ['begin']),
                State.State('begin', self.enterBegin, self.exitBegin,
                            ['query', 'data', 'off']),
                State.State('query', self.enterQuery, self.exitQuery,
                            ['data', 'invalid', 'off']),
                State.State('data', self.enterData, self.exitData, ['off']),
                State.State('invalid', self.enterInvalid, self.exitInvalid,
                            ['off'])
            ],
            # Initial State
            'off',
            # Final State
            'off',
        )

        ToonTeleportPanel.hideTeleportPanel()
        FriendInviter.hideFriendInviter()

        # Create some buttons.
        self.bCancel = DirectButton(self,
                                    image=(buttons.find('**/CloseBtn_UP'),
                                           buttons.find('**/CloseBtn_DN'),
                                           buttons.find('**/CloseBtn_Rllvr')),
                                    image_scale=1.1,
                                    relief=None,
                                    text=TTLocalizer.AvatarDetailPanelCancel,
                                    text_scale=TTLocalizer.TADPcancelButton,
                                    text_pos=(0.12, -0.01),
                                    pos=TTLocalizer.TADPcancelPos,
                                    scale=2.0,
                                    command=self.__handleCancel)
        self.bCancel.hide()

        # Call option initialization functions
        self.initialiseoptions(ToonAvatarDetailPanel)

        # Initialize ClassicFSM
        self.fsm.enterInitialState()
        self.fsm.request('begin')

        # Clean up
        buttons.removeNode()
        gui.removeNode()
Beispiel #7
0
    def __init__(self, avId, avName, playerId=None, parent=aspect2dp, **kw):
        # Inherits from DirectFrame
        # Must specify avId and avName on creation

        self.playerId = playerId
        self.isPlayer = 0
        self.playerInfo = None
        if playerId:
            self.isPlayer = 1
            if base.cr.playerFriendsManager.playerId2Info.has_key(playerId):
                self.playerInfo = base.cr.playerFriendsManager.playerId2Info[
                    playerId]
                if not self.playerInfo.onlineYesNo:
                    avId = None
            else:
                avId = None

        self.avId = avId
        self.avName = avName
        self.avatar = None
        self.createdAvatar = None

        # Load required models
        buttons = loader.loadModel('phase_3/models/gui/dialog_box_buttons_gui')
        gui = loader.loadModel('phase_3.5/models/gui/avatar_panel_gui')
        detailPanel = gui.find('**/avatarInfoPanel')

        textScale = 0.132
        textWrap = 10.4

        if self.playerId:
            textScale = 0.100
            textWrap = 18.0

        # Specify default options
        optiondefs = (
            ('pos', (0.525, 0.0, 0.525), None),
            ('scale', 0.5, None),
            ('relief', None, None),
            ('image', detailPanel, None),
            ('image_color', GlobalDialogColor, None),
            ('text', '', None),
            ('text_wordwrap', textWrap, None),
            ('text_scale', textScale, None),
            #('text_pos',      (0.0, 0.75),        None),
            ('text_pos', (-0.125, 0.75), None),
        )
        # Merge keyword options with default options
        self.defineoptions(kw, optiondefs)

        # initialize our base class.
        DirectFrame.__init__(self, parent)

        # Information about avatar
        self.dataText = DirectLabel(
            self,
            text='',
            text_scale=0.085,
            text_align=TextNode.ALeft,
            text_wordwrap=15,
            relief=None,
            pos=(-0.85, 0.0, 0.725),
        )

        if self.avId:
            self.avText = DirectLabel(
                self,
                text=(TTLocalizer.PlayerToonName % {
                    "toonname": self.avName
                }),
                text_scale=0.09,
                text_align=TextNode.ALeft,
                text_wordwrap=15,
                relief=None,
                pos=(-0.85, 0.0, 0.56),
            )
            guiButton = loader.loadModel("phase_3/models/gui/quit_button")

            self.gotoToonButton = DirectButton(
                parent=self,
                relief=None,
                image=(
                    guiButton.find("**/QuitBtn_UP"),
                    guiButton.find("**/QuitBtn_DN"),
                    guiButton.find("**/QuitBtn_RLVR"),
                ),
                image_scale=1.15,
                text=TTLocalizer.PlayerShowToon,
                text_scale=0.08,
                text_pos=(0.0, -0.02),
                textMayChange=0,
                pos=(0.43, 0, 0.415),
                command=self.__showToon,
            )

        ToonTeleportPanel.hideTeleportPanel()
        FriendInviter.hideFriendInviter()

        # Create some buttons.
        self.bCancel = DirectButton(self,
                                    image=(buttons.find('**/CloseBtn_UP'),
                                           buttons.find('**/CloseBtn_DN'),
                                           buttons.find('**/CloseBtn_Rllvr')),
                                    relief=None,
                                    text=TTLocalizer.AvatarDetailPanelCancel,
                                    text_scale=0.05,
                                    text_pos=(0.12, -0.01),
                                    pos=(-0.865, 0.0, -0.765),
                                    scale=2.0,
                                    command=self.__handleCancel)
        self.bCancel.show()

        # Call option initialization functions
        self.initialiseoptions(PlayerDetailPanel)

        self.__showData()

        # Clean up
        buttons.removeNode()
        gui.removeNode()