MCPcopy Index your code
hub / github.com/pyfa-org/Pyfa / spawnMenu

Method spawnMenu

gui/builtinAdditionPanes/implantView.py:289–313  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

287 event.Skip()
288
289 def spawnMenu(self, event):
290 clickedPos = self.getRowByAbs(event.Position)
291 self.ensureSelection(clickedPos)
292
293 selection = self.getSelectedImplants()
294 mainImplant = None
295 if clickedPos != -1:
296 try:
297 implant = self.implants[clickedPos]
298 except IndexError:
299 pass
300 else:
301 if implant in self.original:
302 mainImplant = implant
303 fitID = self.mainFrame.getActiveFit()
304 fit = Fit.getInstance().getFit(fitID)
305 sourceContext1 = "implantItem" if fit.implantSource == ImplantLocation.FIT else "implantItemChar"
306 sourceContext2 = "implantItemMisc" if fit.implantSource == ImplantLocation.FIT else "implantItemMiscChar"
307 itemContext = None if mainImplant is None else Market.getInstance().getCategoryByItem(mainImplant.item).displayName
308 menu = ContextMenu.getMenu(self, mainImplant, selection,
309 (sourceContext1, itemContext),
310 (sourceContext2, itemContext)
311 )
312 if menu:
313 self.PopupMenu(menu)
314
315 def getSelectedImplants(self):
316 implants = []

Callers

nothing calls this directly

Calls 8

getSelectedImplantsMethod · 0.95
getRowByAbsMethod · 0.80
ensureSelectionMethod · 0.80
getFitMethod · 0.80
getCategoryByItemMethod · 0.80
getMenuMethod · 0.80
getActiveFitMethod · 0.45
getInstanceMethod · 0.45

Tested by

no test coverage detected