From 20a1618e4152823a1787e5f7baa95bc28b04946b Mon Sep 17 00:00:00 2001 From: burnsypet Date: Sun, 29 Oct 2017 20:40:39 +0000 Subject: [PATCH] Display warp core strength as warp speed tooltip Changes to antiwarpscramblingpassive.py: Fixed a typo of "warmScrambleStatus" to "warpScrambleStatus" Changes to targetingMiscViewMinimal.py: Extended existing tooltip to include warp core strength. Warp core strength is none for ships that do not have a hull bonus (venture etc.) or do not have any warp core stabs fitted so logic is added to default value to 0. Changes to targetingMiscViewFull.py: As above. --- eos/effects/antiwarpscramblingpassive.py | 2 +- gui/builtinStatsViews/targetingMiscViewFull.py | 16 ++++++++++++---- .../targetingMiscViewMinimal.py | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/eos/effects/antiwarpscramblingpassive.py b/eos/effects/antiwarpscramblingpassive.py index b6181e9a3..6a3165c0a 100644 --- a/eos/effects/antiwarpscramblingpassive.py +++ b/eos/effects/antiwarpscramblingpassive.py @@ -6,4 +6,4 @@ type = "passive" def handler(fit, module, context): - fit.ship.increaseItemAttr("warmScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength")) + fit.ship.increaseItemAttr("warpScrambleStatus", module.getModifiedItemAttr("warpScrambleStrength")) diff --git a/gui/builtinStatsViews/targetingMiscViewFull.py b/gui/builtinStatsViews/targetingMiscViewFull.py index 1fa235ba0..7355031b9 100644 --- a/gui/builtinStatsViews/targetingMiscViewFull.py +++ b/gui/builtinStatsViews/targetingMiscViewFull.py @@ -197,7 +197,12 @@ class TargetingMiscViewFull(StatsView): elif labelName == "labelFullSigRadius": label.SetToolTip(wx.ToolTip("Probe Size: %.3f" % (fit.probeSize or 0))) elif labelName == "labelFullWarpSpeed": - label.SetToolTip(wx.ToolTip("Max Warp Distance: %.1f AU" % fit.maxWarpDistance)) + maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance + if fit.ship.getModifiedItemAttr("warpScrambleStatus"): + warpScrambleStatus = "Warp Core Strength: %.1f" % abs(fit.ship.getModifiedItemAttr("warpScrambleStatus")) + else: + warpScrambleStatus = "Warp Core Strength: %.1f" % 0 + label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus))) elif labelName == "labelSensorStr": if fit.jamChance > 0: label.SetToolTip( @@ -222,9 +227,12 @@ class TargetingMiscViewFull(StatsView): self._cachedValues[counter] = newValues elif labelName == "labelFullWarpSpeed": if fit: - label.SetToolTip(wx.ToolTip("Max Warp Distance: %.1f AU" % fit.maxWarpDistance)) - else: - label.SetToolTip(wx.ToolTip("")) + maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance + if fit.ship.getModifiedItemAttr("warpScrambleStatus"): + warpScrambleStatus = "Warp Core Strength: %.1f" % abs(fit.ship.getModifiedItemAttr("warpScrambleStatus")) + else: + warpScrambleStatus = "Warp Core Strength: %.1f" % 0 + label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus))) elif labelName == "labelSensorStr": if fit: if fit.jamChance > 0: diff --git a/gui/builtinStatsViews/targetingMiscViewMinimal.py b/gui/builtinStatsViews/targetingMiscViewMinimal.py index df0d9f70a..6d019dd8d 100644 --- a/gui/builtinStatsViews/targetingMiscViewMinimal.py +++ b/gui/builtinStatsViews/targetingMiscViewMinimal.py @@ -192,7 +192,12 @@ class TargetingMiscViewMinimal(StatsView): lockTime += "%5s\t%s\n" % (left, right) label.SetToolTip(wx.ToolTip(lockTime)) elif labelName == "labelFullWarpSpeed": - label.SetToolTip(wx.ToolTip("Max Warp Distance: %.1f AU" % fit.maxWarpDistance)) + maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance + if fit.ship.getModifiedItemAttr("warpScrambleStatus"): + warpScrambleStatus = "Warp Core Strength: %.1f" % abs(fit.ship.getModifiedItemAttr("warpScrambleStatus")) + else: + warpScrambleStatus = "Warp Core Strength: %.1f" % 0 + label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus))) elif labelName == "labelSensorStr": if fit.jamChance > 0: label.SetToolTip(wx.ToolTip("Type: %s\n%.1f%% Chance of Jam" % (fit.scanType, fit.jamChance))) @@ -216,7 +221,12 @@ class TargetingMiscViewMinimal(StatsView): self._cachedValues[counter] = newValues elif labelName == "labelFullWarpSpeed": if fit: - label.SetToolTip(wx.ToolTip("Max Warp Distance: %.1f AU" % fit.maxWarpDistance)) + maxWarpDistance = "Max Warp Distance: %.1f AU" % fit.maxWarpDistance + if fit.ship.getModifiedItemAttr("warpScrambleStatus"): + warpScrambleStatus = "Warp Core Strength: %.1f" % abs(fit.ship.getModifiedItemAttr("warpScrambleStatus")) + else: + warpScrambleStatus = "Warp Core Strength: %.1f" % 0 + label.SetToolTip(wx.ToolTip("%s\n%s" % (maxWarpDistance, warpScrambleStatus))) else: label.SetToolTip(wx.ToolTip("")) elif labelName == "labelSensorStr":