Add code for drone splitting, lacking a little amount selection popup

atm
This commit is contained in:
cncfanatics
2010-10-21 16:47:22 +02:00
parent b76a793661
commit 774ac5cf8a
4 changed files with 46 additions and 4 deletions

View File

@@ -206,6 +206,23 @@ class Fit(object):
else:
return False
def splitDroneStack(self, fitID, d, amount):
if fitID == None:
return False
fit = eos.db.getFit(fitID)
total = d.amount
active = d.amountActive > 0
d.amount = amount
d.amountActive = amount if active else 0
newD = eos.types.Drone(d.item)
newD.amount = total - amount
newD.amountActive = newD.amount if active else 0
fit.drones.append(newD)
eos.db.commit()
def removeDrone(self, fitID, i):
fit = eos.db.getFit(fitID)
d = fit.drones[i]