diff options
Diffstat (limited to 'scene/main/node.h')
-rw-r--r-- | scene/main/node.h | 47 |
1 files changed, 34 insertions, 13 deletions
diff --git a/scene/main/node.h b/scene/main/node.h index 4d0a84d347..87fa4dd6ca 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -38,6 +38,7 @@ class Viewport; +class SceneState; class Node : public Object { OBJ_TYPE( Node, Object ); @@ -69,9 +70,10 @@ private: struct Data { String filename; - Dictionary instance_state; - Vector<StringName> instance_groups; - Vector<Connection> instance_connections; + Ref<SceneState> instance_state; + Ref<SceneState> inherited_state; + + HashMap<NodePath,int> editable_instances; Node *parent; Node *owner; @@ -96,6 +98,7 @@ private: PauseMode pause_mode; Node *pause_owner; // variables used to properly sort the node when processing, ignored otherwise + //should move all the stuff below to bits bool fixed_process; bool idle_process; @@ -105,6 +108,9 @@ private: bool parent_owned; bool in_constructor; + bool use_placeholder; + + } data; @@ -112,6 +118,8 @@ private: virtual bool _use_builtin_script() const { return true; } Node *_get_node(const NodePath& p_path) const; + Node *_get_child_by_name(const StringName& p_name) const; + void _validate_child_name(Node *p_name); @@ -126,6 +134,7 @@ private: void _propagate_pause_owner(Node*p_owner); Array _get_node_and_resource(const NodePath& p_path); + 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; Array _get_children() const; Array _get_groups() const; @@ -149,7 +158,7 @@ protected: static void _bind_methods(); -friend class PackedScene; +friend class SceneState; void _add_child_nocheck(Node* p_child,const StringName& p_name); void _set_owner_nocheck(Node* p_owner); @@ -185,6 +194,7 @@ public: Node *get_child(int p_index) const; bool has_node(const NodePath& p_path) const; Node *get_node(const NodePath& p_path) const; + Node* find_node(const String& p_mask,bool p_recursive=true,bool p_owned=true) const; bool has_node_and_resource(const NodePath& p_path) const; Node *get_node_and_resource(const NodePath& p_path,RES& r_res) const; @@ -205,7 +215,7 @@ public: struct GroupInfo { - String name; + StringName name; bool persistent; }; @@ -226,7 +236,11 @@ public: void set_filename(const String& p_filename); String get_filename() const; - + + void set_editable_instance(Node* p_node,bool p_editable); + bool is_editable_instance(Node* p_node) const; + + /* NOTIFICATIONS */ void propagate_notification(int p_notification); @@ -252,15 +266,20 @@ public: int get_position_in_parent() const; - Node *duplicate() const; + Node *duplicate(bool p_use_instancing=false) const; Node *duplicate_and_reown(const Map<Node*,Node*>& p_reown_map) const; + //Node *clone_tree() const; // used by editors, to save what has changed only - void generate_instance_state(); - Dictionary get_instance_state() const; - Vector<StringName> get_instance_groups() const; - Vector<Connection> get_instance_connections() const; + void set_scene_instance_state(const Ref<SceneState>& p_state); + Ref<SceneState> get_scene_instance_state() const; + + void set_scene_inherited_state(const Ref<SceneState>& p_state); + Ref<SceneState> get_scene_inherited_state() const; + + void set_scene_instance_load_placeholder(bool p_enable); + bool get_scene_instance_load_placeholder() const; static Vector<Variant> make_binds(VARIANT_ARG_LIST); @@ -272,6 +291,8 @@ public: static void print_stray_nodes(); + String validate_child_name(const String& p_name) const; + void queue_delete(); //shitty hacks for speed @@ -287,6 +308,8 @@ public: void get_argument_options(const StringName& p_function,int p_idx,List<String>*r_options) const; + void clear_internal_tree_resource_paths(); + _FORCE_INLINE_ Viewport *get_viewport() const { return data.viewport; } /* CANVAS */ @@ -299,6 +322,4 @@ public: typedef Set<Node*,Node::Comparator> NodeSet; - - #endif |