Mark spoolup values with asterisk
This commit is contained in:
@@ -18,9 +18,7 @@ def handler(fit, container, context, **kwargs):
|
||||
repSpoolPerCycle = container.getModifiedItemAttr("repairMultiplierBonusPerCycle")
|
||||
# TODO: fetch spoolup option
|
||||
defaultSpoolValue = 1
|
||||
spoolType, spoolAmount = resolveSpoolOptions(
|
||||
SpoolOptions(SpoolType.SCALE, defaultSpoolValue, False),
|
||||
container)
|
||||
spoolType, spoolAmount = resolveSpoolOptions(SpoolOptions(SpoolType.SCALE, defaultSpoolValue, False), container)
|
||||
rps = repAmountBase * (1 + calculateSpoolup(repSpoolMax, repSpoolPerCycle, cycleTime, spoolType, spoolAmount)[0]) / cycleTime
|
||||
rpsPreSpool = repAmountBase * (1 + calculateSpoolup(repSpoolMax, repSpoolPerCycle, cycleTime, SpoolType.SCALE, 0)[0]) / cycleTime
|
||||
rpsFullSpool = repAmountBase * (1 + calculateSpoolup(repSpoolMax, repSpoolPerCycle, cycleTime, SpoolType.SCALE, 1)[0]) / cycleTime
|
||||
|
||||
@@ -165,25 +165,25 @@ class FirepowerViewFull(StatsView):
|
||||
lambda: fit.getWeaponDps(spoolOptions=SpoolOptions(SpoolType.SCALE, defaultSpoolValue, False)).total,
|
||||
lambda: fit.getWeaponDps(spoolOptions=SpoolOptions(SpoolType.SCALE, 0, True)).total,
|
||||
lambda: fit.getWeaponDps(spoolOptions=SpoolOptions(SpoolType.SCALE, 1, True)).total,
|
||||
3, 0, 0, "%s DPS"),
|
||||
3, 0, 0, "{}{} DPS"),
|
||||
(
|
||||
"labelFullDpsDrone",
|
||||
lambda: fit.getDroneDps().total,
|
||||
lambda: fit.getDroneDps().total,
|
||||
lambda: fit.getDroneDps().total,
|
||||
3, 0, 0, "%s DPS"),
|
||||
3, 0, 0, "{}{} DPS"),
|
||||
(
|
||||
"labelFullVolleyTotal",
|
||||
lambda: fit.getTotalVolley(spoolOptions=SpoolOptions(SpoolType.SCALE, defaultSpoolValue, False)).total,
|
||||
lambda: fit.getTotalVolley(spoolOptions=SpoolOptions(SpoolType.SCALE, 0, True)).total,
|
||||
lambda: fit.getTotalVolley(spoolOptions=SpoolOptions(SpoolType.SCALE, 1, True)).total,
|
||||
3, 0, 0, "%s"),
|
||||
3, 0, 0, "{}{}"),
|
||||
(
|
||||
"labelFullDpsTotal",
|
||||
lambda: fit.getTotalDps(spoolOptions=SpoolOptions(SpoolType.SCALE, defaultSpoolValue, False)).total,
|
||||
lambda: fit.getTotalDps(spoolOptions=SpoolOptions(SpoolType.SCALE, 0, True)).total,
|
||||
lambda: fit.getTotalDps(spoolOptions=SpoolOptions(SpoolType.SCALE, 1, True)).total,
|
||||
3, 0, 0, "%s"))
|
||||
3, 0, 0, "{}{}"))
|
||||
|
||||
counter = 0
|
||||
for labelName, val, preSpoolVal, fullSpoolVal, prec, lowest, highest, valueFormat in stats:
|
||||
@@ -192,9 +192,10 @@ class FirepowerViewFull(StatsView):
|
||||
preSpoolVal = preSpoolVal() if fit is not None else 0
|
||||
fullSpoolVal = fullSpoolVal() if fit is not None else 0
|
||||
if self._cachedValues[counter] != val:
|
||||
valueStr = formatAmount(val, prec, lowest, highest)
|
||||
label.SetLabel(valueFormat % valueStr)
|
||||
tooltipText = dpsToolTip(preSpoolVal, fullSpoolVal, prec, lowest, highest)
|
||||
label.SetLabel(valueFormat.format(
|
||||
formatAmount(val, prec, lowest, highest),
|
||||
"*" if tooltipText else ""))
|
||||
label.SetToolTip(wx.ToolTip(tooltipText))
|
||||
self._cachedValues[counter] = val
|
||||
counter += 1
|
||||
|
||||
@@ -27,25 +27,25 @@ from eos.utils.spoolSupport import SpoolType, SpoolOptions
|
||||
|
||||
stats = [
|
||||
(
|
||||
"labelRemoteCapacitor", "Capacitor:", "{} GJ/s", "capacitorInfo", "Capacitor restored",
|
||||
"labelRemoteCapacitor", "Capacitor:", "{}{} GJ/s", "capacitorInfo", "Capacitor restored",
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, spool, False)).get("Capacitor"),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 0, True)).get("Capacitor", 0),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 1, True)).get("Capacitor", 0),
|
||||
3, 0, 0),
|
||||
(
|
||||
"labelRemoteShield", "Shield:", "{} HP/s", "shieldActive", "Shield restored",
|
||||
"labelRemoteShield", "Shield:", "{}{} HP/s", "shieldActive", "Shield restored",
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, spool, False)).get("Shield"),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 0, True)).get("Shield", 0),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 1, True)).get("Shield", 0),
|
||||
3, 0, 0),
|
||||
(
|
||||
"labelRemoteArmor", "Armor:", "{} HP/s", "armorActive", "Armor restored",
|
||||
"labelRemoteArmor", "Armor:", "{}{} HP/s", "armorActive", "Armor restored",
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, spool, False)).get("Armor"),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 0, True)).get("Armor", 0),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 1, True)).get("Armor", 0),
|
||||
3, 0, 0),
|
||||
(
|
||||
"labelRemoteHull", "Hull:", "{} HP/s", "hullActive", "Hull restored",
|
||||
"labelRemoteHull", "Hull:", "{}{} HP/s", "hullActive", "Hull restored",
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, spool, False)).get("Hull"),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 0, True)).get("Hull", 0),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 1, True)).get("Hull", 0),
|
||||
@@ -81,7 +81,7 @@ class OutgoingViewFull(StatsView):
|
||||
|
||||
baseBox.Add(BitmapLoader.getStaticBitmap("%s_big" % image, parent, "gui"), 0, wx.ALIGN_CENTER)
|
||||
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, valueFormat.format(0))
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, valueFormat.format(0, ""))
|
||||
lbl.SetToolTip(wx.ToolTip(tooltip))
|
||||
setattr(self, labelName, lbl)
|
||||
|
||||
@@ -94,9 +94,9 @@ class OutgoingViewFull(StatsView):
|
||||
|
||||
def formatTooltip(text, preSpool, fullSpool, prec, lowest, highest):
|
||||
if roundToPrec(preSpool, prec) == roundToPrec(fullSpool, prec):
|
||||
return text
|
||||
return False, text
|
||||
else:
|
||||
return "{}\nSpool up: {}-{}".format(
|
||||
return True, "{}\nSpool up: {}-{}".format(
|
||||
text,
|
||||
formatAmount(preSpool, prec, lowest, highest),
|
||||
formatAmount(fullSpool, prec, lowest, highest))
|
||||
@@ -110,8 +110,10 @@ class OutgoingViewFull(StatsView):
|
||||
preSpoolVal = preSpoolVal(fit) if fit is not None else 0
|
||||
fullSpoolVal = fullSpoolVal(fit) if fit is not None else 0
|
||||
if self._cachedValues[counter] != val:
|
||||
label.SetLabel(valueFormat.format(formatAmount(val, prec, lowest, highest)))
|
||||
tooltipText = formatTooltip(tooltip, preSpoolVal, fullSpoolVal, prec, lowest, highest)
|
||||
hasSpool, tooltipText = formatTooltip(tooltip, preSpoolVal, fullSpoolVal, prec, lowest, highest)
|
||||
label.SetLabel(valueFormat.format(
|
||||
formatAmount(val, prec, lowest, highest),
|
||||
"*" if hasSpool else ""))
|
||||
label.SetToolTip(wx.ToolTip(tooltipText))
|
||||
self._cachedValues[counter] = val
|
||||
counter += 1
|
||||
|
||||
@@ -26,25 +26,25 @@ from eos.utils.spoolSupport import SpoolType, SpoolOptions
|
||||
|
||||
stats = [
|
||||
(
|
||||
"labelRemoteCapacitor", "Capacitor:", "{} GJ/s", "capacitorInfo", "Capacitor restored",
|
||||
"labelRemoteCapacitor", "Capacitor:", "{}{} GJ/s", "capacitorInfo", "Capacitor restored",
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, spool, False)).get("Capacitor"),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 0, True)).get("Capacitor", 0),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 1, True)).get("Capacitor", 0),
|
||||
3, 0, 0),
|
||||
(
|
||||
"labelRemoteShield", "Shield:", "{} HP/s", "shieldActive", "Shield restored",
|
||||
"labelRemoteShield", "Shield:", "{}{} HP/s", "shieldActive", "Shield restored",
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, spool, False)).get("Shield"),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 0, True)).get("Shield", 0),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 1, True)).get("Shield", 0),
|
||||
3, 0, 0),
|
||||
(
|
||||
"labelRemoteArmor", "Armor:", "{} HP/s", "armorActive", "Armor restored",
|
||||
"labelRemoteArmor", "Armor:", "{}{} HP/s", "armorActive", "Armor restored",
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, spool, False)).get("Armor"),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 0, True)).get("Armor", 0),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 1, True)).get("Armor", 0),
|
||||
3, 0, 0),
|
||||
(
|
||||
"labelRemoteHull", "Hull:", "{} HP/s", "hullActive", "Hull restored",
|
||||
"labelRemoteHull", "Hull:", "{}{} HP/s", "hullActive", "Hull restored",
|
||||
lambda fit, spool: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, spool, False)).get("Hull"),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 0, True)).get("Hull", 0),
|
||||
lambda fit: fit.getRemoteReps(spoolOptions=SpoolOptions(SpoolType.SCALE, 1, True)).get("Hull", 0),
|
||||
@@ -80,7 +80,7 @@ class OutgoingViewMinimal(StatsView):
|
||||
|
||||
baseBox.Add(wx.StaticText(contentPanel, wx.ID_ANY, labelDesc), 0, wx.ALIGN_CENTER)
|
||||
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, valueFormat.format(0))
|
||||
lbl = wx.StaticText(parent, wx.ID_ANY, valueFormat.format(0, ""))
|
||||
lbl.SetToolTip(wx.ToolTip(tooltip))
|
||||
setattr(self, labelName, lbl)
|
||||
|
||||
@@ -93,9 +93,9 @@ class OutgoingViewMinimal(StatsView):
|
||||
|
||||
def formatTooltip(text, preSpool, fullSpool, prec, lowest, highest):
|
||||
if roundToPrec(preSpool, prec) == roundToPrec(fullSpool, prec):
|
||||
return text
|
||||
return False, text
|
||||
else:
|
||||
return "{}\nSpool up: {}-{}".format(
|
||||
return True, "{}\nSpool up: {}-{}".format(
|
||||
text,
|
||||
formatAmount(preSpool, prec, lowest, highest),
|
||||
formatAmount(fullSpool, prec, lowest, highest))
|
||||
@@ -109,8 +109,10 @@ class OutgoingViewMinimal(StatsView):
|
||||
preSpoolVal = preSpoolVal(fit) if fit is not None else 0
|
||||
fullSpoolVal = fullSpoolVal(fit) if fit is not None else 0
|
||||
if self._cachedValues[counter] != val:
|
||||
label.SetLabel(valueFormat.format(formatAmount(val, prec, lowest, highest)))
|
||||
tooltipText = formatTooltip(tooltip, preSpoolVal, fullSpoolVal, prec, lowest, highest)
|
||||
hasSpool, tooltipText = formatTooltip(tooltip, preSpoolVal, fullSpoolVal, prec, lowest, highest)
|
||||
label.SetLabel(valueFormat.format(
|
||||
formatAmount(val, prec, lowest, highest),
|
||||
"*" if hasSpool else ""))
|
||||
label.SetToolTip(wx.ToolTip(tooltipText))
|
||||
self._cachedValues[counter] = val
|
||||
counter += 1
|
||||
|
||||
@@ -90,7 +90,6 @@ class RechargeViewFull(StatsView):
|
||||
tankTypeCap = tankType[0].capitalize() + tankType[1:]
|
||||
lbl = wx.StaticText(contentPanel, wx.ID_ANY, "0.0", style=wx.ALIGN_RIGHT)
|
||||
setattr(self, "labelTank%s%s" % (stability.capitalize(), tankTypeCap), lbl)
|
||||
|
||||
box = wx.BoxSizer(wx.HORIZONTAL)
|
||||
box.Add(lbl, 0, wx.EXPAND)
|
||||
|
||||
@@ -123,7 +122,6 @@ class RechargeViewFull(StatsView):
|
||||
amount = tank["{}Repair".format(name)]
|
||||
else:
|
||||
amount = 0
|
||||
lbl.SetLabel("{:.1f}".format(amount))
|
||||
|
||||
if tank is not None and name == "armor":
|
||||
preSpoolAmount = tank["armorRepairPreSpool"]
|
||||
@@ -134,6 +132,8 @@ class RechargeViewFull(StatsView):
|
||||
ttText = ""
|
||||
else:
|
||||
ttText = ""
|
||||
|
||||
lbl.SetLabel("{:.1f}{}".format(amount, "*" if ttText else ""))
|
||||
lbl.SetToolTip(wx.ToolTip(ttText))
|
||||
unitlbl.SetToolTip(wx.ToolTip(ttText))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user