Add option which controls ammo switcher behavior

This commit is contained in:
DarkPhoenix
2019-04-18 11:34:16 +03:00
parent 9261d29ac1
commit f9fd265280
3 changed files with 22 additions and 4 deletions

View File

@@ -220,9 +220,11 @@ class ChangeModuleAmmo(ContextMenu):
return
fitID = self.mainFrame.getActiveFit()
# Set to all modules if ctrl is pressed
if wx.GetMouseState().CmdDown():
fit = Fit.getInstance().getFit(fitID)
sFit = Fit.getInstance()
switchAll = sFit.serviceFittingOptions['ammoChangeAll'] is not wx.GetMouseState().CmdDown()
# Switch in selection or all modules, depending on ctrl key state and settings
if switchAll:
fit = sFit.getFit(fitID)
selectedModule = self.modules[0]
if self.context == 'fittingModule':
self.mainFrame.command.Submit(cmd.GuiChangeLocalModuleChargesCommand(