class-description NEWS COMMUNITY STORE TUTORIALS SIGN UP LOGIN LOGOUT ROKOJORI NEWSLETTER SIGN UP LOGIN LOGOUT NEWS COMMUNITY STORE TUTORIALS TOGGLE FULLSCREEN VOLLBILD AN/AUS ObjectRefCounted EditorDebuggerPlugin
A base class to implement debugger plugins.

EditorDebuggerPlugin provides functions related to the editor side of the debugger.

To interact with the debugger, an instance of this class must be added to the editor via EditorPlugin.add_debugger_plugin().

Once added, the _setup_session() callback will be called for every EditorDebuggerSession available to the plugin, and when new ones are created (the sessions may be inactive during this stage).

You can retrieve the available EditorDebuggerSessions via get_sessions() or get a specific one via get_session().

@tool extends EditorPlugin class ExampleEditorDebugger extends EditorDebuggerPlugin: func _has_capture(capture): # Return true if you wish to handle messages with the prefix "my_plugin:". return capture == "my_plugin" func _capture(message, data, session_id): if message == "my_plugin:ping": get_session(session_id).send_message("my_plugin:echo", data) return true return false func _setup_session(session_id): # Add a new tab in the debugger session UI containing a label. var label = Label.new() label.name = "Example plugin" # Will be used as the tab title. label.text = "Example plugin" var session = get_session(session_id) # Listens to the session started and stopped signals. session.started.connect(func (): print("Session started")) session.stopped.connect(func (): print("Session stopped")) session.add_session_tab(label) var debugger = ExampleEditorDebugger.new() func _enter_tree(): add_debugger_plugin(debugger) func _exit_tree(): remove_debugger_plugin(debugger)

To connect on the running game side, use the EngineDebugger singleton:

extends Node func _ready(): EngineDebugger.register_message_capture("my_plugin", _capture) EngineDebugger.send_message("my_plugin:ping", ["test"]) func _capture(message, data): # Note that the "my_plugin:" prefix is not used here. if message == "echo": prints("Echo received:", data) return true return false
void _breakpoint_set_in_tree<>( Script script=, script:Script=, int line=, line:int=, bool enabled=, enabled:bool=, ):void

Override this method to be notified when a breakpoint is set in the editor.

void _breakpoints_cleared_in_tree<>():void

Override this method to be notified when all breakpoints are cleared in the editor.

bool _capture<>( String message=, message:String=, Array data=, data:Array=, int session_id=, session_id:int=, ):bool

Override this method to process incoming messages. The session_id is the ID of the EditorDebuggerSession that received the message. Use get_session() to retrieve the session. This method should return true if the message is recognized.

void _goto_script_line<>( Script script=, script:Script=, int line=, line:int=, ):void

Override this method to be notified when a breakpoint line has been clicked in the debugger breakpoint panel.

bool _has_capture<>( String capture=, capture:String=, ):bool

Override this method to enable receiving messages from the debugger. If capture is "my_message" then messages starting with "my_message:" will be passed to the _capture() method.

void _setup_session<>( int session_id=, session_id:int=, ):void

Override this method to be notified whenever a new EditorDebuggerSession is created. Note that the session may be inactive during this stage.

EditorDebuggerSession get_session<>( int id=, id:int=, ):EditorDebuggerSession

Returns the EditorDebuggerSession with the given id.

Array get_sessions<>():Array

Returns an array of EditorDebuggerSession currently available to this debugger plugin.

Note: Sessions in the array may be inactive, check their state via EditorDebuggerSession.is_active().




All social media brands are registrated trademarks and belong to their respective owners.





CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
CONTACT IMPRINT TERMS OF USE PRIVACY © ROKOROJI ® 2021 rokojori.com
We are using cookies on this site. Read more... Wir benutzen Cookies auf dieser Seite. Mehr lesen...