mirror of
https://github.com/Sneed-Group/Poodletooth-iLand
synced 2024-12-24 12:12:36 -06:00
added injector
This commit is contained in:
parent
b0ee41b558
commit
c5b3c0de09
1 changed files with 22 additions and 0 deletions
|
@ -18,9 +18,31 @@ from panda3d.core import loadPrcFile
|
||||||
|
|
||||||
|
|
||||||
if __debug__:
|
if __debug__:
|
||||||
|
import wx, sys, threading
|
||||||
|
|
||||||
loadPrcFile('config/general.prc')
|
loadPrcFile('config/general.prc')
|
||||||
loadPrcFile('config/release/dev.prc')
|
loadPrcFile('config/release/dev.prc')
|
||||||
|
|
||||||
|
defaultText = "print('I work!')"
|
||||||
|
|
||||||
|
def __inject_wx(_):
|
||||||
|
code = textbox.GetValue()
|
||||||
|
exec(code, globals())
|
||||||
|
|
||||||
|
def openInjector_wx():
|
||||||
|
app = wx.App(redirect=False)
|
||||||
|
frame = wx.Frame(None, title="Injector", size=(640, 400), style=wx.SYSTEM_MENU | wx.CAPTION | wx.CLOSE_BOX | wx.MINIMIZE_BOX)
|
||||||
|
panel = wx.Panel(frame)
|
||||||
|
button = wx.Button(parent=panel, id=-1, label="Inject", size=(50, 20), pos=(295, 0))
|
||||||
|
global textbox
|
||||||
|
textbox = wx.TextCtrl(parent=panel, id=-1, pos=(20, 22), size=(600, 340), style=wx.TE_MULTILINE)
|
||||||
|
frame.Bind(wx.EVT_BUTTON, __inject_wx, button)
|
||||||
|
frame.Show()
|
||||||
|
app.SetTopWindow(frame)
|
||||||
|
textbox.AppendText(defaultText)
|
||||||
|
threading.Thread(target=app.MainLoop).start()
|
||||||
|
|
||||||
|
openInjector_wx()
|
||||||
|
|
||||||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue