Adds prices to Drone and Cargo bay. Also removed redundant and broken columns in drone bay

This commit is contained in:
blitzmann
2014-08-08 10:46:58 -04:00
parent 356c741e54
commit 1315f8d8ed
3 changed files with 17 additions and 5 deletions

View File

@@ -20,6 +20,7 @@
from gui.viewColumn import ViewColumn
from gui import bitmapLoader
from gui.utils.numberFormatter import formatAmount
from eos.types import Drone, Cargo
import wx
import service
@@ -37,7 +38,16 @@ class Price(ViewColumn):
sMkt = service.Market.getInstance()
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 callback(requests):

View File

@@ -43,7 +43,8 @@ class CargoViewDrop(wx.PyDropTarget):
class CargoView(d.Display):
DEFAULT_COLS = ["Base Icon",
"Base Name",
"attr:volume"]
"attr:volume",
"Price"]
def __init__(self, parent):
d.Display.__init__(self, parent, style=wx.LC_SINGLE_SEL | wx.BORDER_NONE)

View File

@@ -41,12 +41,13 @@ class DroneViewDrop(wx.PyDropTarget):
class DroneView(d.Display):
DEFAULT_COLS = ["State",
"Base Icon",
#"Base Icon",
"Base Name",
"prop:droneDps,droneBandwidth",
# "prop:droneDps,droneBandwidth",
"Max Range",
"Miscellanea",
"attr:maxVelocity",]
"attr:maxVelocity",
"Price",]
def __init__(self, parent):
d.Display.__init__(self, parent, style=wx.LC_SINGLE_SEL | wx.BORDER_NONE)