Adds prices to Drone and Cargo bay. Also removed redundant and broken columns in drone bay
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
from gui.viewColumn import ViewColumn
|
from gui.viewColumn import ViewColumn
|
||||||
from gui import bitmapLoader
|
from gui import bitmapLoader
|
||||||
from gui.utils.numberFormatter import formatAmount
|
from gui.utils.numberFormatter import formatAmount
|
||||||
|
from eos.types import Drone, Cargo
|
||||||
import wx
|
import wx
|
||||||
import service
|
import service
|
||||||
|
|
||||||
@@ -37,7 +38,16 @@ class Price(ViewColumn):
|
|||||||
|
|
||||||
sMkt = service.Market.getInstance()
|
sMkt = service.Market.getInstance()
|
||||||
price = sMkt.getPriceNow(stuff.item.ID)
|
price = sMkt.getPriceNow(stuff.item.ID)
|
||||||
return formatAmount(price.price, 3, 3, 9, currency=True) if price and price.price else False
|
|
||||||
|
if not price or not price.price:
|
||||||
|
return False
|
||||||
|
|
||||||
|
price = price.price # Set new price variable with what we need
|
||||||
|
|
||||||
|
if isinstance(stuff, Drone) or isinstance(stuff, Cargo):
|
||||||
|
price *= stuff.amount
|
||||||
|
|
||||||
|
return formatAmount(price, 3, 3, 9, currency=True)
|
||||||
|
|
||||||
def delayedText(self, mod, display, colItem):
|
def delayedText(self, mod, display, colItem):
|
||||||
def callback(requests):
|
def callback(requests):
|
||||||
|
|||||||
@@ -43,7 +43,8 @@ class CargoViewDrop(wx.PyDropTarget):
|
|||||||
class CargoView(d.Display):
|
class CargoView(d.Display):
|
||||||
DEFAULT_COLS = ["Base Icon",
|
DEFAULT_COLS = ["Base Icon",
|
||||||
"Base Name",
|
"Base Name",
|
||||||
"attr:volume"]
|
"attr:volume",
|
||||||
|
"Price"]
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
d.Display.__init__(self, parent, style=wx.LC_SINGLE_SEL | wx.BORDER_NONE)
|
d.Display.__init__(self, parent, style=wx.LC_SINGLE_SEL | wx.BORDER_NONE)
|
||||||
|
|||||||
@@ -41,12 +41,13 @@ class DroneViewDrop(wx.PyDropTarget):
|
|||||||
|
|
||||||
class DroneView(d.Display):
|
class DroneView(d.Display):
|
||||||
DEFAULT_COLS = ["State",
|
DEFAULT_COLS = ["State",
|
||||||
"Base Icon",
|
#"Base Icon",
|
||||||
"Base Name",
|
"Base Name",
|
||||||
"prop:droneDps,droneBandwidth",
|
# "prop:droneDps,droneBandwidth",
|
||||||
"Max Range",
|
"Max Range",
|
||||||
"Miscellanea",
|
"Miscellanea",
|
||||||
"attr:maxVelocity",]
|
"attr:maxVelocity",
|
||||||
|
"Price",]
|
||||||
|
|
||||||
def __init__(self, parent):
|
def __init__(self, parent):
|
||||||
d.Display.__init__(self, parent, style=wx.LC_SINGLE_SEL | wx.BORDER_NONE)
|
d.Display.__init__(self, parent, style=wx.LC_SINGLE_SEL | wx.BORDER_NONE)
|
||||||
|
|||||||
Reference in New Issue
Block a user