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
def unload(self): """ Purpose: The unload Method performs the necessary unloading of the GolfPage. Params: None Return: None """ assert self.notify.debugStateCall(self) self.avatar = None # break the garbage cycle ShtikerPage.unload(self)
def exit(self): """ Purpose: The exit Method. Params: None Return: None """ assert self.notify.debugStateCall(self) self.golfTrophies.hide() self.golfRecords.hide() # Make the call to the superclass exit method. ShtikerPage.exit(self)
def __init__(self): """ Purpose: The __init__ Method provides the intial construction of the GolfPage object as well as constructing the ShtikerPage superclass. Params: None Return: None """ assert self.notify.debugStateCall(self) ShtikerPage.__init__(self) self.avatar = None self.mode = PageMode.Trophy
def enter(self): """ Purpose: The enter Method. Params: None Return: None """ assert self.notify.debugStateCall(self) # If the Page has not already been loaded, do so now before # the page mode. if (not hasattr(self, "title")): self.load() self.setMode(self.mode, 1) # Make the call to the superclass enter method. ShtikerPage.enter(self)
def exit(self): self.golfTrophies.hide() self.golfRecords.hide() ShtikerPage.exit(self)
def enter(self): if not hasattr(self, 'title'): self.load() self.setMode(self.mode, 1) ShtikerPage.enter(self)
def __init__(self): ShtikerPage.__init__(self) self.avatar = None self.mode = PageMode.Trophy return
def unload(self): self.avatar = None ShtikerPage.unload(self) return
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()