Adding Option to Change "total price" calculation Statview
Hint for module and total price provide detail informations
This commit is contained in:
@@ -24,6 +24,7 @@ from gui.bitmap_loader import BitmapLoader
|
||||
from gui.utils.numberFormatter import formatAmount
|
||||
from service.price import Fit, Price
|
||||
from service.settings import PriceMenuSettings
|
||||
from eos.const import FittingSlot
|
||||
|
||||
|
||||
class PriceViewFull(StatsView):
|
||||
@@ -90,6 +91,13 @@ class PriceViewFull(StatsView):
|
||||
|
||||
ship_price = 0
|
||||
module_price = 0
|
||||
module_slot_price = {
|
||||
FittingSlot.HIGH: 0,
|
||||
FittingSlot.MED: 0,
|
||||
FittingSlot.LOW: 0,
|
||||
FittingSlot.RIG: 0,
|
||||
FittingSlot.SUBSYSTEM: 0
|
||||
}
|
||||
drone_price = 0
|
||||
fighter_price = 0
|
||||
cargo_price = 0
|
||||
@@ -103,6 +111,8 @@ class PriceViewFull(StatsView):
|
||||
for module in fit.modules:
|
||||
if not module.isEmpty:
|
||||
module_price += module.item.price.price
|
||||
if module.slot in module_slot_price:
|
||||
module_slot_price[module.slot] += module.item.price.price
|
||||
|
||||
if fit.drones:
|
||||
for drone in fit.drones:
|
||||
@@ -138,23 +148,45 @@ class PriceViewFull(StatsView):
|
||||
total_price += booster_price + implant_price
|
||||
|
||||
self.labelPriceShip.SetLabel("%s ISK" % formatAmount(ship_price, 3, 3, 9, currency=True))
|
||||
self.labelPriceShip.SetToolTip(wx.ToolTip('{:,.2f}'.format(ship_price)))
|
||||
self.labelPriceShip.SetToolTip(wx.ToolTip('{:,.2f} ISK'.format(ship_price)))
|
||||
|
||||
self.labelPriceFittings.SetLabel("%s ISK" % formatAmount(module_price, 3, 3, 9, currency=True))
|
||||
self.labelPriceFittings.SetToolTip(wx.ToolTip('{:,.2f}'.format(module_price)))
|
||||
|
||||
self.labelPriceTotal.SetLabel("%s ISK" % formatAmount(total_price, 3, 3, 9, currency=True))
|
||||
self.labelPriceTotal.SetToolTip(wx.ToolTip('{:,.2f}'.format(total_price)))
|
||||
self.labelPriceFittings.SetToolTip(wx.ToolTip('Highs:\t\t{:,.2f} ISK \n'.format(module_slot_price[FittingSlot.HIGH])+
|
||||
'Meds:\t\t{:,.2f} ISK \n'.format(module_slot_price[FittingSlot.MED]) +
|
||||
'Lows:\t\t{:,.2f} ISK \n'.format(module_slot_price[FittingSlot.LOW]) +
|
||||
'Rigs:\t\t{:,.2f} ISK \n'.format(module_slot_price[FittingSlot.RIG]) +
|
||||
'Subsystems:\t{:,.2f} ISK \n'.format(module_slot_price[FittingSlot.SUBSYSTEM])+
|
||||
'Total:\t\t{:,.2f} ISK \n'.format(module_price)))
|
||||
|
||||
self.labelPriceDrones.SetLabel("%s ISK" % formatAmount(drone_price + fighter_price, 3, 3, 9, currency=True))
|
||||
self.labelPriceDrones.SetToolTip(wx.ToolTip('{:,.2f}'.format(drone_price + fighter_price)))
|
||||
self.labelPriceDrones.SetToolTip(wx.ToolTip('{:,.2f} ISK'.format(drone_price + fighter_price)))
|
||||
|
||||
self.labelPriceCargobay.SetLabel("%s ISK" % formatAmount(cargo_price, 3, 3, 9, currency=True))
|
||||
self.labelPriceCargobay.SetToolTip(wx.ToolTip('{:,.2f}'.format(cargo_price)))
|
||||
self.labelPriceCargobay.SetToolTip(wx.ToolTip('{:,.2f} ISK'.format(cargo_price)))
|
||||
|
||||
self.labelPriceCharacter.SetLabel(
|
||||
"%s ISK" % formatAmount(booster_price + implant_price, 3, 3, 9, currency=True))
|
||||
self.labelPriceCharacter.SetToolTip(wx.ToolTip('{:,.2f}'.format(booster_price + implant_price)))
|
||||
self.labelPriceCharacter.SetToolTip(wx.ToolTip('{:,.2f} ISK'.format(booster_price + implant_price)))
|
||||
|
||||
self.labelPriceTotal.SetLabel("%s ISK" % formatAmount(total_price, 3, 3, 9, currency=True))
|
||||
self.labelPriceTotal.SetToolTip(wx.ToolTip('Ship + Modules:\t{:,.2f} ISK \n'.format(ship_price +
|
||||
module_price) +
|
||||
'+ Drones:\t{:,.2f} ISK \n'.format(ship_price +
|
||||
module_price +
|
||||
drone_price +
|
||||
fighter_price) +
|
||||
'+ Cargo:\t\t{:,.2f} ISK \n'.format(ship_price +
|
||||
module_price +
|
||||
drone_price +
|
||||
fighter_price +
|
||||
cargo_price) +
|
||||
'+ Implants:\t{:,.2f} ISK'.format(ship_price +
|
||||
module_price +
|
||||
drone_price +
|
||||
fighter_price +
|
||||
cargo_price +
|
||||
implant_price)))
|
||||
|
||||
|
||||
def processPrices(self, prices):
|
||||
self.refreshPanelPrices(self.fit)
|
||||
|
||||
@@ -24,6 +24,7 @@ from gui.bitmap_loader import BitmapLoader
|
||||
from gui.utils.numberFormatter import formatAmount
|
||||
from service.price import Fit, Price
|
||||
from service.settings import PriceMenuSettings
|
||||
from eos.const import FittingSlot
|
||||
|
||||
|
||||
class PriceViewMinimal(StatsView):
|
||||
@@ -84,6 +85,13 @@ class PriceViewMinimal(StatsView):
|
||||
|
||||
ship_price = 0
|
||||
module_price = 0
|
||||
module_slot_price = {
|
||||
FittingSlot.HIGH: 0,
|
||||
FittingSlot.MED: 0,
|
||||
FittingSlot.LOW: 0,
|
||||
FittingSlot.RIG: 0,
|
||||
FittingSlot.SUBSYSTEM: 0
|
||||
}
|
||||
drone_price = 0
|
||||
fighter_price = 0
|
||||
cargo_price = 0
|
||||
@@ -97,6 +105,8 @@ class PriceViewMinimal(StatsView):
|
||||
for module in fit.modules:
|
||||
if not module.isEmpty:
|
||||
module_price += module.item.price.price
|
||||
if module.slot in module_slot_price:
|
||||
module_slot_price[module.slot] += module.item.price.price
|
||||
|
||||
if fit.drones:
|
||||
for drone in fit.drones:
|
||||
@@ -134,14 +144,34 @@ class PriceViewMinimal(StatsView):
|
||||
total_price += booster_price + implant_price
|
||||
|
||||
self.labelPriceShip.SetLabel("%s ISK" % formatAmount(ship_price, 3, 3, 9, currency=True))
|
||||
self.labelPriceShip.SetToolTip(wx.ToolTip('{:,.2f}'.format(ship_price)))
|
||||
self.labelPriceShip.SetToolTip(wx.ToolTip('{:,.2f} ISK'.format(ship_price)))
|
||||
|
||||
self.labelPriceFittings.SetLabel("%s ISK" % formatAmount(fitting_price, 3, 3, 9, currency=True))
|
||||
self.labelPriceFittings.SetToolTip(wx.ToolTip('{:,.2f}'.format(fitting_price)))
|
||||
self.labelPriceFittings.SetToolTip(wx.ToolTip('Highs:\t\t{:,.2f} ISK \n'.format(module_slot_price[FittingSlot.HIGH])+
|
||||
'Meds:\t\t{:,.2f} ISK \n'.format(module_slot_price[FittingSlot.MED]) +
|
||||
'Lows:\t\t{:,.2f} ISK \n'.format(module_slot_price[FittingSlot.LOW]) +
|
||||
'Rigs:\t\t{:,.2f} ISK \n'.format(module_slot_price[FittingSlot.RIG]) +
|
||||
'Subsystems:\t{:,.2f} ISK \n'.format(module_slot_price[FittingSlot.SUBSYSTEM])+
|
||||
'Total:\t\t{:,.2f} ISK \n'.format(fitting_price)))
|
||||
|
||||
self.labelPriceTotal.SetLabel("%s ISK" % formatAmount(total_price, 3, 3, 9, currency=True))
|
||||
self.labelPriceTotal.SetToolTip(wx.ToolTip('{:,.2f}'.format(total_price)))
|
||||
|
||||
self.labelPriceTotal.SetToolTip(wx.ToolTip('Ship + Modules:\t{:,.2f} ISK \n'.format(ship_price +
|
||||
module_price) +
|
||||
'+ Drones:\t{:,.2f} ISK \n'.format(ship_price +
|
||||
module_price +
|
||||
drone_price +
|
||||
fighter_price) +
|
||||
'+ Cargo:\t\t{:,.2f} ISK \n'.format(ship_price +
|
||||
module_price +
|
||||
drone_price +
|
||||
fighter_price +
|
||||
cargo_price) +
|
||||
'+ Implants:\t{:,.2f} ISK \n'.format(ship_price +
|
||||
module_price +
|
||||
drone_price +
|
||||
fighter_price +
|
||||
cargo_price +
|
||||
implant_price)))
|
||||
def processPrices(self, prices):
|
||||
self.refreshPanelPrices(self.fit)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user