From 03e8b8522b5daa01d06c34bb6d114a146b208637 Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Thu, 13 Dec 2018 14:11:03 +0300 Subject: [PATCH] Mark spoolup values with asterisk --- ...hipmoduleremotearmormutadaptiverepairer.py | 4 +--- gui/builtinStatsViews/firepowerViewFull.py | 13 ++++++------ gui/builtinStatsViews/outgoingViewFull.py | 20 ++++++++++--------- gui/builtinStatsViews/outgoingViewMinimal.py | 20 ++++++++++--------- gui/builtinStatsViews/rechargeViewFull.py | 4 ++-- 5 files changed, 32 insertions(+), 29 deletions(-) diff --git a/eos/effects/shipmoduleremotearmormutadaptiverepairer.py b/eos/effects/shipmoduleremotearmormutadaptiverepairer.py index 11ac91052..bd5ee6e29 100644 --- a/eos/effects/shipmoduleremotearmormutadaptiverepairer.py +++ b/eos/effects/shipmoduleremotearmormutadaptiverepairer.py @@ -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 diff --git a/gui/builtinStatsViews/firepowerViewFull.py b/gui/builtinStatsViews/firepowerViewFull.py index 0db0d9735..7af0e2718 100644 --- a/gui/builtinStatsViews/firepowerViewFull.py +++ b/gui/builtinStatsViews/firepowerViewFull.py @@ -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 diff --git a/gui/builtinStatsViews/outgoingViewFull.py b/gui/builtinStatsViews/outgoingViewFull.py index 4c50eb22f..534c69ae6 100644 --- a/gui/builtinStatsViews/outgoingViewFull.py +++ b/gui/builtinStatsViews/outgoingViewFull.py @@ -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 diff --git a/gui/builtinStatsViews/outgoingViewMinimal.py b/gui/builtinStatsViews/outgoingViewMinimal.py index 67cac8f9c..39d9d91bb 100644 --- a/gui/builtinStatsViews/outgoingViewMinimal.py +++ b/gui/builtinStatsViews/outgoingViewMinimal.py @@ -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 diff --git a/gui/builtinStatsViews/rechargeViewFull.py b/gui/builtinStatsViews/rechargeViewFull.py index 09cc0f1f6..db7264a0e 100644 --- a/gui/builtinStatsViews/rechargeViewFull.py +++ b/gui/builtinStatsViews/rechargeViewFull.py @@ -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))