Skip to content

Commit 7d46e7d

Browse files
committed
Merge pull request #98379 from timothyqiu/alien-thread
Translate main thread name in the editor instead of running project
2 parents dbed8c3 + 513dbff commit 7d46e7d

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

core/debugger/remote_debugger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ void RemoteDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) {
419419
msg.push_back(error_str);
420420
ERR_FAIL_NULL(script_lang);
421421
msg.push_back(script_lang->debug_get_stack_level_count() > 0);
422-
msg.push_back(Thread::get_caller_id() == Thread::get_main_id() ? String(RTR("Main Thread")) : itos(Thread::get_caller_id()));
422+
msg.push_back(Thread::get_caller_id());
423423
if (allow_focus_steal_fn) {
424424
allow_focus_steal_fn();
425425
}

editor/debugger/script_editor_debugger.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,10 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, uint64_t p_thread
329329
if (p_msg == "debug_enter") {
330330
ERR_FAIL_COND(p_data.size() != 4);
331331

332+
const Thread::ID caller_id = p_data[3];
333+
332334
ThreadDebugged td;
333-
td.name = p_data[3];
335+
td.name = (caller_id == Thread::get_main_id()) ? TTR("Main Thread") : itos(caller_id);
334336
td.error = p_data[1];
335337
td.can_debug = p_data[0];
336338
td.has_stackdump = p_data[2];
@@ -1917,6 +1919,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() {
19171919
thread_hb->add_child(memnew(Label(TTR("Thread:"))));
19181920
threads = memnew(OptionButton);
19191921
thread_hb->add_child(threads);
1922+
threads->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
19201923
threads->set_h_size_flags(SIZE_EXPAND_FILL);
19211924
threads->connect(SceneStringName(item_selected), callable_mp(this, &ScriptEditorDebugger::_select_thread));
19221925

0 commit comments

Comments
 (0)