summaryrefslogtreecommitdiff
path: root/editor/scene_tree_dock.h
diff options
context:
space:
mode:
Diffstat (limited to 'editor/scene_tree_dock.h')
-rw-r--r--editor/scene_tree_dock.h42
1 files changed, 33 insertions, 9 deletions
diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h
index 53f31375f8..ece0ca5ca4 100644
--- a/editor/scene_tree_dock.h
+++ b/editor/scene_tree_dock.h
@@ -49,19 +49,22 @@
#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,
TOOL_PASTE,
TOOL_RENAME,
+#ifdef MODULE_REGEX_ENABLED
TOOL_BATCH_RENAME,
+#endif // MODULE_REGEX_ENABLED
TOOL_REPLACE,
TOOL_EXTEND_SCRIPT,
TOOL_ATTACH_SCRIPT,
@@ -104,7 +107,9 @@ class SceneTreeDock : public VBoxContainer {
int current_option;
CreateDialog *create_dialog;
+#ifdef MODULE_REGEX_ENABLED
RenameDialog *rename_dialog;
+#endif // MODULE_REGEX_ENABLED
Button *button_add;
Button *button_instance;
@@ -123,8 +128,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 +143,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 +158,7 @@ class SceneTreeDock : public VBoxContainer {
PopupMenu *menu;
PopupMenu *menu_subresources;
+ PopupMenu *menu_properties;
ConfirmationDialog *clear_inherit_confirm;
bool first_enter;
@@ -160,6 +172,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 +200,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);
@@ -198,8 +214,8 @@ class SceneTreeDock : public VBoxContainer {
void _node_prerenamed(Node *p_node, const String &p_new_name);
void _nodes_drag_begin();
- void _input(Ref<InputEvent> p_event);
- void _unhandled_key_input(Ref<InputEvent> p_event);
+ virtual void input(const Ref<InputEvent> &p_event) override;
+ virtual void unhandled_key_input(const Ref<InputEvent> &p_event) override;
void _import_subscene();
@@ -211,7 +227,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 +240,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);
@@ -247,6 +263,9 @@ class SceneTreeDock : public VBoxContainer {
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();
@@ -254,16 +273,18 @@ protected:
public:
String get_filter();
void set_filter(const String &p_filter);
+ void save_branch_to_file(String p_directory);
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; }
@@ -278,6 +299,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();