Show tooltip with spoolup local tank when needed
This commit is contained in:
@@ -63,15 +63,20 @@ class RechargeViewFull(StatsView):
|
|||||||
|
|
||||||
# Add an empty label first for correct alignment.
|
# Add an empty label first for correct alignment.
|
||||||
sizerTankStats.Add(wx.StaticText(contentPanel, wx.ID_ANY, ""), 0)
|
sizerTankStats.Add(wx.StaticText(contentPanel, wx.ID_ANY, ""), 0)
|
||||||
toolTipText = {"shieldPassive": "Passive shield recharge", "shieldActive": "Active shield boost",
|
toolTipText = {
|
||||||
"armorActive": "Armor repair amount", "hullActive": "Hull repair amount"}
|
"shieldPassive": "Passive shield recharge",
|
||||||
|
"shieldActive": "Active shield boost",
|
||||||
|
"armorActive": "Armor repair amount",
|
||||||
|
"hullActive": "Hull repair amount"}
|
||||||
for tankType in ("shieldPassive", "shieldActive", "armorActive", "hullActive"):
|
for tankType in ("shieldPassive", "shieldActive", "armorActive", "hullActive"):
|
||||||
bitmap = BitmapLoader.getStaticBitmap("%s_big" % tankType, contentPanel, "gui")
|
bitmap = BitmapLoader.getStaticBitmap("%s_big" % tankType, contentPanel, "gui")
|
||||||
tooltip = wx.ToolTip(toolTipText[tankType])
|
tooltip = wx.ToolTip(toolTipText[tankType])
|
||||||
bitmap.SetToolTip(tooltip)
|
bitmap.SetToolTip(tooltip)
|
||||||
sizerTankStats.Add(bitmap, 0, wx.ALIGN_CENTER)
|
sizerTankStats.Add(bitmap, 0, wx.ALIGN_CENTER)
|
||||||
|
|
||||||
toolTipText = {"reinforced": "Reinforced", "sustained": "Sustained"}
|
toolTipText = {
|
||||||
|
"reinforced": "Reinforced",
|
||||||
|
"sustained": "Sustained"}
|
||||||
for stability in ("reinforced", "sustained"):
|
for stability in ("reinforced", "sustained"):
|
||||||
bitmap = BitmapLoader.getStaticBitmap("regen%s_big" % stability.capitalize(), contentPanel, "gui")
|
bitmap = BitmapLoader.getStaticBitmap("regen%s_big" % stability.capitalize(), contentPanel, "gui")
|
||||||
tooltip = wx.ToolTip(toolTipText[stability])
|
tooltip = wx.ToolTip(toolTipText[stability])
|
||||||
@@ -115,9 +120,22 @@ class RechargeViewFull(StatsView):
|
|||||||
unitlbl = getattr(self, "unitLabelTank%s%sActive" % (stability.capitalize(), name.capitalize()))
|
unitlbl = getattr(self, "unitLabelTank%s%sActive" % (stability.capitalize(), name.capitalize()))
|
||||||
unitlbl.SetLabel(unit)
|
unitlbl.SetLabel(unit)
|
||||||
if tank is not None:
|
if tank is not None:
|
||||||
lbl.SetLabel("%.1f" % tank["%sRepair" % name])
|
amount = tank["{}Repair".format(name)]
|
||||||
else:
|
else:
|
||||||
lbl.SetLabel("0.0")
|
amount = 0
|
||||||
|
lbl.SetLabel("{:.1f}".format(amount))
|
||||||
|
|
||||||
|
if tank is not None and name == "armor":
|
||||||
|
preSpoolAmount = tank["armorRepairPreSpool"]
|
||||||
|
fullSpoolAmount = tank["armorRepairFullSpool"]
|
||||||
|
if round(preSpoolAmount, 1) != round(fullSpoolAmount, 1):
|
||||||
|
ttText = "Spool up: {:.1f}-{:.1f}".format(preSpoolAmount, fullSpoolAmount)
|
||||||
|
else:
|
||||||
|
ttText = ""
|
||||||
|
else:
|
||||||
|
ttText = ""
|
||||||
|
lbl.SetToolTip(wx.ToolTip(ttText))
|
||||||
|
unitlbl.SetToolTip(wx.ToolTip(ttText))
|
||||||
|
|
||||||
if fit is not None:
|
if fit is not None:
|
||||||
label = getattr(self, "labelTankSustainedShieldPassive")
|
label = getattr(self, "labelTankSustainedShieldPassive")
|
||||||
|
|||||||
Reference in New Issue
Block a user