Add Embed Game Window hotkeys support and pause/next frame shortcuts

This commit is contained in:
Gustavo Jaruga Cruz 2025-04-25 02:36:00 -03:00
parent 28089c40c1
commit bf18021462
6 changed files with 88 additions and 0 deletions

View file

@ -905,6 +905,14 @@ void ScriptEditorDebugger::_msg_window_title(uint64_t p_thread_id, const Array &
emit_signal(SNAME("remote_window_title_changed"), p_data[0]);
}
void ScriptEditorDebugger::_msg_embed_suspend_toggle(uint64_t p_thread_id, const Array &p_data) {
emit_signal(SNAME("embed_shortcut_requested"), EMBED_SUSPEND_TOGGLE);
}
void ScriptEditorDebugger::_msg_embed_next_frame(uint64_t p_thread_id, const Array &p_data) {
emit_signal(SNAME("embed_shortcut_requested"), EMBED_NEXT_FRAME);
}
void ScriptEditorDebugger::_parse_message(const String &p_msg, uint64_t p_thread_id, const Array &p_data) {
emit_signal(SNAME("debug_data"), p_msg, p_data);
@ -953,6 +961,8 @@ void ScriptEditorDebugger::_init_parse_message_handlers() {
parse_message_handlers["filesystem:update_file"] = &ScriptEditorDebugger::_msg_filesystem_update_file;
parse_message_handlers["evaluation_return"] = &ScriptEditorDebugger::_msg_evaluation_return;
parse_message_handlers["window:title"] = &ScriptEditorDebugger::_msg_window_title;
parse_message_handlers["request_embed_suspend_toggle"] = &ScriptEditorDebugger::_msg_embed_suspend_toggle;
parse_message_handlers["request_embed_next_frame"] = &ScriptEditorDebugger::_msg_embed_next_frame;
}
void ScriptEditorDebugger::_set_reason_text(const String &p_reason, MessageType p_type) {
@ -1894,6 +1904,7 @@ void ScriptEditorDebugger::_bind_methods() {
ADD_SIGNAL(MethodInfo("set_breakpoint", PropertyInfo("script"), PropertyInfo(Variant::INT, "line"), PropertyInfo(Variant::BOOL, "enabled")));
ADD_SIGNAL(MethodInfo("clear_breakpoints"));
ADD_SIGNAL(MethodInfo("errors_cleared"));
ADD_SIGNAL(MethodInfo("embed_shortcut_requested", PropertyInfo(Variant::INT, "embed_shortcut_action")));
}
void ScriptEditorDebugger::add_debugger_tab(Control *p_control) {