def load(self):
     gui = loader.loadModel('phase_3.5/models/gui/PetControlPannel')
     guiScale = 0.11600000000000001
     guiPos = (0, 0, 0)
     self.frame = DirectFrame(image = gui, scale = guiScale, pos = guiPos, relief = None)
     self.frame.hide()
     disabledImageColor = Vec4(0.59999999999999998, 0.59999999999999998, 0.59999999999999998, 1)
     text0Color = Vec4(1, 1, 1, 1)
     text1Color = Vec4(0.5, 1, 0.5, 1)
     text2Color = Vec4(1, 1, 0.5, 1)
     text3Color = Vec4(0.59999999999999998, 0.59999999999999998, 0.59999999999999998, 1)
     self.closeButton = DirectButton(parent = self.frame, image = (gui.find('**/CancelButtonUp'), gui.find('**/CancelButtonDown'), gui.find('**/CancelButtonRollover')), relief = None, command = self._TownBattleSOSPetInfoPanel__handleClose)
     self.feedButton = DirectButton(parent = self.frame, image = (gui.find('**/ButtonFeedUp'), gui.find('**/ButtonFeedDown'), gui.find('**/ButtonFeedRollover'), gui.find('**/ButtonFeedUp')), geom = gui.find('**/PetControlFeedIcon'), image3_color = disabledImageColor, relief = None, text = TTLocalizer.PetPanelFeed, text_scale = 0.5, text0_fg = text0Color, text1_fg = text1Color, text2_fg = text2Color, text3_fg = text3Color, text_pos = (-0.5, 2.7999999999999998), text_align = TextNode.ALeft)
     self.feedButton['state'] = DGG.DISABLED
     self.callButton = DirectButton(parent = self.frame, image = (gui.find('**/ButtonGoToUp'), gui.find('**/ButtonGoToDown'), gui.find('**/ButtonGoToRollover'), gui.find('**/ButtonGoToUp')), geom = gui.find('**/PetControlGoToIcon'), image3_color = disabledImageColor, relief = None, text = TTLocalizer.PetPanelCall, text0_fg = text0Color, text1_fg = text1Color, text2_fg = text2Color, text3_fg = text3Color, text_scale = 0.5, text_pos = (-0.5, 1.3), text_align = TextNode.ALeft)
     self.callButton['state'] = DGG.DISABLED
     self.scratchButton = DirectButton(parent = self.frame, image = (gui.find('**/ButtonScratchUp'), gui.find('**/ButtonScratchDown'), gui.find('**/ButtonScratchRollover'), gui.find('**/ButtonScratchUp')), geom = gui.find('**/PetControlScratchIcon'), image3_color = disabledImageColor, relief = None, text = TTLocalizer.PetPanelScratch, text0_fg = text0Color, text1_fg = text1Color, text2_fg = text2Color, text3_fg = text3Color, text_scale = 0.5, text_pos = (-0.5, 2.0499999999999998), text_align = TextNode.ALeft)
     self.scratchButton['state'] = DGG.DISABLED
     self.callOwnerButton = DirectButton(parent = self.frame, image = (gui.find('**/PetControlToonButtonUp'), gui.find('**/PetControlToonButtonDown'), gui.find('**/PetControlToonButtonRollover')), geom = gui.find('**/PetControlToonIcon'), geom3_color = disabledImageColor, relief = None, image3_color = disabledImageColor, text = ('', TTLocalizer.PetPanelOwner, TTLocalizer.PetPanelOwner, ''), text_fg = text2Color, text_shadow = (0, 0, 0, 1), text_scale = 0.34999999999999998, text_pos = (0.29999999999999999, 1.1000000000000001), text_align = TextNode.ACenter, command = self._TownBattleSOSPetInfoPanel__handleDetail)
     self.callOwnerButton['state'] = DGG.DISABLED
     self.detailButton = DirectButton(parent = self.frame, image = (gui.find('**/PetControlToonButtonUp1'), gui.find('**/PetControlToonButtonDown1'), gui.find('**/PetControlToonButtonRollover1')), geom = gui.find('**/PetBattleIcon'), geom3_color = disabledImageColor, relief = None, pos = (0, 0, 0), image3_color = disabledImageColor, text = ('', TTLocalizer.PetPanelDetail, TTLocalizer.PetPanelDetail, ''), text_fg = text2Color, text_shadow = (0, 0, 0, 1), text_scale = 0.34999999999999998, text_pos = (0.29999999999999999, 1.1000000000000001), text_align = TextNode.ACenter, command = self._TownBattleSOSPetInfoPanel__handleDetail)
     self.detailButton['state'] = DGG.NORMAL
     gui.removeNode()
     self.nameLabel = None
     self.trickMenu = TTSCPetTrickMenu.TTSCPetTrickMenu()
     self.settings = SCSettings.SCSettings(eventPrefix = '')
     self.trickMenu.privSetSettingsRef(self.settings)
     self.trickMenuEventName = self.trickMenu.getEventName(SpeedChatGlobals.SCStaticTextMsgEvent)
     self.trickMenu.setScale(0.055)
     self.trickMenu.setBin('gui-popup', 0)
     self.trickMenu.finalizeAll()
     localAvatar.chatMgr.chatInputSpeedChat.whisperAvatarId = None
     self.petDetailPanel = None
예제 #2
0
    def load(self):
        gui = loader.loadModel("phase_3.5/models/gui/PetControlPannel")
        guiScale = 0.116
        #guiPos = (1.12, 0, 0.30)
        guiPos = (0, 0, 0)
        self.frame = DirectFrame(
                image = gui,
                scale = guiScale,
                pos = guiPos,
                relief = None,
                )
        self.frame.hide()

        disabledImageColor = Vec4(.6,.6,.6,1)
        text0Color = Vec4(1,1,1,1)
        text1Color = Vec4(0.5,1,0.5,1)
        text2Color = Vec4(1,1,0.5,1)
        text3Color = Vec4(.6,.6,.6,1)

        self.closeButton = DirectButton(
                parent = self.frame,
                image = (gui.find("**/CancelButtonUp"),
                         gui.find("**/CancelButtonDown"),
                         gui.find("**/CancelButtonRollover"),
                         ),
                relief = None,
                command = self.__handleClose,
                )
        self.feedButton = DirectButton(
                parent = self.frame,
                image = (gui.find("**/ButtonFeedUp"),
                         gui.find("**/ButtonFeedDown"),
                         gui.find("**/ButtonFeedRollover"),
                         gui.find("**/ButtonFeedUp"),
                         ),
                geom = gui.find("**/PetControlFeedIcon"),
                image3_color = disabledImageColor,
                relief = None,
                text = TTLocalizer.PetPanelFeed,
                text_scale = 0.5,
                text0_fg = text0Color,
                text1_fg = text1Color,
                text2_fg = text2Color,
                text3_fg = text3Color,
                text_pos = (-0.5,2.8),
                text_align = TextNode.ALeft,
                #command = self.__handleFeed,
                )
        self.feedButton['state'] = DGG.DISABLED

        self.callButton = DirectButton(
                parent = self.frame,
                image = (gui.find("**/ButtonGoToUp"),
                         gui.find("**/ButtonGoToDown"),
                         gui.find("**/ButtonGoToRollover"),
                         gui.find("**/ButtonGoToUp"),
                         ),
                geom = gui.find("**/PetControlGoToIcon"),
                image3_color = disabledImageColor,
                relief = None,
                text = TTLocalizer.PetPanelCall,
                text0_fg = text0Color,
                text1_fg = text1Color,
                text2_fg = text2Color,
                text3_fg = text3Color,
                text_scale = 0.5,
                text_pos = (-0.5,1.3),
                text_align = TextNode.ALeft,
                #command = self.__handleCall,
                )
        self.callButton['state'] = DGG.DISABLED

        self.scratchButton = DirectButton(
                parent = self.frame,
                image = (gui.find("**/ButtonScratchUp"),
                         gui.find("**/ButtonScratchDown"),
                         gui.find("**/ButtonScratchRollover"),
                         gui.find("**/ButtonScratchUp"),
                         ),
                geom = gui.find("**/PetControlScratchIcon"),
                image3_color = disabledImageColor,
                relief = None,
                text = TTLocalizer.PetPanelScratch,
                text0_fg = text0Color,
                text1_fg = text1Color,
                text2_fg = text2Color,
                text3_fg = text3Color,
                text_scale = 0.5,
                text_pos = (-0.5,2.05),
                text_align = TextNode.ALeft,
                #command = self.__handleScratch,
                )
        self.scratchButton['state'] = DGG.DISABLED

        self.callOwnerButton = DirectButton(
                parent = self.frame,
                image = (gui.find("**/PetControlToonButtonUp"),
                         gui.find("**/PetControlToonButtonDown"),
                         gui.find("**/PetControlToonButtonRollover"),
                         ),
                geom = gui.find("**/PetControlToonIcon"),
                geom3_color = disabledImageColor,
                relief = None,
                image3_color = disabledImageColor,
                text = ("", TTLocalizer.PetPanelOwner,
                        TTLocalizer.PetPanelOwner, ""),
                text_fg = text2Color,
                text_shadow = (0, 0, 0, 1),
                text_scale = 0.35,
                text_pos = (0.3,1.1),
                text_align = TextNode.ACenter,
                command = self.__handleDetail,
                )
        self.callOwnerButton['state'] = DGG.DISABLED

        self.detailButton = DirectButton(
                parent = self.frame,
                image = (gui.find("**/PetControlToonButtonUp1"),
                         gui.find("**/PetControlToonButtonDown1"),
                         gui.find("**/PetControlToonButtonRollover1"),
                         ),
                geom = gui.find("**/PetBattleIcon"),
                geom3_color = disabledImageColor,
                relief = None,
                pos = (0, 0, 0),
                image3_color = disabledImageColor,
                text = ("", TTLocalizer.PetPanelDetail,
                        TTLocalizer.PetPanelDetail, ""),
                text_fg = text2Color,
                text_shadow = (0, 0, 0, 1),
                text_scale = 0.35,
                text_pos = (0.3,1.1),
                text_align = TextNode.ACenter,
                command = self.__handleDetail,
                )
        self.detailButton['state'] = DGG.NORMAL

        gui.removeNode()

        self.nameLabel = None

        self.trickMenu = TTSCPetTrickMenu.TTSCPetTrickMenu()
        self.settings = SCSettings.SCSettings(eventPrefix = '')
        self.trickMenu.privSetSettingsRef(self.settings)
        self.trickMenuEventName = self.trickMenu.getEventName(SpeedChatGlobals.SCStaticTextMsgEvent)
        self.trickMenu.setScale(.055)
        self.trickMenu.setBin('gui-popup',0)
        self.trickMenu.finalizeAll()

        # Make sure the pet battle phrases don't get whispered to friends
        localAvatar.chatMgr.chatInputSpeedChat.whisperAvatarId = None

        self.petDetailPanel = None