Create isCharge property
This commit is contained in:
@@ -476,6 +476,10 @@ class Item(EqBase):
|
|||||||
def getAbyssalYypes(cls):
|
def getAbyssalYypes(cls):
|
||||||
cls.ABYSSAL_TYPES = eos.db.getAbyssalTypes()
|
cls.ABYSSAL_TYPES = eos.db.getAbyssalTypes()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def isCharge(self):
|
||||||
|
return self.category.name == "Charge"
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return "Item(ID={}, name={}) at {}".format(
|
return "Item(ID={}, name={}) at {}".format(
|
||||||
self.ID, self.name, hex(id(self))
|
self.ID, self.name, hex(id(self))
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ class GuiModuleAddCommand(wx.Command):
|
|||||||
def Do(self):
|
def Do(self):
|
||||||
success = False
|
success = False
|
||||||
# if we have a position set, try to apply the module to that position
|
# if we have a position set, try to apply the module to that position
|
||||||
|
|
||||||
|
# todo: check to see if item is a charge. if it is, dont try to add module, but instead set amm
|
||||||
if self.new_position:
|
if self.new_position:
|
||||||
success = self.internal_history.Submit(FitReplaceModuleCommand(self.fitID, self.new_position, self.itemID))
|
success = self.internal_history.Submit(FitReplaceModuleCommand(self.fitID, self.new_position, self.itemID))
|
||||||
if not success:
|
if not success:
|
||||||
|
|||||||
@@ -1077,7 +1077,8 @@ class Fit(object):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def isAmmo(itemID):
|
def isAmmo(itemID):
|
||||||
return eos.db.getItem(itemID).category.name == "Charge"
|
# todo: get rid of this form the service, use directly from item
|
||||||
|
return eos.db.getItem(itemID).isCharge
|
||||||
|
|
||||||
@deprecated
|
@deprecated
|
||||||
def setAmmo(self, fitID, ammoID, modules, recalc=True):
|
def setAmmo(self, fitID, ammoID, modules, recalc=True):
|
||||||
|
|||||||
Reference in New Issue
Block a user