예제 #1
0
 def load(self):
     ShtikerPage.load(self)
     self.golfRecords = GolfingRecordsUI(self.avatar, self)
     self.golfRecords.hide()
     self.golfRecords.load()
     self.golfTrophies = GolfTrophiesUI(self.avatar, self)
     self.golfTrophies.hide()
     self.golfTrophies.load()
     self.title = DirectLabel(parent=self,
                              relief=None,
                              text='',
                              text_scale=0.1,
                              pos=(0, 0, 0.65))
     normalColor = (1, 1, 1, 1)
     clickColor = (0.8, 0.8, 0, 1)
     rolloverColor = (0.15, 0.82, 1.0, 1)
     diabledColor = (1.0, 0.98, 0.15, 1)
     gui = loader.loadModel('phase_3.5/models/gui/fishingBook')
     self.recordsTab = DirectButton(parent=self,
                                    relief=None,
                                    text=TTLocalizer.GolfPageRecordsTab,
                                    text_scale=TTLocalizer.GPrecordsTab,
                                    text_align=TextNode.ALeft,
                                    image=gui.find('**/tabs/polySurface2'),
                                    image_pos=(0.12, 1, -0.91),
                                    image_hpr=(0, 0, -90),
                                    image_scale=(0.033, 0.033, 0.035),
                                    image_color=normalColor,
                                    image1_color=clickColor,
                                    image2_color=rolloverColor,
                                    image3_color=diabledColor,
                                    text_fg=Vec4(0.2, 0.1, 0, 1),
                                    command=self.setMode,
                                    extraArgs=[PageMode.Records],
                                    pos=TTLocalizer.GPrecordsTabPos)
     self.trophyTab = DirectButton(parent=self,
                                   relief=None,
                                   text=TTLocalizer.GolfPageTrophyTab,
                                   text_scale=TTLocalizer.GPtrophyTab,
                                   text_pos=TTLocalizer.GPtrophyTabTextPos,
                                   text_align=TextNode.ALeft,
                                   image=gui.find('**/tabs/polySurface3'),
                                   image_pos=(-0.28, 1, -0.91),
                                   image_hpr=(0, 0, -90),
                                   image_scale=(0.033, 0.033, 0.035),
                                   image_color=normalColor,
                                   image1_color=clickColor,
                                   image2_color=rolloverColor,
                                   image3_color=diabledColor,
                                   text_fg=Vec4(0.2, 0.1, 0, 1),
                                   command=self.setMode,
                                   extraArgs=[PageMode.Trophy],
                                   pos=TTLocalizer.GPtrophyTabPos)
     self.recordsTab.setPos(-0.13, 0, 0.775)
     self.trophyTab.setPos(0.28, 0, 0.775)
     adjust = -0.2
     self.recordsTab.setX(self.recordsTab.getX() + adjust)
     self.trophyTab.setX(self.trophyTab.getX() + adjust)
     gui.removeNode()
     return
예제 #2
0
 def load(self):
     ShtikerPage.load(self)
     self.golfRecords = GolfingRecordsUI(self.avatar, self)
     self.golfRecords.hide()
     self.golfRecords.load()
     self.golfTrophies = GolfTrophiesUI(self.avatar, self)
     self.golfTrophies.hide()
     self.golfTrophies.load()
     self.title = DirectLabel(parent=self, relief=None, text='', text_scale=0.1, pos=(0, 0, 0.65))
     normalColor = (1, 1, 1, 1)
     clickColor = (0.8, 0.8, 0, 1)
     rolloverColor = (0.15, 0.82, 1.0, 1)
     diabledColor = (1.0, 0.98, 0.15, 1)
     gui = loader.loadModel('phase_3.5/models/gui/fishingBook')
     self.recordsTab = DirectButton(parent=self, relief=None, text=TTLocalizer.GolfPageRecordsTab, text_scale=TTLocalizer.GPrecordsTab, text_align=TextNode.ALeft, image=gui.find('**/tabs/polySurface2'), image_pos=(0.12, 1, -0.91), image_hpr=(0, 0, -90), image_scale=(0.033, 0.033, 0.035), image_color=normalColor, image1_color=clickColor, image2_color=rolloverColor, image3_color=diabledColor, text_fg=Vec4(0.2, 0.1, 0, 1), command=self.setMode, extraArgs=[PageMode.Records], pos=TTLocalizer.GPrecordsTabPos)
     self.trophyTab = DirectButton(parent=self, relief=None, text=TTLocalizer.GolfPageTrophyTab, text_scale=TTLocalizer.GPtrophyTab, text_pos=TTLocalizer.GPtrophyTabTextPos, text_align=TextNode.ALeft, image=gui.find('**/tabs/polySurface3'), image_pos=(-0.28, 1, -0.91), image_hpr=(0, 0, -90), image_scale=(0.033, 0.033, 0.035), image_color=normalColor, image1_color=clickColor, image2_color=rolloverColor, image3_color=diabledColor, text_fg=Vec4(0.2, 0.1, 0, 1), command=self.setMode, extraArgs=[PageMode.Trophy], pos=TTLocalizer.GPtrophyTabPos)
     self.recordsTab.setPos(-0.13, 0, 0.775)
     self.trophyTab.setPos(0.28, 0, 0.775)
     adjust = -0.2
     self.recordsTab.setX(self.recordsTab.getX() + adjust)
     self.trophyTab.setX(self.trophyTab.getX() + adjust)
     gui.removeNode()
     return
예제 #3
0
    def load(self):
        """
        Purpose: The load Method is to properly load the appropriate
        GUI for the GolfPage of the Shtiker Book.

        Params: None
        Return: None
        """

        assert self.notify.debugStateCall(self)
        ShtikerPage.load(self)

        # Load the Records Page GUI
        self.golfRecords = GolfingRecordsUI(self.avatar, self)
        self.golfRecords.hide()
        self.golfRecords.load()

        # Load the Trophy Page GUI
        self.golfTrophies = GolfTrophiesUI(self.avatar, self)
        self.golfTrophies.hide()
        self.golfTrophies.load()

        # Page Title
        self.title = DirectLabel(
            parent=self,
            relief=None,
            text="",
            text_scale=0.1,
            pos=(0, 0, 0.65),
        )

        # The blue and yellow colors are trying to match the
        # rollover and select colors on the options page:
        normalColor = (1, 1, 1, 1)
        clickColor = (.8, .8, 0, 1)
        rolloverColor = (0.15, 0.82, 1.0, 1)
        diabledColor = (1.0, 0.98, 0.15, 1)

        # Load the Fish Page to borrow its tabs
        gui = loader.loadModel("phase_3.5/models/gui/fishingBook")

        self.recordsTab = DirectButton(
            parent=self,
            relief=None,
            text=TTLocalizer.GolfPageRecordsTab,
            text_scale=TTLocalizer.GFPRecordsTabTextScale,
            text_align=TextNode.ALeft,
            image=gui.find("**/tabs/polySurface2"),
            image_pos=(0.12, 1, -0.91),
            image_hpr=(0, 0, -90),
            image_scale=(0.033, 0.033, 0.035),
            image_color=normalColor,
            image1_color=clickColor,
            image2_color=rolloverColor,
            image3_color=diabledColor,
            text_fg=Vec4(0.2, 0.1, 0, 1),
            command=self.setMode,
            extraArgs=[PageMode.Records],
            pos=TTLocalizer.GFPRecordsTabPos,
        )
        self.trophyTab = DirectButton(
            parent=self,
            relief=None,
            text=TTLocalizer.GolfPageTrophyTab,
            text_scale=TTLocalizer.GFPTrophyTabTextScale,
            text_pos=TTLocalizer.GFPRecordsTabTextPos,
            text_align=TextNode.ALeft,
            image=gui.find("**/tabs/polySurface3"),
            image_pos=(-0.28, 1, -0.91),
            image_hpr=(0, 0, -90),
            image_scale=(0.033, 0.033, 0.035),
            image_color=normalColor,
            image1_color=clickColor,
            image2_color=rolloverColor,
            image3_color=diabledColor,
            text_fg=Vec4(0.2, 0.1, 0, 1),
            command=self.setMode,
            extraArgs=[PageMode.Trophy],
            pos=TTLocalizer.GFPRTrophyTabPos,
        )

        self.recordsTab.setPos(-0.13, 0, 0.775)
        self.trophyTab.setPos(0.28, 0, 0.775)
        adjust = -0.20
        self.recordsTab.setX(self.recordsTab.getX() + adjust)
        self.trophyTab.setX(self.trophyTab.getX() + adjust)

        gui.removeNode()