Make spoolup tooltip format consistent
This commit is contained in:
@@ -149,12 +149,11 @@ class FirepowerViewFull(StatsView):
|
|||||||
else:
|
else:
|
||||||
self.stEff.Hide()
|
self.stEff.Hide()
|
||||||
|
|
||||||
def dpsToolTip(preSpool, fullSpool, statName, prec, lowest, highest):
|
def dpsToolTip(preSpool, fullSpool, prec, lowest, highest):
|
||||||
if roundToPrec(preSpool, prec) == roundToPrec(fullSpool, prec):
|
if roundToPrec(preSpool, prec) == roundToPrec(fullSpool, prec):
|
||||||
return ""
|
return ""
|
||||||
else:
|
else:
|
||||||
return "Spool up {}: {}-{}".format(
|
return "Spool up: {}-{}".format(
|
||||||
statName,
|
|
||||||
formatAmount(preSpool, prec, lowest, highest),
|
formatAmount(preSpool, prec, lowest, highest),
|
||||||
formatAmount(fullSpool, prec, lowest, highest))
|
formatAmount(fullSpool, prec, lowest, highest))
|
||||||
|
|
||||||
@@ -164,28 +163,28 @@ class FirepowerViewFull(StatsView):
|
|||||||
lambda: fit.getWeaponDps().total,
|
lambda: fit.getWeaponDps().total,
|
||||||
lambda: fit.getWeaponDps(spoolType=SpoolType.SCALE, spoolAmount=0).total,
|
lambda: fit.getWeaponDps(spoolType=SpoolType.SCALE, spoolAmount=0).total,
|
||||||
lambda: fit.getWeaponDps(spoolType=SpoolType.SCALE, spoolAmount=1).total,
|
lambda: fit.getWeaponDps(spoolType=SpoolType.SCALE, spoolAmount=1).total,
|
||||||
3, 0, 0, "%s DPS", "DPS"),
|
3, 0, 0, "%s DPS"),
|
||||||
(
|
(
|
||||||
"labelFullDpsDrone",
|
"labelFullDpsDrone",
|
||||||
lambda: fit.getDroneDps().total,
|
lambda: fit.getDroneDps().total,
|
||||||
lambda: fit.getDroneDps().total,
|
lambda: fit.getDroneDps().total,
|
||||||
lambda: fit.getDroneDps().total,
|
lambda: fit.getDroneDps().total,
|
||||||
3, 0, 0, "%s DPS", "DPS"),
|
3, 0, 0, "%s DPS"),
|
||||||
(
|
(
|
||||||
"labelFullVolleyTotal",
|
"labelFullVolleyTotal",
|
||||||
lambda: fit.getTotalVolley().total,
|
lambda: fit.getTotalVolley().total,
|
||||||
lambda: fit.getTotalVolley(spoolType=SpoolType.SCALE, spoolAmount=0).total,
|
lambda: fit.getTotalVolley(spoolType=SpoolType.SCALE, spoolAmount=0).total,
|
||||||
lambda: fit.getTotalVolley(spoolType=SpoolType.SCALE, spoolAmount=1).total,
|
lambda: fit.getTotalVolley(spoolType=SpoolType.SCALE, spoolAmount=1).total,
|
||||||
3, 0, 0, "%s", "volley"),
|
3, 0, 0, "%s"),
|
||||||
(
|
(
|
||||||
"labelFullDpsTotal",
|
"labelFullDpsTotal",
|
||||||
lambda: fit.getTotalDps().total,
|
lambda: fit.getTotalDps().total,
|
||||||
lambda: fit.getTotalDps(spoolType=SpoolType.SCALE, spoolAmount=0).total,
|
lambda: fit.getTotalDps(spoolType=SpoolType.SCALE, spoolAmount=0).total,
|
||||||
lambda: fit.getTotalDps(spoolType=SpoolType.SCALE, spoolAmount=1).total,
|
lambda: fit.getTotalDps(spoolType=SpoolType.SCALE, spoolAmount=1).total,
|
||||||
3, 0, 0, "%s", "DPS"))
|
3, 0, 0, "%s"))
|
||||||
|
|
||||||
counter = 0
|
counter = 0
|
||||||
for labelName, val, preSpoolVal, fullSpoolVal, prec, lowest, highest, valueFormat, statName in stats:
|
for labelName, val, preSpoolVal, fullSpoolVal, prec, lowest, highest, valueFormat in stats:
|
||||||
label = getattr(self, labelName)
|
label = getattr(self, labelName)
|
||||||
val = val() if fit is not None else 0
|
val = val() if fit is not None else 0
|
||||||
preSpoolVal = preSpoolVal() if fit is not None else 0
|
preSpoolVal = preSpoolVal() if fit is not None else 0
|
||||||
@@ -195,7 +194,7 @@ class FirepowerViewFull(StatsView):
|
|||||||
if self._cachedValues[counter] != val:
|
if self._cachedValues[counter] != val:
|
||||||
valueStr = formatAmount(val, prec, lowest, highest)
|
valueStr = formatAmount(val, prec, lowest, highest)
|
||||||
label.SetLabel(valueFormat % valueStr)
|
label.SetLabel(valueFormat % valueStr)
|
||||||
tooltipText = dpsToolTip(preSpoolVal, fullSpoolVal, statName, prec, lowest, highest)
|
tooltipText = dpsToolTip(preSpoolVal, fullSpoolVal, prec, lowest, highest)
|
||||||
label.SetToolTip(wx.ToolTip(tooltipText))
|
label.SetToolTip(wx.ToolTip(tooltipText))
|
||||||
self._cachedValues[counter] = val
|
self._cachedValues[counter] = val
|
||||||
counter += 1
|
counter += 1
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ class OutgoingViewFull(StatsView):
|
|||||||
if roundToPrec(preSpool, prec) == roundToPrec(fullSpool, prec):
|
if roundToPrec(preSpool, prec) == roundToPrec(fullSpool, prec):
|
||||||
return text
|
return text
|
||||||
else:
|
else:
|
||||||
return "{}, spool up {}-{}".format(
|
return "{}\nSpool up: {}-{}".format(
|
||||||
text,
|
text,
|
||||||
formatAmount(preSpool, prec, lowest, highest),
|
formatAmount(preSpool, prec, lowest, highest),
|
||||||
formatAmount(fullSpool, prec, lowest, highest))
|
formatAmount(fullSpool, prec, lowest, highest))
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ class OutgoingViewMinimal(StatsView):
|
|||||||
if roundToPrec(preSpool, prec) == roundToPrec(fullSpool, prec):
|
if roundToPrec(preSpool, prec) == roundToPrec(fullSpool, prec):
|
||||||
return text
|
return text
|
||||||
else:
|
else:
|
||||||
return "{}, spool up {}-{}".format(
|
return "{}\nSpool up: {}-{}".format(
|
||||||
text,
|
text,
|
||||||
formatAmount(preSpool, prec, lowest, highest),
|
formatAmount(preSpool, prec, lowest, highest),
|
||||||
formatAmount(fullSpool, prec, lowest, highest))
|
formatAmount(fullSpool, prec, lowest, highest))
|
||||||
|
|||||||
@@ -352,7 +352,7 @@ class Miscellanea(ViewColumn):
|
|||||||
tooltip.append("spool up time")
|
tooltip.append("spool up time")
|
||||||
text = " | ".join(text)
|
text = " | ".join(text)
|
||||||
tooltip = " and ".join(tooltip)
|
tooltip = " and ".join(tooltip)
|
||||||
tooltip = "{}\nSpool up amount {}-{} over {}s".format(
|
tooltip = "{}\nSpool up: {}-{} over {}s".format(
|
||||||
tooltip,
|
tooltip,
|
||||||
formatAmount(rpsPre, 3, 0, 3),
|
formatAmount(rpsPre, 3, 0, 3),
|
||||||
formatAmount(rpsFull, 3, 0, 3),
|
formatAmount(rpsFull, 3, 0, 3),
|
||||||
|
|||||||
Reference in New Issue
Block a user