Do not select cargo/drone tab when adding drones/cargo fails
This commit is contained in:
@@ -32,12 +32,10 @@ class AddToCargo(ContextMenuSingle):
|
|||||||
|
|
||||||
def activate(self, fullContext, mainItem, i):
|
def activate(self, fullContext, mainItem, i):
|
||||||
fitID = self.mainFrame.getActiveFit()
|
fitID = self.mainFrame.getActiveFit()
|
||||||
|
|
||||||
typeID = int(mainItem.ID)
|
typeID = int(mainItem.ID)
|
||||||
|
command = cmd.GuiAddCargoCommand(fitID=fitID, itemID=typeID, amount=1)
|
||||||
self.mainFrame.command.Submit(cmd.GuiAddCargoCommand(
|
if self.mainFrame.command.Submit(command):
|
||||||
fitID=fitID, itemID=typeID, amount=1))
|
self.mainFrame.additionsPane.select("Cargo")
|
||||||
self.mainFrame.additionsPane.select("Cargo")
|
|
||||||
|
|
||||||
|
|
||||||
AddToCargo.register()
|
AddToCargo.register()
|
||||||
|
|||||||
@@ -28,9 +28,9 @@ class AddToCargoAmmo(ContextMenuSingle):
|
|||||||
def activate(self, fullContext, mainItem, i):
|
def activate(self, fullContext, mainItem, i):
|
||||||
fitID = self.mainFrame.getActiveFit()
|
fitID = self.mainFrame.getActiveFit()
|
||||||
typeID = int(mainItem.ID)
|
typeID = int(mainItem.ID)
|
||||||
self.mainFrame.command.Submit(cmd.GuiAddCargoCommand(
|
command = cmd.GuiAddCargoCommand(fitID=fitID, itemID=typeID, amount=1000)
|
||||||
fitID=fitID, itemID=typeID, amount=1000))
|
if self.mainFrame.command.Submit(command):
|
||||||
self.mainFrame.additionsPane.select("Cargo")
|
self.mainFrame.additionsPane.select("Cargo")
|
||||||
|
|
||||||
|
|
||||||
AddToCargoAmmo.register()
|
AddToCargoAmmo.register()
|
||||||
|
|||||||
@@ -39,11 +39,12 @@ class DroneAddStack(ContextMenuSingle):
|
|||||||
itmContext, '' if self.amount == 1 else ' (x{})'.format(self.amount))
|
itmContext, '' if self.amount == 1 else ' (x{})'.format(self.amount))
|
||||||
|
|
||||||
def activate(self, fullContext, mainItem, i):
|
def activate(self, fullContext, mainItem, i):
|
||||||
self.mainFrame.command.Submit(cmd.GuiAddLocalDroneCommand(
|
command = cmd.GuiAddLocalDroneCommand(
|
||||||
fitID=self.mainFrame.getActiveFit(),
|
fitID=self.mainFrame.getActiveFit(),
|
||||||
itemID=int(mainItem.ID),
|
itemID=int(mainItem.ID),
|
||||||
amount=self.amount))
|
amount=self.amount)
|
||||||
self.mainFrame.additionsPane.select('Drones')
|
if self.mainFrame.command.Submit(command):
|
||||||
|
self.mainFrame.additionsPane.select('Drones')
|
||||||
|
|
||||||
|
|
||||||
DroneAddStack.register()
|
DroneAddStack.register()
|
||||||
|
|||||||
Reference in New Issue
Block a user