Пример #1
0
    def pageChanged(self, event):
        #On windows, we can't use the CHANGING event as its bugged, so we need to RECHECK here
        if event.Selection == self.GetPageCount() - 1:
            selection = self.AddTab()
        else:
            selection = event.Selection
            if "__WXMSW__" in wx.PlatformInfo:
                self.countEvt = 0

        page = self.GetPage(selection)

        if self.countEvt == 0:
            fitID = page.view.activeFitID
            sFit = service.Fit.getInstance()
            sFit.switchFit(fitID)
            if hasattr(page, "type") and page.type == "fit":
                wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
            else:
                wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=None))

        self.countEvt -= 1
        if self.countEvt < 0:
            if "__WXMSW__" not in wx.PlatformInfo:
                self.countEvt = 0
            else:
                self.countEvt = 1
        event.Skip()
Пример #2
0
 def removeItem(self, event):
     row, _ = self.HitTest(event.Position)
     if row != -1:
         fitID = self.mainFrame.getActiveFit()
         cFit = service.Fit.getInstance()
         cFit.removeBooster(fitID, self.GetItemData(row))
         wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
Пример #3
0
 def _merge(self, src, dst):
     dstDrone = self.get(dst)
     if isinstance(dstDrone, eos.types.Drone):
         sFit = service.Fit.getInstance()
         fitID = self.mainFrame.getActiveFit()
         if sFit.mergeDrones(fitID, self.get(src), dstDrone, True):
             wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
Пример #4
0
    def click(self, event):
        event.Skip()
        row, _ = self.HitTest(event.Position)
        if row != -1:
            item = self.get(row)
            col = self.getColumn(event.Position)
            if col == self.getColIndex(State):
                fitID = self.mainFrame.getActiveFit()
                cFit = service.Fit.getInstance()
                cFit.toggleProjected(fitID, item,
                                     "right" if event.Button == 3 else "left")
                wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
            elif event.Button == 3:
                if isinstance(item, eos.types.Drone):
                    context = ("projectedDrone", )
                elif isinstance(item, eos.types.Module):
                    if item.charge is not None:
                        context = ("projectedModule", "projectedAmmo")
                    else:
                        context = ("projectedModule", )
                else:
                    context = ("projectedFit", )

                menu = ContextMenu.getMenu((item, ), *context)
                if menu is not None:
                    self.PopupMenu(menu)
Пример #5
0
    def Destroy(self):
        cFit = service.Fit.getInstance()
        fitID = self.mainFrame.getActiveFit()
        if fitID is not None:
            cFit.clearFit(fitID)
            wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))

        wx.Frame.Destroy(self)
Пример #6
0
 def removeItem(self, event):
     row, _ = self.HitTest(event.Position)
     if row != -1:
         fitID = self.mainFrame.getActiveFit()
         cFit = service.Fit.getInstance()
         implant = self.implants[self.GetItemData(row)]
         cFit.removeImplant(fitID, self.original.index(implant))
         wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
Пример #7
0
    def charChanged(self, event):
        fitID = self.mainFrame.fitMultiSwitch.getActiveFit()
        charID = self.getActiveCharacter()

        cFit = service.Fit.getInstance()
        cFit.changeChar(fitID, charID)

        wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
Пример #8
0
    def addItem(self, event):
        cFit = service.Fit.getInstance()
        fitID = self.mainFrame.getActiveFit()
        trigger = cFit.addImplant(fitID, event.itemID)
        if trigger:
            wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
            self.mainFrame.additionsPane.select("Implants")

        event.Skip()
Пример #9
0
 def remove(self, event):
     row, _ = self.HitTest(event.Position)
     if row != -1:
         col = self.getColumn(event.Position)
         if col != self.getColIndex(State):
             fitID = self.mainFrame.getActiveFit()
             cFit = service.Fit.getInstance()
             cFit.removeProjected(fitID, self.get(row))
             wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
Пример #10
0
 def click(self, event):
     event.Skip()
     row, _ = self.HitTest(event.Position)
     if row != -1:
         col = self.getColumn(event.Position)
         if col == self.getColIndex(State):
             fitID = self.mainFrame.getActiveFit()
             cFit = service.Fit.getInstance()
             cFit.toggleImplant(fitID, row)
             wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
Пример #11
0
 def kbEvent(self,event):
     keycode = event.GetKeyCode()
     if keycode == wx.WXK_DELETE or keycode == wx.WXK_NUMPAD_DELETE:
         fitID = self.mainFrame.getActiveFit()
         cFit = service.Fit.getInstance()
         row = self.GetFirstSelected()
         if row != -1:
             cFit.removeImplant(fitID, self.GetItemData(row))
             row = self.GetNextSelected(row)
             wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
Пример #12
0
 def removeItem(self, event):
     row, _ = self.HitTest(event.Position)
     if row != -1:
         col = self.getColumn(event.Position)
         if col != self.getColIndex(State):
             fitID = self.mainFrame.getActiveFit()
             cFit = service.Fit.getInstance()
             drone = self.drones[self.GetItemData(row)]
             cFit.removeDrone(fitID, self.original.index(drone))
             wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
Пример #13
0
 def click(self, event):
     event.Skip()
     row, _ = self.HitTest(event.Position)
     if row != -1:
         col = self.getColumn(event.Position)
         if col == self.getColIndex(State):
             fitID = self.mainFrame.getActiveFit()
             cFit = service.Fit.getInstance()
             drone = self.drones[row]
             cFit.toggleDrone(fitID, self.original.index(drone))
             wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))
Пример #14
0
 def _merge(self, src, dst):
     sFit = service.Fit.getInstance()
     fitID = self.mainFrame.getActiveFit()
     if sFit.mergeDrones(fitID, self.drones[src], self.drones[dst]):
         wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID))