Implement damage pattern switching

This commit is contained in:
cncfanatics
2010-10-11 10:11:24 +02:00
parent 85a8e561ae
commit fe68ffacfe
3 changed files with 24 additions and 3 deletions

View File

@@ -166,10 +166,13 @@ class ResistancesViewFull(StatsView):
self.labelEhp.SetToolTip(wx.ToolTip("Effective: %d" % total))
damagePattern = fit.damagePattern if fit is not None else None
total = sum((damagePattern.emAmount, damagePattern.thermalAmount,
damagePattern.kineticAmount, damagePattern.explosiveAmount)) if damagePattern is not None else 0
for damageType in ("em", "thermal", "kinetic", "explosive"):
lbl = getattr(self, "gaugeResistanceDamagepattern%s" % damageType.capitalize())
if damagePattern is not None:
lbl.SetValue(getattr(damagePattern, "%sAmount" % damageType))
lbl.SetValue(getattr(damagePattern, "%sAmount" % damageType) / float(total) * 100)
else:
lbl.SetValue(0)