diff options
Diffstat (limited to 'editor/scene_tree_dock.h')
-rw-r--r-- | editor/scene_tree_dock.h | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h index aa62c93cb5..ccdc0a3786 100644 --- a/editor/scene_tree_dock.h +++ b/editor/scene_tree_dock.h @@ -49,13 +49,14 @@ #include "scene_tree_editor.h" class EditorNode; +class ShaderCreateDialog; class SceneTreeDock : public VBoxContainer { GDCLASS(SceneTreeDock, VBoxContainer); enum Tool { TOOL_NEW, - TOOL_INSTANCE, + TOOL_INSTANTIATE, TOOL_EXPAND_COLLAPSE, TOOL_CUT, TOOL_COPY, @@ -123,8 +124,13 @@ class SceneTreeDock : public VBoxContainer { HBoxContainer *tool_hbc; void _tool_selected(int p_tool, bool p_confirm_override = false); + void _property_selected(int p_idx); void _node_collapsed(Object *p_obj); + Node *property_drop_node = nullptr; + String resource_drop_path; + void _perform_property_drop(Node *p_node, String p_property, RES p_res); + EditorData *editor_data; EditorSelection *editor_selection; @@ -133,6 +139,7 @@ class SceneTreeDock : public VBoxContainer { HashMap<String, Map<RES, RES>> clipboard_resource_remap; ScriptCreateDialog *script_create_dialog; + ShaderCreateDialog *shader_create_dialog; AcceptDialog *accept; ConfirmationDialog *delete_dialog; ConfirmationDialog *editable_instance_remove_dialog; @@ -147,6 +154,7 @@ class SceneTreeDock : public VBoxContainer { PopupMenu *menu; PopupMenu *menu_subresources; + PopupMenu *menu_properties; ConfirmationDialog *clear_inherit_confirm; bool first_enter; @@ -160,6 +168,8 @@ class SceneTreeDock : public VBoxContainer { VBoxContainer *create_root_dialog; String selected_favorite_root; + Ref<ShaderMaterial> selected_shader_material; + void _add_children_to_popup(Object *p_obj, int p_depth); void _node_reparent(NodePath p_path, bool p_keep_global_xform); @@ -186,7 +196,9 @@ class SceneTreeDock : public VBoxContainer { void _node_selected(); void _node_renamed(); void _script_created(Ref<Script> p_script); + void _shader_created(Ref<Shader> p_shader); void _script_creation_closed(); + void _shader_creation_closed(); void _delete_confirm(bool p_cut = false); @@ -211,7 +223,7 @@ class SceneTreeDock : public VBoxContainer { void _selection_changed(); void _update_script_button(); - void _fill_path_renames(Vector<StringName> base_path, Vector<StringName> new_base_path, Node *p_node, List<Pair<NodePath, NodePath>> *p_renames); + void _fill_path_renames(Vector<StringName> base_path, Vector<StringName> new_base_path, Node *p_node, Map<Node *, NodePath> *p_renames); void _normalize_drop(Node *&to_node, int &to_pos, int p_type); @@ -224,7 +236,7 @@ class SceneTreeDock : public VBoxContainer { void _filter_changed(const String &p_filter); - void _perform_instance_scenes(const Vector<String> &p_files, Node *parent, int p_pos); + void _perform_instantiate_scenes(const Vector<String> &p_files, Node *parent, int p_pos); void _replace_with_branch_scene(const String &p_file, Node *base); void _file_selected(String p_file); @@ -244,6 +256,12 @@ class SceneTreeDock : public VBoxContainer { bool profile_allow_editing; bool profile_allow_script_editing; + static SceneTreeDock *singleton; + static void _update_configuration_warning(); + + bool _update_node_path(Node *p_root_node, NodePath &r_node_path, Map<Node *, NodePath> *p_renames) const; + bool _check_node_path_recursive(Node *p_root_node, Variant &r_variant, Map<Node *, NodePath> *p_renames) const; + protected: void _notification(int p_what); static void _bind_methods(); @@ -255,12 +273,13 @@ public: void _focus_node(); void import_subscene(); + void add_root_node(Node *p_node); void set_edited_scene(Node *p_scene); - void instance(const String &p_file); - void instance_scenes(const Vector<String> &p_files, Node *p_parent = nullptr); + void instantiate(const String &p_file); + void instantiate_scenes(const Vector<String> &p_files, Node *p_parent = nullptr); void set_selected(Node *p_node, bool p_emit_selected = false); - void fill_path_renames(Node *p_node, Node *p_new_parent, List<Pair<NodePath, NodePath>> *p_renames); - void perform_node_renames(Node *p_base, List<Pair<NodePath, NodePath>> *p_renames, Map<Ref<Animation>, Set<int>> *r_rem_anims = nullptr); + void fill_path_renames(Node *p_node, Node *p_new_parent, Map<Node *, NodePath> *p_renames); + void perform_node_renames(Node *p_base, Map<Node *, NodePath> *p_renames, Map<Ref<Animation>, Set<int>> *r_rem_anims = nullptr); SceneTreeEditor *get_tree_editor() { return scene_tree; } EditorData *get_editor_data() { return editor_data; } @@ -275,6 +294,9 @@ public: void attach_script_to_selected(bool p_extend); void open_script_dialog(Node *p_for_node, bool p_extend); + void attach_shader_to_selected(); + void open_shader_dialog(Ref<ShaderMaterial> &p_for_material); + void open_add_child_dialog(); void open_instance_child_dialog(); |