aboutsummaryrefslogtreecommitdiff
path: root/scene/main/node.h
diff options
context:
space:
mode:
authorPedro J. Estébanez2017-02-20 19:43:26 +0100
committerPedro J. Estébanez2017-02-20 19:43:26 +0100
commitbbbc3a91c91522f435edebc3e45e042d926a37df (patch)
tree8c89bb8f86badbcf384deae574c6a5b81f4bfee0 /scene/main/node.h
parent34b6caa43303c46f178e0375aa50bfaf5ac903e7 (diff)
downloadgodot-bbbc3a91c91522f435edebc3e45e042d926a37df.tar.gz
godot-bbbc3a91c91522f435edebc3e45e042d926a37df.tar.zst
godot-bbbc3a91c91522f435edebc3e45e042d926a37df.zip
Add flags parameter to Node.duplicate()
to decide whether signals, groups and/or scripts should be set in the copied nodes or not; it's default value makes the method work as usual, that is, including everything
Diffstat (limited to '')
-rw-r--r--scene/main/node.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/scene/main/node.h b/scene/main/node.h
index 95de57e14..cf5d65786 100644
--- a/scene/main/node.h
+++ b/scene/main/node.h
@@ -53,6 +53,12 @@ public:
PAUSE_MODE_PROCESS
};
+ enum DuplicateFlags {
+
+ DUPLICATE_SIGNALS=1,
+ DUPLICATE_GROUPS=2,
+ DUPLICATE_SCRIPTS=4
+ };
struct Comparator {
@@ -139,7 +145,7 @@ private:
void _duplicate_signals(const Node* p_original,Node* p_copy) const;
void _duplicate_and_reown(Node* p_new_parent, const Map<Node*,Node*>& p_reown_map) const;
- Node *_duplicate(bool p_use_instancing) const;
+ Node *_duplicate(bool p_use_instancing,int p_flags) const;
Array _get_children() const;
Array _get_groups() const;
@@ -278,7 +284,7 @@ public:
int get_position_in_parent() const;
- Node *duplicate(bool p_use_instancing=false) const;
+ Node *duplicate(bool p_use_instancing=false,int p_flags=DUPLICATE_GROUPS|DUPLICATE_SIGNALS|DUPLICATE_SCRIPTS) const;
Node *duplicate_and_reown(const Map<Node*,Node*>& p_reown_map) const;
//Node *clone_tree() const;