def updateRolloverBind(self): if not self.suit: return attributes = SuitBattleGlobals.SuitAttributes[self.suit.getStyleName()] groupAttacks, singleAttacks = SuitBattleGlobals.getAttacksByType(attributes) level = self.suit.getLevel() info = TTLocalizer.BattleCogPopup % (self.getAttackStrings(groupAttacks, level), self.getAttackStrings(singleAttacks, level)) if TTLocalizer.BattleCogPopupDangerColor in info: info = TTLocalizer.BattleCogPopupDanger + info self.hoverButton.bind(DGG.ENTER, self.battle.showRolloverFrame, extraArgs=[self, TTLocalizer.BattleHoverCog, info])
def setPanelStatus(self, panel, status): index = self.panels.index(panel) if status == COG_UNSEEN: panel['text'] = TTLocalizer.SuitPageMystery elif status == COG_BATTLED: suitName = SuitDNA.suitHeadTypes[index] suitFullName = SuitBattleGlobals.SuitAttributes[suitName]['name'] panel['text'] = suitFullName if panel.quotaLabel: panel.quotaLabel.show() else: self.addQuotaLabel(panel) if panel.head and panel.shadow: panel.head.show() panel.shadow.show() else: self.addSuitHead(panel, suitName) if base.localAvatar.hasCogSummons(index): if panel.summonButton: panel.summonButton.show() else: self.addSummonButton(panel) elif status == COG_DEFEATED: count = str(base.localAvatar.cogCounts[index]) if base.localAvatar.cogs[index] < COG_COMPLETE1: quota = str(COG_QUOTAS[0][index % SuitDNA.suitsPerDept]) else: quota = str(COG_QUOTAS[1][index % SuitDNA.suitsPerDept]) panel.quotaLabel['text'] = TTLocalizer.SuitPageQuota % (count, quota) elif status == COG_COMPLETE1: panel['image_color'] = PANEL_COLORS_COMPLETE1[index / SuitDNA.suitsPerDept] elif status == COG_COMPLETE2: panel['image_color'] = PANEL_COLORS_COMPLETE2[index / SuitDNA.suitsPerDept] if status in (COG_DEFEATED, COG_COMPLETE1, COG_COMPLETE2): name = SuitDNA.suitHeadTypes[index] attributes = SuitBattleGlobals.SuitAttributes[name] level = attributes['level'] groupAttacks, singleAttacks = SuitBattleGlobals.getAttacksByType( attributes) info = TTLocalizer.SuitPageAttackFormat % ( level + 1, level + 5, self.getAttackStrings(groupAttacks), self.getAttackStrings(singleAttacks)) panel.hoverButton.bind(DGG.ENTER, self.showInfo, extraArgs=[panel, info]) panel.hoverButton.bind(DGG.EXIT, self.hideInfo)
def setPanelStatus(self, panel, status): index = self.panels.index(panel) if status == COG_UNSEEN: panel['text'] = TTLocalizer.SuitPageMystery elif status == COG_BATTLED: suitName = SuitDNA.suitHeadTypes[index] suitFullName = SuitBattleGlobals.SuitAttributes[suitName]['name'] panel['text'] = suitFullName if panel.quotaLabel: panel.quotaLabel.show() else: self.addQuotaLabel(panel) if panel.head and panel.shadow: panel.head.show() panel.shadow.show() else: self.addSuitHead(panel, suitName) if base.localAvatar.hasCogSummons(index): if panel.summonButton: panel.summonButton.show() else: self.addSummonButton(panel) elif status == COG_DEFEATED: count = str(base.localAvatar.cogCounts[index]) if base.localAvatar.cogs[index] < COG_COMPLETE1: quota = str(COG_QUOTAS[0][index % SuitDNA.suitsPerDept]) else: quota = str(COG_QUOTAS[1][index % SuitDNA.suitsPerDept]) panel.quotaLabel['text'] = TTLocalizer.SuitPageQuota % (count, quota) elif status == COG_COMPLETE1: panel['image_color'] = PANEL_COLORS_COMPLETE1[index / SuitDNA.suitsPerDept] elif status == COG_COMPLETE2: panel['image_color'] = PANEL_COLORS_COMPLETE2[index / SuitDNA.suitsPerDept] if status in (COG_DEFEATED, COG_COMPLETE1, COG_COMPLETE2): name = SuitDNA.suitHeadTypes[index] attributes = SuitBattleGlobals.SuitAttributes[name] level = attributes['level'] groupAttacks, singleAttacks = SuitBattleGlobals.getAttacksByType(attributes) info = TTLocalizer.SuitPageAttackFormat % (level + 1, level + 5, self.getAttackStrings(groupAttacks), self.getAttackStrings(singleAttacks)) panel.hoverButton.bind(DGG.ENTER, self.showInfo, extraArgs=[panel, info]) panel.hoverButton.bind(DGG.EXIT, self.hideInfo)