From 635e904a581d5fc94d3747f0eb9c35698551600d Mon Sep 17 00:00:00 2001 From: cncfanatics Date: Sat, 4 Sep 2010 21:11:54 +0200 Subject: [PATCH] Change some drone column stuff --- gui/builtinViewColumns/__init__.py | 3 +- gui/builtinViewColumns/droneNameAmount.py | 37 +++++++++++++++++++++++ gui/droneView.py | 2 +- 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 gui/builtinViewColumns/droneNameAmount.py diff --git a/gui/builtinViewColumns/__init__.py b/gui/builtinViewColumns/__init__.py index 7d94387bb..5e476a333 100644 --- a/gui/builtinViewColumns/__init__.py +++ b/gui/builtinViewColumns/__init__.py @@ -1,4 +1,5 @@ -__all__ = ["moduleState", "moduleNameOrSlot", "attributeDisplay", "maxRange", "name", "droneDps"] +__all__ = ["moduleState", "moduleNameOrSlot", "attributeDisplay", "maxRange", + "name", "droneDps", "droneNameAmount"] columns = {} def registerColumn(column): diff --git a/gui/builtinViewColumns/droneNameAmount.py b/gui/builtinViewColumns/droneNameAmount.py new file mode 100644 index 000000000..b483faf96 --- /dev/null +++ b/gui/builtinViewColumns/droneNameAmount.py @@ -0,0 +1,37 @@ +#=============================================================================== +# Copyright (C) 2010 Diego Duclos +# +# This file is part of pyfa. +# +# pyfa is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# pyfa is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with pyfa. If not, see . +#=============================================================================== + +from gui import builtinViewColumns +from gui.viewColumn import ViewColumn +from gui import bitmapLoader +from eos.types import Slot + +class DroneNameAmount(ViewColumn): + name = "Drone Name/Amount" + def __init__(self, fittingView, params): + ViewColumn.__init__(self, fittingView) + self.columnText = "Name" + + def getText(self, drone): + return "%dX %s (%d Active)" % (drone.amount, stuff.item.name, drone.amountActive) + + def getImageId(self, mod): + return -1 + +builtinViewColumns.registerColumn(DroneNameAmount) diff --git a/gui/droneView.py b/gui/droneView.py index 8ee3564b8..0886b5f5a 100644 --- a/gui/droneView.py +++ b/gui/droneView.py @@ -24,7 +24,7 @@ import gui.fittingView as fv import gui.builtinViewColumns.display as d class DroneView(d.Display): - DEFAULT_COLS = ["Name", + DEFAULT_COLS = ["Drone Name/Amount", "Drone DPS", "Max range", "attr:trackingSpeed",