def updatePage(self):
     if hasattr(self, 'collectedTotal'):
         self.collectedTotal['text'] = TTLocalizer.FishPageCollectedTotal % (len(base.localAvatar.fishCollection), FishGlobals.getTotalNumFish())
     
     if hasattr(self, 'rod'):
         rod = base.localAvatar.fishingRod
         rodName = TTLocalizer.FishingRodNameDict[rod]
         rodWeightRange = FishGlobals.getRodWeightRange(rod)
         self.rod['text'] = TTLocalizer.FishPageRodInfo % (rodName, rodWeightRange[0], rodWeightRange[1])
     
     if self.mode == FishPage_Tank:
         if hasattr(self, 'picker'):
             newTankFish = base.localAvatar.fishTank.getFish()
             self.picker.update(newTankFish)
         
     elif self.mode == FishPage_Collection:
         if hasattr(self, 'browser'):
             self.browser.update()
         
     elif self.mode == FishPage_Trophy:
         if hasattr(self, 'trophies'):
             for trophy in self.trophies:
                 trophy.setLevel(-1)
             
             for trophyId in base.localAvatar.getFishingTrophies():
                 self.trophies[trophyId].setLevel(trophyId)
Example #2
0
    def updatePage(self):
        if hasattr(self, 'collectedTotal'):
            self.collectedTotal[
                'text'] = TTLocalizer.FishPageCollectedTotal % (
                    len(base.localAvatar.fishCollection),
                    FishGlobals.getTotalNumFish())
        if hasattr(self, 'rod'):
            rod = base.localAvatar.fishingRod
            rodName = TTLocalizer.FishingRodNameDict[rod]
            rodWeightRange = FishGlobals.getRodWeightRange(rod)
            self.rod['text'] = TTLocalizer.FishPageRodInfo % (
                rodName, rodWeightRange[0], rodWeightRange[1])
        if self.mode == FishPage_Tank:
            if hasattr(self, 'picker'):
                newTankFish = base.localAvatar.fishTank.getFish()
                self.picker.update(newTankFish)
        elif self.mode == FishPage_Collection:
            if hasattr(self, 'browser'):
                self.browser.update()
        elif self.mode == FishPage_Trophy:
            if hasattr(self, 'trophies'):
                for trophy in self.trophies:
                    trophy.setLevel(-1)

                for trophyId in base.localAvatar.getFishingTrophies():
                    self.trophies[trophyId].setLevel(trophyId)
Example #3
0
    def updatePage(self):
        assert self.notify.debugStateCall(self)

        if hasattr(self, "collectedTotal"):
            # update the total  collection
            self.collectedTotal['text'] = (
                TTLocalizer.FishPageCollectedTotal %
                (len(base.localAvatar.fishCollection),
                 FishGlobals.getTotalNumFish()))

        if hasattr(self, "rod"):
            # update the rod info on the picker
            rod = base.localAvatar.fishingRod
            rodName = TTLocalizer.FishingRodNameDict[rod]
            rodWeightRange = FishGlobals.getRodWeightRange(rod)
            self.rod['text'] = TTLocalizer.FishPageRodInfo % (
                rodName, rodWeightRange[0], rodWeightRange[1])

        if self.mode == FishPage_Tank:
            if hasattr(self, "picker"):
                # the fish list may have changed, update the picker
                newTankFish = base.localAvatar.fishTank.getFish()
                self.picker.update(newTankFish)
        elif self.mode == FishPage_Collection:
            if hasattr(self, "browser"):
                # the fish gallery may have changed, update the browser
                self.browser.update()
        elif self.mode == FishPage_Trophy:
            if hasattr(self, "trophies"):
                # the fishing trophy list may have changed, update the display
                for trophy in self.trophies:
                    trophy.setLevel(-1)
                for trophyId in base.localAvatar.getFishingTrophies():
                    self.trophies[trophyId].setLevel(trophyId)