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.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/editor/scene_tree_dock.h b/editor/scene_tree_dock.h
index 77e727b2c8..e15865036b 100644
--- a/editor/scene_tree_dock.h
+++ b/editor/scene_tree_dock.h
@@ -33,8 +33,8 @@
#include "editor/create_dialog.h"
#include "editor/editor_data.h"
+#include "editor/editor_quick_open.h"
#include "editor/groups_editor.h"
-#include "editor/quick_open.h"
#include "editor/reparent_dialog.h"
#include "editor/script_create_dialog.h"
#include "scene/animation/animation_player.h"
@@ -105,10 +105,9 @@ class SceneTreeDock : public VBoxContainer {
Vector<ObjectID> subresources;
- bool restore_script_editor_on_drag = false;
bool reset_create_dialog = false;
- int current_option;
+ int current_option = 0;
CreateDialog *create_dialog = nullptr;
#ifdef MODULE_REGEX_ENABLED
RenameDialog *rename_dialog = nullptr;
@@ -138,14 +137,14 @@ class SceneTreeDock : public VBoxContainer {
Node *property_drop_node = nullptr;
String resource_drop_path;
- void _perform_property_drop(Node *p_node, String p_property, RES p_res);
+ void _perform_property_drop(Node *p_node, String p_property, Ref<Resource> p_res);
EditorData *editor_data = nullptr;
EditorSelection *editor_selection = nullptr;
List<Node *> node_clipboard;
String clipboard_source_scene;
- HashMap<String, Map<RES, RES>> clipboard_resource_remap;
+ HashMap<String, HashMap<Ref<Resource>, Ref<Resource>>> clipboard_resource_remap;
ScriptCreateDialog *script_create_dialog = nullptr;
ShaderCreateDialog *shader_create_dialog = nullptr;
@@ -172,6 +171,8 @@ class SceneTreeDock : public VBoxContainer {
void _do_create(Node *p_parent);
Node *scene_root = nullptr;
Node *edited_scene = nullptr;
+ Node *pending_click_select = nullptr;
+ bool tree_clicked = false;
VBoxContainer *create_root_dialog = nullptr;
String selected_favorite_root;
@@ -198,6 +199,7 @@ class SceneTreeDock : public VBoxContainer {
void _load_request(const String &p_path);
void _script_open_request(const Ref<Script> &p_script);
void _push_item(Object *p_object);
+ void _handle_select(Node *p_node);
bool _cyclical_dependency_exists(const String &p_target_scene_path, Node *p_desired_node);
bool _track_inherit(const String &p_target_scene_path, Node *p_desired_node);
@@ -232,7 +234,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, Map<Node *, NodePath> *p_renames);
+ void _fill_path_renames(Vector<StringName> base_path, Vector<StringName> new_base_path, Node *p_node, HashMap<Node *, NodePath> *p_renames);
void _normalize_drop(Node *&to_node, int &to_pos, int p_type);
@@ -258,16 +260,16 @@ class SceneTreeDock : public VBoxContainer {
void _feature_profile_changed();
void _clear_clipboard();
- void _create_remap_for_node(Node *p_node, Map<RES, RES> &r_remap);
- void _create_remap_for_resource(RES p_resource, Map<RES, RES> &r_remap);
+ void _create_remap_for_node(Node *p_node, HashMap<Ref<Resource>, Ref<Resource>> &r_remap);
+ void _create_remap_for_resource(Ref<Resource> p_resource, HashMap<Ref<Resource>, Ref<Resource>> &r_remap);
bool profile_allow_editing = true;
bool profile_allow_script_editing = true;
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;
+ bool _update_node_path(Node *p_root_node, NodePath &r_node_path, HashMap<Node *, NodePath> *p_renames) const;
+ bool _check_node_path_recursive(Node *p_root_node, Variant &r_variant, HashMap<Node *, NodePath> *p_renames) const;
private:
static SceneTreeDock *singleton;
@@ -292,8 +294,8 @@ public:
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, 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);
+ void fill_path_renames(Node *p_node, Node *p_new_parent, HashMap<Node *, NodePath> *p_renames);
+ void perform_node_renames(Node *p_base, HashMap<Node *, NodePath> *p_renames, HashMap<Ref<Animation>, HashSet<int>> *r_rem_anims = nullptr);
SceneTreeEditor *get_tree_editor() { return scene_tree; }
EditorData *get_editor_data() { return editor_data; }
@@ -317,7 +319,9 @@ public:
List<Node *> paste_nodes();
List<Node *> get_node_clipboard() const;
- ScriptCreateDialog *get_script_create_dialog() { return script_create_dialog; }
+ ScriptCreateDialog *get_script_create_dialog() {
+ return script_create_dialog;
+ }
SceneTreeDock(Node *p_scene_root, EditorSelection *p_editor_selection, EditorData &p_editor_data);
~SceneTreeDock();