Pass main item argument to context menu definitions
This commit is contained in:
@@ -12,7 +12,7 @@ class DroneAddStack(ContextMenu):
|
||||
self.mainFrame = gui.mainFrame.MainFrame.getInstance()
|
||||
self.settings = ContextMenuSettings.getInstance()
|
||||
|
||||
def display(self, srcContext, selection):
|
||||
def display(self, srcContext, mainItem, selection):
|
||||
if srcContext not in ('marketItemGroup', 'marketItemMisc'):
|
||||
return False
|
||||
|
||||
@@ -32,11 +32,11 @@ class DroneAddStack(ContextMenu):
|
||||
self.amount = amount
|
||||
return True
|
||||
|
||||
def getText(self, itmContext, selection):
|
||||
def getText(self, itmContext, mainItem, selection):
|
||||
return 'Add {} to Drone Bay{}'.format(
|
||||
itmContext, '' if self.amount == 1 else ' (x{})'.format(self.amount))
|
||||
|
||||
def activate(self, fullContext, selection, i):
|
||||
def activate(self, fullContext, mainItem, selection, i):
|
||||
self.mainFrame.command.Submit(cmd.GuiAddLocalDroneCommand(
|
||||
fitID=self.mainFrame.getActiveFit(),
|
||||
itemID=int(selection[0].ID),
|
||||
|
||||
Reference in New Issue
Block a user