diff --git a/eos b/eos index 592c9e046..bbb44a979 160000 --- a/eos +++ b/eos @@ -1 +1 @@ -Subproject commit 592c9e046a8f08a537c14fa965527600312a176a +Subproject commit bbb44a9798e8a41d8e4e2e47f945ffd5fefcf85f diff --git a/gui/builtinContextMenus/itemStats.py b/gui/builtinContextMenus/itemStats.py index b56a07d1d..9cfe69545 100644 --- a/gui/builtinContextMenus/itemStats.py +++ b/gui/builtinContextMenus/itemStats.py @@ -10,14 +10,16 @@ class ItemStats(ContextMenu): def display(self, context, selection): return context in ("item", "ship", "module", "ammo", "skill", "itemSearch", "drone", "implant", "booster", - "projectedModule", "projectedDrone") + "projectedModule", "projectedDrone", "projectedAmmo") def getText(self, context, selection): return "%s stats" % (context.capitalize() if context not in self.REPLACES else self.REPLACES[context]) REPLACES = {"itemSearch": "Item", "projectedModule": "Module", - "projectedDrone": "Drone"} + "projectedDrone": "Drone", + "projectedAmmo": "Ammo"} + def activate(self, context, selection, i): if context == "ship": fitID = self.mainFrame.getActiveFit() diff --git a/gui/builtinContextMenus/marketJump.py b/gui/builtinContextMenus/marketJump.py index 85147ebd5..2237e8c93 100644 --- a/gui/builtinContextMenus/marketJump.py +++ b/gui/builtinContextMenus/marketJump.py @@ -8,16 +8,20 @@ class MarketJump(ContextMenu): self.mainFrame = gui.mainFrame.MainFrame.getInstance() def display(self, context, selection): - return context in ("module", "ammo", "itemSearch", "drone", "implant", "booster") \ + return context in ("module", "ammo", "itemSearch", "drone", "implant", "booster", "projectedModule", "projectedDrone") \ and (not selection[0].isEmpty if context == "module" else True) + REPLACES = {"itemSearch": "Item", + "projectedModule": "Module", + "projectedDrone": "Drone"} + def getText(self, context, selection): - return "Jump to %s Market Group" % (context.capitalize() if context != "itemSearch" else "Item") + return "Jump to %s Market Group" % (context.capitalize() if context not in self.REPLACES else self.REPLACES[context]) def activate(self, context, selection, i): - if context in ("module", "drone", "implant", "booster"): + if context in ("module", "drone", "implant", "booster", "projectedModule", "projectedDrone"): item = selection[0].item - elif context == "ammo": + elif context in ("ammo", "projectedAmmo"): item = selection[0].charge else: item = selection[0] diff --git a/gui/itemStats.py b/gui/itemStats.py index 445f01d8b..e070b5a97 100644 --- a/gui/itemStats.py +++ b/gui/itemStats.py @@ -43,7 +43,7 @@ class ItemStatsDialog(wx.Dialog): self.Destroy() return - item = getattr(victim, "item", None) if context != "ammo" else getattr(victim, "charge", None) + item = getattr(victim, "item", None) if context.lower() not in ("projectedammo", "ammo") else getattr(victim, "charge", None) if item is None: sMarket = service.Market.getInstance() item = sMarket.getItem(victim.ID) diff --git a/gui/projectedView.py b/gui/projectedView.py index ca99d0de0..0125d5e2a 100644 --- a/gui/projectedView.py +++ b/gui/projectedView.py @@ -98,13 +98,16 @@ class ProjectedView(d.Display): wx.PostEvent(self.mainFrame, fv.FitChanged(fitID=fitID)) elif event.Button == 3: if isinstance(item, eos.types.Drone): - context = "projectedDrone" + context = ("projectedDrone",) elif isinstance(item, eos.types.Module): - context = "projectedModule" + if item.charge is not None: + context = ("projectedModule", "projectedAmmo") + else: + context = ("projectedModule",) else: - context = "projectedFit" + context = ("projectedFit",) - menu = ContextMenu.getMenu((item,), context) + menu = ContextMenu.getMenu((item,), *context) self.PopupMenu(menu) def remove(self, event):