From 72c74513ce37deb18f573527029994fa9eca898b Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Wed, 4 Dec 2019 22:21:25 +0300 Subject: [PATCH] Add excessive effective cap gain to tooltip --- gui/builtinStatsViews/capacitorViewFull.py | 16 +++++++++++----- service/port/eft.py | 1 - 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/gui/builtinStatsViews/capacitorViewFull.py b/gui/builtinStatsViews/capacitorViewFull.py index fb5acd1a9..3ebaa8876 100644 --- a/gui/builtinStatsViews/capacitorViewFull.py +++ b/gui/builtinStatsViews/capacitorViewFull.py @@ -133,11 +133,17 @@ class CapacitorViewFull(StatsView): label.SetLabel('{}{}'.format(formatAmount(value, prec, lowest, highest, forceSign=forceSign), unit)) label.SetToolTip(wx.ToolTip("%.1f" % value)) - if labelName == 'label%sCapacitorDelta': - label_tooltip = 'Capacitor delta:\n+{} GJ/s\n-{} GJ/s'.format( - formatAmount(cap_recharge, 3, 0, 3), - formatAmount(cap_use, 3, 0, 3)) - label.SetToolTip(wx.ToolTip(label_tooltip)) + if labelName == 'label%sCapacitorDelta' and cap_recharge and cap_use: + lines = [] + lines.append('Capacitor delta:') + lines.append(' +{} GJ/s'.format(formatAmount(cap_recharge, 3, 0, 3))) + lines.append(' -{} GJ/s'.format(formatAmount(cap_use, 3, 0, 3))) + delta = round(cap_recharge - cap_use, 3) + if delta > 0 and neut_res < 1: + lines.append('') + lines.append('Effective excessive gain:') + lines.append(' +{} GJ/s'.format(formatAmount(delta / neut_res, 3, 0, 3))) + label.SetToolTip(wx.ToolTip('\n'.join(lines))) if labelName == 'label%sCapacitorResist': texts = ['Neutralizer resistance'] if cap_amount > 0 and neut_res < 1: diff --git a/service/port/eft.py b/service/port/eft.py index 50a3a5219..d0de5ab95 100644 --- a/service/port/eft.py +++ b/service/port/eft.py @@ -864,7 +864,6 @@ class AbstractFit: self.cargo[itemSpec.item].amount += itemSpec.amount - def _lineIter(text): """Iterate over non-blank lines.""" for line in text.splitlines():