mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	Translate main thread name in the editor instead of running project
This commit is contained in:
		
							parent
							
								
									f2cc3f1275
								
							
						
					
					
						commit
						513dbff72b
					
				
					 2 changed files with 5 additions and 2 deletions
				
			
		|  | @ -419,7 +419,7 @@ void RemoteDebugger::debug(bool p_can_continue, bool p_is_error_breakpoint) { | ||||||
| 	msg.push_back(error_str); | 	msg.push_back(error_str); | ||||||
| 	ERR_FAIL_NULL(script_lang); | 	ERR_FAIL_NULL(script_lang); | ||||||
| 	msg.push_back(script_lang->debug_get_stack_level_count() > 0); | 	msg.push_back(script_lang->debug_get_stack_level_count() > 0); | ||||||
| 	msg.push_back(Thread::get_caller_id() == Thread::get_main_id() ? String(RTR("Main Thread")) : itos(Thread::get_caller_id())); | 	msg.push_back(Thread::get_caller_id()); | ||||||
| 	if (allow_focus_steal_fn) { | 	if (allow_focus_steal_fn) { | ||||||
| 		allow_focus_steal_fn(); | 		allow_focus_steal_fn(); | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
|  | @ -329,8 +329,10 @@ void ScriptEditorDebugger::_parse_message(const String &p_msg, uint64_t p_thread | ||||||
| 	if (p_msg == "debug_enter") { | 	if (p_msg == "debug_enter") { | ||||||
| 		ERR_FAIL_COND(p_data.size() != 4); | 		ERR_FAIL_COND(p_data.size() != 4); | ||||||
| 
 | 
 | ||||||
|  | 		const Thread::ID caller_id = p_data[3]; | ||||||
|  | 
 | ||||||
| 		ThreadDebugged td; | 		ThreadDebugged td; | ||||||
| 		td.name = p_data[3]; | 		td.name = (caller_id == Thread::get_main_id()) ? TTR("Main Thread") : itos(caller_id); | ||||||
| 		td.error = p_data[1]; | 		td.error = p_data[1]; | ||||||
| 		td.can_debug = p_data[0]; | 		td.can_debug = p_data[0]; | ||||||
| 		td.has_stackdump = p_data[2]; | 		td.has_stackdump = p_data[2]; | ||||||
|  | @ -1917,6 +1919,7 @@ ScriptEditorDebugger::ScriptEditorDebugger() { | ||||||
| 		thread_hb->add_child(memnew(Label(TTR("Thread:")))); | 		thread_hb->add_child(memnew(Label(TTR("Thread:")))); | ||||||
| 		threads = memnew(OptionButton); | 		threads = memnew(OptionButton); | ||||||
| 		thread_hb->add_child(threads); | 		thread_hb->add_child(threads); | ||||||
|  | 		threads->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED); | ||||||
| 		threads->set_h_size_flags(SIZE_EXPAND_FILL); | 		threads->set_h_size_flags(SIZE_EXPAND_FILL); | ||||||
| 		threads->connect(SceneStringName(item_selected), callable_mp(this, &ScriptEditorDebugger::_select_thread)); | 		threads->connect(SceneStringName(item_selected), callable_mp(this, &ScriptEditorDebugger::_select_thread)); | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Haoyu Qiu
						Haoyu Qiu