mirror of
				https://github.com/godotengine/godot.git
				synced 2025-10-31 13:41:03 +00:00 
			
		
		
		
	EditorPlugin can request user inputs from editor 3d view
This commit is contained in:
		
							parent
							
								
									d4e64e0e60
								
							
						
					
					
						commit
						d8b65b1657
					
				
					 5 changed files with 38 additions and 5 deletions
				
			
		|  | @ -6069,6 +6069,7 @@ EditorNode::EditorNode() { | |||
| 
 | ||||
| 	editor_plugin_screen = NULL; | ||||
| 	editor_plugins_over = memnew(EditorPluginList); | ||||
| 	editor_plugins_force_input_forwarding = memnew(EditorPluginList); | ||||
| 
 | ||||
| 	//force_top_viewport(true);
 | ||||
| 	_edit_current(); | ||||
|  | @ -6217,6 +6218,7 @@ EditorNode::~EditorNode() { | |||
| 	memdelete(EditorHelp::get_doc_data()); | ||||
| 	memdelete(editor_selection); | ||||
| 	memdelete(editor_plugins_over); | ||||
| 	memdelete(editor_plugins_force_input_forwarding); | ||||
| 	memdelete(file_server); | ||||
| 	EditorSettings::destroy(); | ||||
| } | ||||
|  | @ -6252,10 +6254,14 @@ bool EditorPluginList::forward_gui_input(const Transform2D &p_canvas_xform, cons | |||
| 	return discard; | ||||
| } | ||||
| 
 | ||||
| bool EditorPluginList::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event) { | ||||
| bool EditorPluginList::forward_spatial_gui_input(Camera *p_camera, const Ref<InputEvent> &p_event, bool serve_when_force_input_enabled) { | ||||
| 	bool discard = false; | ||||
| 
 | ||||
| 	for (int i = 0; i < plugins_list.size(); i++) { | ||||
| 		if ((!serve_when_force_input_enabled) && plugins_list[i]->is_input_event_forwarding_always_enabled()) { | ||||
| 			continue; | ||||
| 		} | ||||
| 
 | ||||
| 		if (plugins_list[i]->forward_spatial_gui_input(p_camera, p_event)) { | ||||
| 			discard = true; | ||||
| 		} | ||||
|  | @ -6271,6 +6277,10 @@ void EditorPluginList::forward_draw_over_canvas(const Transform2D &p_canvas_xfor | |||
| 	} | ||||
| } | ||||
| 
 | ||||
| void EditorPluginList::add_plugin(EditorPlugin *p_plugin) { | ||||
| 	plugins_list.push_back(p_plugin); | ||||
| } | ||||
| 
 | ||||
| bool EditorPluginList::empty() { | ||||
| 	return plugins_list.empty(); | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Unknown
						Unknown