def activate(self, callingWindow, fullContext, mainItem, i): command = cmd.GuiAddLocalDroneCommand( fitID=self.mainFrame.getActiveFit(), itemID=int(mainItem.ID), amount=self.amount) if self.mainFrame.command.Submit(command): self.mainFrame.additionsPane.select('Drones', focus=False)
def addItem(self, event): item = Market.getInstance().getItem(event.itemID, eager='group.category') if item is None or not item.isDrone: event.Skip() return fitID = self.mainFrame.getActiveFit() fit = Fit.getInstance().getFit(fitID) if not fit or fit.isStructure: event.Skip() return amount = droneStackLimit(fit, event.itemID) if wx.GetMouseState().GetModifiers() == wx.MOD_ALT else 1 if self.mainFrame.command.Submit(cmd.GuiAddLocalDroneCommand(fitID=fitID, itemID=event.itemID, amount=amount)): self.mainFrame.additionsPane.select('Drones') event.Skip()
def addItem(self, event): item = Market.getInstance().getItem(event.itemID, eager='group.category') if item is None or not item.isDrone: event.Skip() return fitID = self.mainFrame.getActiveFit() fit = Fit.getInstance().getFit(fitID) if not fit or fit.isStructure: event.Skip() return if self.mainFrame.command.Submit( cmd.GuiAddLocalDroneCommand(fitID=fitID, itemID=event.itemID, amount=1)): self.mainFrame.additionsPane.select('Drones') event.Skip()
def activate(self, fullContext, selection, i): self.mainFrame.command.Submit( cmd.GuiAddLocalDroneCommand(fitID=self.mainFrame.getActiveFit(), itemID=int(selection[0].ID), amount=self.amount)) self.mainFrame.additionsPane.select('Drones')