Implement implant set application in character implants.

This commit is contained in:
blitzmann
2016-03-20 23:45:42 -04:00
parent d4632b9059
commit 94f73241ea
4 changed files with 54 additions and 11 deletions

View File

@@ -460,6 +460,11 @@ class ImplantEditorView(BaseImplantEditorView):
def __init__(self, parent):
BaseImplantEditorView.__init__ (self, parent)
if "__WXGTK__" in wx.PlatformInfo:
self.pluggedImplantsTree.Bind(wx.EVT_RIGHT_UP, self.scheduleMenu)
else:
self.pluggedImplantsTree.Bind(wx.EVT_RIGHT_DOWN, self.scheduleMenu)
def bindContext(self):
self.Parent.Parent.Bind(GE.CHAR_CHANGED, self.contextChanged)
@@ -481,6 +486,17 @@ class ImplantEditorView(BaseImplantEditorView):
sChar.removeImplant(charID, self.implants[pos])
def scheduleMenu(self, event):
event.Skip()
wx.CallAfter(self.spawnMenu)
def spawnMenu(self):
context = (("implantEditor",),)
# fuck good coding practices, passing a pointer to the character editor here for [reasons] =D
# (see implantSets context class for info)
menu = ContextMenu.getMenu((self.Parent.Parent,), *context)
self.PopupMenu(menu)
class APIView (wx.Panel):
def __init__(self, parent):