| 46 | return _t("Apply Mutaplasmid") if not mainItem.isMutated else _t("Revert to {}").format(mainItem.baseItem.name) |
| 47 | |
| 48 | def getSubMenu(self, callingWindow, context, mainItem, rootMenu, i, pitem): |
| 49 | if mainItem.isMutated: |
| 50 | return None |
| 51 | |
| 52 | msw = True if "wxMSW" in wx.PlatformInfo else False |
| 53 | self.skillIds = {} |
| 54 | sub = wx.Menu() |
| 55 | |
| 56 | menu = rootMenu if msw else sub |
| 57 | |
| 58 | for mutaplasmid in sorted(mainItem.item.mutaplasmids, key=nameSorter): |
| 59 | id = ContextMenuSingle.nextID() |
| 60 | self.eventIDs[id] = (mutaplasmid, mainItem) |
| 61 | mItem = wx.MenuItem(menu, id, mutaplasmid.shortName) |
| 62 | menu.Bind(wx.EVT_MENU, self.handleMenu, mItem) |
| 63 | sub.Append(mItem) |
| 64 | |
| 65 | return sub |
| 66 | |
| 67 | def handleMenu(self, event): |
| 68 | mutaplasmid, item = self.eventIDs[event.Id] |