From 41fab277ae8bea70341fa1f9da0e20b982b20b3c Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Fri, 3 Sep 2010 12:08:52 +0200 Subject: [PATCH] Use more precise ehp values (1 decimal instead of zero) --- gui/statsPane.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/gui/statsPane.py b/gui/statsPane.py index bf9f15027..b58b0404a 100644 --- a/gui/statsPane.py +++ b/gui/statsPane.py @@ -46,7 +46,7 @@ class StatsPane(wx.Panel): mdc.SetFont(tfont) width, height = mdc.GetTextExtent( text ) return width - + def fitChanged(self, event): cFit = controller.Fit.getInstance() fit = cFit.getFit(event.fitID) @@ -95,7 +95,7 @@ class StatsPane(wx.Panel): for labelName, value, rounding in stats: label = getattr(self, labelName) value = value() if fit is not None else 0 - value = value if value is not None else 0 + value = value if value is not None else 0 label.SetLabel(shorten(value, rounding)) # cap stuff @@ -163,13 +163,17 @@ class StatsPane(wx.Panel): lbl.SetValue(resonance) ehp = fit.ehp if fit is not None else None + total = 0 for tankType in ("shield", "armor", "hull"): lbl = getattr(self, "labelResistance%sEhp" % tankType.capitalize()) if ehp is not None: - lbl.SetLabel(shorten(ehp[tankType], 0)) + total += ehp[tankType] + lbl.SetLabel(shorten(ehp[tankType], 1)) else: lbl.SetLabel("0") + self.labelEhp.SetLabel(shorten(total, 1)) + damagePattern = fit.damagePattern if fit is not None else None for damageType in ("em", "thermal", "kinetic", "explosive"): lbl = getattr(self, "labelResistanceDamagepattern%s" % damageType.capitalize()) @@ -364,7 +368,7 @@ class StatsPane(wx.Panel): units = {"cpu":" tf", "pg":" GJ", "droneBandwidth":" mbit/s", "droneBay":u" m\u00B3"} lbl = wx.StaticText(parent, wx.ID_ANY, "%s" % units[type]) absolute.Add(lbl, 0, wx.ALIGN_LEFT) - + # Gauges modif. - Darriele if self._showNormalGauges == True: gauge = wx.Gauge(parent, wx.ID_ANY, 100) @@ -837,4 +841,4 @@ class StatsPane(wx.Panel): self.miniSize=self.miniPanel.GetBestSize() self.miniSize.SetWidth( self.miniSize.GetWidth() + 30 ) self.miniPanel.SetMinSize( self.miniSize) - +