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

Method handleMode

gui/builtinContextMenus/fighterAbilities.py:59–87  ·  view source on GitHub ↗
(self, event)

Source from the content-addressed store, hash-verified

57 return sub
58
59 def handleMode(self, event):
60 ability = self.abilityIds[event.Id]
61 if ability is False or ability not in self.fighter.abilities:
62 event.Skip()
63 return
64
65 fitID = self.mainFrame.getActiveFit()
66 fit = Fit.getInstance().getFit(fitID)
67 if self.isProjected:
68 container = fit.projectedFighters
69 command = cmd.GuiToggleProjectedFighterAbilityStateCommand
70 else:
71 container = fit.fighters
72 command = cmd.GuiToggleLocalFighterAbilityStateCommand
73 if self.fighter in container:
74 mainPosition = container.index(self.fighter)
75 if wx.GetMouseState().GetModifiers() in (wx.MOD_ALT, wx.MOD_CONTROL):
76 fighters = getSimilarFighters(container, self.fighter)
77 else:
78 fighters = self.selection
79 positions = []
80 for fighter in fighters:
81 if fighter in container:
82 positions.append(container.index(fighter))
83 self.mainFrame.command.Submit(command(
84 fitID=fitID,
85 mainPosition=mainPosition,
86 positions=positions,
87 effectID=ability.effectID))
88
89
90FighterAbilities.register()

Callers

nothing calls this directly

Calls 5

getSimilarFightersFunction · 0.90
getFitMethod · 0.80
getActiveFitMethod · 0.45
getInstanceMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected