コード例 #1
0
    def activate(self, callingWindow, fullContext, mainItem, i):
        fitID = self.mainFrame.getActiveFit()
        typeID = int(mainItem.ID)

        if mainItem.marketGroup.name == "Scan Probes":
            command = cmd.GuiAddCargoCommand(fitID=fitID, itemID=typeID, amount=8)
        else:
            command = cmd.GuiAddCargoCommand(fitID=fitID, itemID=typeID, amount=1000)
        
        if self.mainFrame.command.Submit(command):
            self.mainFrame.additionsPane.select("Cargo", focus=False)
コード例 #2
0
    def activate(self, fullContext, selection, i):
        fitID = self.mainFrame.getActiveFit()

        typeID = int(selection[0].ID)

        self.mainFrame.command.Submit(cmd.GuiAddCargoCommand(fitID, typeID, 1))
        self.mainFrame.additionsPane.select("Cargo")
コード例 #3
0
ファイル: cargoView.py プロジェクト: m-sasha/PyfaAT
    def handleListDrag(self, x, y, data):
        """
        Handles dragging of items from various pyfa displays which support it

        data is list with two indices:
            data[0] is hard-coded str of originating source
            data[1] is typeID or index of data we want to manipulate
        """

        if data[0] == "fitting":
            self.swapModule(x, y, int(data[1]))
        elif data[0] == "market":
            self.mainFrame.command.Submit(
                cmd.GuiAddCargoCommand(self.mainFrame.getActiveFit(),
                                       int(data[1])))
コード例 #4
0
ファイル: cargoView.py プロジェクト: bsmr/pyfa-org-Pyfa
    def addItem(self, event):
        item = Market.getInstance().getItem(event.itemID, eager='group')
        if item is None or not item.isCharge:
            event.Skip()
            return

        fitID = self.mainFrame.getActiveFit()
        fit = Fit.getInstance().getFit(fitID)

        if not fit:
            event.Skip()
            return
        modifiers = wx.GetMouseState().GetModifiers()
        amount = 1
        if modifiers == wx.MOD_CONTROL:
            amount = 10
        elif modifiers == wx.MOD_ALT:
            amount = 100
        elif modifiers == wx.MOD_CONTROL | wx.MOD_ALT:
            amount = 1000
        self.mainFrame.command.Submit(cmd.GuiAddCargoCommand(
            fitID=fitID, itemID=item.ID, amount=amount))
        self.mainFrame.additionsPane.select('Cargo')
        event.Skip()
コード例 #5
0
ファイル: cargoAdd.py プロジェクト: zzwpower/Pyfa
 def activate(self, callingWindow, fullContext, mainItem, i):
     fitID = self.mainFrame.getActiveFit()
     typeID = int(mainItem.ID)
     command = cmd.GuiAddCargoCommand(fitID=fitID, itemID=typeID, amount=1)
     if self.mainFrame.command.Submit(command):
         self.mainFrame.additionsPane.select("Cargo", focus=False)