Merge pull request #103841 from GustJc/embed_add_hotkeys

Add Embed Game Window shortcut hotkeys support for `suspend/pause` and `next frame` buttons
This commit is contained in:
Thaddeus Crews 2025-04-27 19:21:16 -05:00
commit 69f0eb5de5
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
6 changed files with 88 additions and 0 deletions

View file

@ -915,6 +915,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);
@ -963,6 +971,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) {
@ -1905,6 +1915,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) {