def doTab(self, index): self.activeTab = index self.tabs[index].reparentTo(self.pageFrame) for i in range(len(self.tabs)): tab = self.tabs[i] if i == index: tab['text0_fg'] = (1, 0, 0, 1) tab['text2_fg'] = (1, 0, 0, 1) else: tab['text0_fg'] = (0, 0, 0, 1) tab['text2_fg'] = (0.5, 0.4, 0.4, 1) self.bkgd.setColor(DeptColors[index]) self.deptLabel['text'] = (SuitDNA.suitDeptFullnames[SuitDNA.suitDepts[index]],) cogIndex = base.localAvatar.cogTypes[index] + SuitDNA.suitsPerDept * index cog = SuitDNA.suitHeadTypes[cogIndex] self.progressTitle.hide() if SuitDNA.suitDepts[index] == 'm': self.progressTitle = self.cogbuckTitle elif SuitDNA.suitDepts[index] == 'l': self.progressTitle = self.juryNoticeTitle elif SuitDNA.suitDepts[index] == 'c': self.progressTitle = self.stockOptionTitle else: self.progressTitle = self.meritTitle self.progressTitle.show() self.cogName['text'] = SuitBattleGlobals.SuitAttributes[cog]['name'] cogLevel = base.localAvatar.cogLevels[index] self.cogLevel['text'] = TTLocalizer.DisguisePageCogLevel % str(cogLevel + 1) numParts = base.localAvatar.cogParts[index] numPartsRequired = CogDisguiseGlobals.PartsPerSuit[index] self.updatePartsDisplay(index, numParts, numPartsRequired) self.updateMeritBar(index) self.cogPartRatio['text'] = '%d/%d' % (CogDisguiseGlobals.getTotalParts(numParts), numPartsRequired)
def doTab(self, index): self.activeTab = index self.tabs[index].reparentTo(self.pageFrame) for i in range(len(self.tabs)): tab = self.tabs[i] if i == index: tab['text0_fg'] = (1, 0, 0, 1) tab['text2_fg'] = (1, 0, 0, 1) continue tab['text0_fg'] = (0, 0, 0, 1) tab['text2_fg'] = (0.5, 0.40000000000000002, 0.40000000000000002, 1) self.bkgd.setColor(DeptColors[index]) self.deptLabel['text'] = (SuitDNA.suitDeptFullnames[SuitDNA.suitDepts[index]],) cogIndex = base.localAvatar.cogTypes[index] + SuitDNA.suitsPerDept * index cog = SuitDNA.suitHeadTypes[cogIndex] self.progressTitle.hide() if SuitDNA.suitDepts[index] == 'm': self.progressTitle = self.cogbuckTitle elif SuitDNA.suitDepts[index] == 'l': self.progressTitle = self.juryNoticeTitle elif SuitDNA.suitDepts[index] == 'c': self.progressTitle = self.stockOptionTitle else: self.progressTitle = self.meritTitle self.progressTitle.show() self.cogName['text'] = SuitBattleGlobals.SuitAttributes[cog]['name'] cogLevel = base.localAvatar.cogLevels[index] self.cogLevel['text'] = TTLocalizer.DisguisePageCogLevel % str(cogLevel + 1) numParts = base.localAvatar.cogParts[index] numPartsRequired = CogDisguiseGlobals.PartsPerSuit[index] self.updatePartsDisplay(index, numParts, numPartsRequired) self.updateMeritBar(index) self.cogPartRatio['text'] = '%d/%d' % (CogDisguiseGlobals.getTotalParts(numParts), numPartsRequired)
def doTab(self, index): self.activeTab = index self.bkgd.setColor(DeptColors[index]) self.deptLabel['text'] = ( SuitDNA.suitDeptFullnames[SuitDNA.suitDepts[index]], ) cogIndex = base.localAvatar.cogTypes[ index] + SuitDNA.suitsPerDept * index cog = SuitDNA.suitHeadTypes[cogIndex] self.progressTitle.hide() if SuitDNA.suitDepts[index] == 'm': self.progressTitle = self.cogbuckTitle elif SuitDNA.suitDepts[index] == 'l': self.progressTitle = self.juryNoticeTitle elif SuitDNA.suitDepts[index] == 'c': self.progressTitle = self.stockOptionTitle else: self.progressTitle = self.meritTitle self.progressTitle.show() self.cogName['text'] = SuitBattleGlobals.SuitAttributes[cog]['name'] cogLevel = base.localAvatar.cogLevels[index] if base.localAvatar.cogReviveLevels[self.activeTab] > -1: cogLevel = base.localAvatar.cogReviveLevels[self.activeTab] self.cogLevel['text_scale'] = 0.065 self.cogLevel['text'] = TTLocalizer.DisguisePageCogLevel % str( cogLevel + 1) + TTLocalizer.SkeleRevivePostFix else: self.cogLevel['text_scale'] = 0.09 self.cogLevel['text'] = TTLocalizer.DisguisePageCogLevel % str( cogLevel + 1) numParts = base.localAvatar.cogParts[index] numPartsRequired = CogDisguiseGlobals.PartsPerSuit[index] self.updatePartsDisplay(index, numParts, numPartsRequired) self.updateMeritBar(index) self.cogPartRatio['text'] = '%d/%d' % ( CogDisguiseGlobals.getTotalParts(numParts), numPartsRequired)
def doTab(self, index): self.promoteButton.hide() self.activeTab = index self.tabs[index].reparentTo(self.pageFrame) for i in range(len(self.tabs)): tab = self.tabs[i] print(tab) if i == index: tab['text0_fg'] = (1, 0, 0, 1) tab['text2_fg'] = (1, 0, 0, 1) else: tab['text0_fg'] = (0, 0, 0, 1) tab['text2_fg'] = (0.5, 0.4, 0.4, 1) self.bkgd.setColor(DeptColors[index]) self.deptLabel['text'] = ( SuitDNA.suitDeptFullnames[SuitDNA.suitDepts[index]], ) cogIndex = base.localAvatar.cogTypes[ index] + SuitDNA.suitsPerDept * index cog = SuitDNA.suitHeadTypes[cogIndex] self.progressTitle.hide() if SuitDNA.suitDepts[index] == 'm': self.progressTitle = self.cogbuckTitle elif SuitDNA.suitDepts[index] == 'l': self.progressTitle = self.juryNoticeTitle elif SuitDNA.suitDepts[index] == 'c': self.progressTitle = self.stockOptionTitle elif SuitDNA.suitDepts[index] == 'y': self.progressTitle = self.TechbyteTitle else: self.progressTitle = self.meritTitle self.progressTitle.show() self.cogName['text'] = SuitBattleGlobals.SuitAttributes[cog]['name'] cogLevel = base.localAvatar.cogLevels[index] self.cogLevel['text'] = TTLocalizer.DisguisePageCogLevel % str( cogLevel + 1) numParts = base.localAvatar.cogParts[index] numPartsRequired = CogDisguiseGlobals.PartsPerSuit[index] self.updatePartsDisplay(index, numParts, numPartsRequired) self.updateMeritBar(index) self.cogPartRatio['text'] = '%d/%d' % ( CogDisguiseGlobals.getTotalParts(numParts), numPartsRequired) if base.localAvatar.promotionStatus[ index] == ToontownGlobals.PendingPromotion: self.promoteButton['extraArgs'] = [index] if base.localAvatar.cogLevels[ index] == ToontownGlobals.MaxCogSuitLevel: self.promoteButton['state'] = DGG.DISABLED else: self.promoteButton['state'] = DGG.NORMAL self.promoteButton.show()
def doTab(self, index): self.activeTab = index self.tabs[index].reparentTo(self.pageFrame) # update the tab buttons for i in range(len(self.tabs)): tab = self.tabs[i] if i == index: tab['text0_fg'] = (1, 0, 0, 1) tab['text2_fg'] = (1, 0, 0, 1) else: tab['text0_fg'] = (0, 0, 0, 1) tab['text2_fg'] = (0.5, 0.4, 0.4, 1) # Set background color self.bkgd.setColor(DeptColors[index]) # Update the label self.deptLabel['text'] = SuitDNA.suitDeptFullnames[ SuitDNA.suitDepts[index]], # determine the offset in head array for this dept cogIndex = (base.localAvatar.cogTypes[index] + (SuitDNA.suitsPerDept * index)) cog = SuitDNA.suitHeadTypes[cogIndex] # update the gui self.progressTitle.hide() if SuitDNA.suitDepts[index] == 'm': self.progressTitle = self.cogbuckTitle elif SuitDNA.suitDepts[index] == 'l': self.progressTitle = self.juryNoticeTitle elif SuitDNA.suitDepts[index] == 'c': self.progressTitle = self.stockOptionTitle else: self.progressTitle = self.meritTitle self.progressTitle.show() self.cogName['text'] = SuitBattleGlobals.SuitAttributes[cog]['name'] cogLevel = base.localAvatar.cogLevels[index] self.cogLevel['text'] = (TTLocalizer.DisguisePageCogLevel % str(cogLevel + 1)) numParts = base.localAvatar.cogParts[index] numPartsRequired = CogDisguiseGlobals.PartsPerSuit[index] self.updatePartsDisplay(index, numParts, numPartsRequired) self.updateMeritBar(index) self.cogPartRatio['text'] = ( "%d/%d" % (CogDisguiseGlobals.getTotalParts(numParts), numPartsRequired))