diff --git a/gui/builtinPreferenceViews/pyfaStatViewPreferences.py b/gui/builtinPreferenceViews/pyfaStatViewPreferences.py index e9e0d8cb0..ae123df5f 100644 --- a/gui/builtinPreferenceViews/pyfaStatViewPreferences.py +++ b/gui/builtinPreferenceViews/pyfaStatViewPreferences.py @@ -3,7 +3,7 @@ import wx from gui.preferenceView import PreferenceView from gui.bitmap_loader import BitmapLoader -from service.settings import StatViewSettings +from service.settings import StatViewSettings, PriceMenuSettings class PFStatViewPref(PreferenceView): @@ -12,6 +12,7 @@ class PFStatViewPref(PreferenceView): def __init__(self): self.dirtySettings = False self.settings = StatViewSettings.getInstance() + self.priceSettings = PriceMenuSettings.getInstance() def refreshPanel(self, fit): pass @@ -99,6 +100,28 @@ class PFStatViewPref(PreferenceView): self.rbOutgoing.SetSelection(self.settings.get('outgoing')) rbSizerRow3.Add(self.rbOutgoing, 1, wx.TOP | wx.RIGHT, 5) self.rbOutgoing.Bind(wx.EVT_RADIOBOX, self.OnOutgoingChange) + + self.tbTotalPriceBox = wx.StaticBoxSizer(wx.VERTICAL, panel, "Total Price Includes") + self.tbTotalPriceDrones = wx.CheckBox(panel, -1, "Drones", wx.DefaultPosition, wx.DefaultSize, 1) + self.tbTotalPriceDrones.SetValue(self.priceSettings.get("drones")) + self.tbTotalPriceCargo = wx.CheckBox(panel, -1, "Cargo", wx.DefaultPosition, wx.DefaultSize, 1) + self.tbTotalPriceCargo.SetValue(self.priceSettings.get("cargo")) + self.tbTotalPriceImplant = wx.CheckBox(panel, -1, "Implants", wx.DefaultPosition, wx.DefaultSize, 1) + self.tbTotalPriceImplant.SetValue(self.priceSettings.get("character")) #TODO: Value sometimes loaded wrong + self.tbTotalPriceBox.AddSpacer(5) + self.tbTotalPriceBox.Add(self.tbTotalPriceDrones) + self.tbTotalPriceBox.AddSpacer(10) + self.tbTotalPriceBox.Add(self.tbTotalPriceCargo) + self.tbTotalPriceBox.AddSpacer(10) + self.tbTotalPriceBox.Add(self.tbTotalPriceImplant) + self.tbTotalPriceBox.RecalcSizes() + rbSizerRow3.Add(self.tbTotalPriceBox, 1, wx.TOP | wx.RIGHT, 5) + self.tbTotalPriceDrones.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceDroneChange) + self.tbTotalPriceCargo.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceCargoChange) + self.tbTotalPriceImplant.Bind(wx.EVT_CHECKBOX, self.OnTotalPriceImplantChange) + + mainSizer.Add(rbSizerRow3, 1, wx.ALL | wx.EXPAND, 0) + # We don't have views for these.....yet ''' self.rbMining = wx.RadioBox(panel, -1, "Mining", wx.DefaultPosition, wx.DefaultSize, @@ -114,8 +137,6 @@ class PFStatViewPref(PreferenceView): self.rbDrones.Bind(wx.EVT_RADIOBOX, self.OnDroneChange) ''' - mainSizer.Add(rbSizerRow3, 1, wx.ALL | wx.EXPAND, 0) - panel.SetSizer(mainSizer) panel.Layout() @@ -149,6 +170,16 @@ class PFStatViewPref(PreferenceView): def OnDroneChange(self, event): self.settings.set('drones', event.GetInt()) + def OnTotalPriceDroneChange(self, event): + self.priceSettings.set('drones', event.GetInt()) + + def OnTotalPriceCargoChange(self, event): + self.priceSettings.set('cargo', event.GetInt()) + + def OnTotalPriceImplantChange(self, event): + self.priceSettings.set('character', event.GetInt()) + + def getImage(self): return BitmapLoader.getBitmap("settings_stats", "gui") diff --git a/gui/builtinStatsViews/priceViewFull.py b/gui/builtinStatsViews/priceViewFull.py index 92aea617f..853adcbac 100644 --- a/gui/builtinStatsViews/priceViewFull.py +++ b/gui/builtinStatsViews/priceViewFull.py @@ -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) diff --git a/gui/builtinStatsViews/priceViewMinimal.py b/gui/builtinStatsViews/priceViewMinimal.py index 4506f2686..133e1667d 100644 --- a/gui/builtinStatsViews/priceViewMinimal.py +++ b/gui/builtinStatsViews/priceViewMinimal.py @@ -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)