Change how double-clicking ammo behaves

This commit is contained in:
DarkPhoenix
2020-05-04 19:18:14 +03:00
parent 05c2c41762
commit ac7ccfb6a3
2 changed files with 28 additions and 17 deletions

View File

@@ -377,23 +377,7 @@ class FittingView(d.Display):
event.Skip()
return
batchOp = wx.GetMouseState().GetModifiers() == wx.MOD_ALT and getattr(event, 'allowBatch', None) is not False
# If we've selected ammo, then apply to the selected module(s)
if item.isCharge:
positions = []
fit = Fit.getInstance().getFit(fitID)
if batchOp:
for position, mod in enumerate(fit.modules):
if isinstance(mod, Module) and not mod.isEmpty:
positions.append(position)
else:
for mod in self.getSelectedMods():
if mod.isEmpty or mod not in fit.modules:
continue
positions.append(fit.modules.index(mod))
if len(positions) > 0:
self.mainFrame.command.Submit(cmd.GuiChangeLocalModuleChargesCommand(
fitID=fitID, positions=positions, chargeItemID=itemID))
elif (item.isModule and not batchOp) or item.isSubsystem:
if (item.isModule and not batchOp) or item.isSubsystem:
self.mainFrame.command.Submit(cmd.GuiAddLocalModuleCommand(fitID=fitID, itemID=itemID))
elif item.isModule and batchOp:
self.mainFrame.command.Submit(cmd.GuiFillWithNewLocalModulesCommand(fitID=fitID, itemID=itemID))