29 #ifndef PACKED_SCENE_H 30 #define PACKED_SCENE_H 33 #include "scene/main/node.h" 51 NO_PARENT_SAVED=0x7FFFFFFF,
76 PackState() { node=-1; }
81 struct ConnectionData {
94 Error _parse_node(
Node *p_owner,
Node *p_node,
int p_parent_idx,
Map<StringName,int> &name_map,
HashMap<Variant,int,VariantHasher> &variant_map,
Map<Node*,int> &node_map,
Map<Node*,int> &nodepath_map);
95 Error _parse_connections(
Node *p_owner,
Node *p_node,
Map<StringName,int> &name_map,
HashMap<Variant,int,VariantHasher> &variant_map,
Map<Node*,int> &node_map,
Map<Node*,int> &nodepath_map);
99 uint64_t last_modified_time;
103 static bool disable_placeholders;
109 static void _bind_methods();
114 FLAG_ID_IS_PATH=(1<<30),
115 TYPE_INSTANCED=0x7FFFFFFF,
116 FLAG_INSTANCE_IS_PLACEHOLDER=(1<<30),
120 static void set_disable_placeholders(
bool p_disable);
122 int find_node_by_path(
const NodePath& p_node)
const;
123 Variant get_property_value(
int p_node,
const StringName& p_property,
bool &found)
const;
124 bool is_node_in_group(
int p_node,
const StringName& p_group)
const;
125 bool is_connection(
int p_node,
const StringName& p_signal,
int p_to_node,
const StringName& p_to_method)
const;
128 void set_bundled_scene(
const Dictionary& p_dictionary);
131 Error pack(
Node *p_scene);
133 void set_path(
const String &p_path);
138 bool can_instance()
const;
139 Node *instance(
bool p_gen_edit_state=
false)
const;
144 int get_node_count()
const;
147 NodePath get_node_path(
int p_idx,
bool p_for_parent=
false)
const;
148 NodePath get_node_owner_path(
int p_idx)
const;
150 String get_node_instance_placeholder(
int p_idx)
const;
151 bool is_node_instance_placeholder(
int p_idx)
const;
154 int get_node_property_count(
int p_idx)
const;
155 StringName get_node_property_name(
int p_idx,
int p_prop)
const;
156 Variant get_node_property_value(
int p_idx,
int p_prop)
const;
158 int get_connection_count()
const;
159 NodePath get_connection_source(
int p_idx)
const;
160 StringName get_connection_signal(
int p_idx)
const;
161 NodePath get_connection_target(
int p_idx)
const;
162 StringName get_connection_method(
int p_idx)
const;
163 int get_connection_flags(
int p_idx)
const;
164 Array get_connection_binds(
int p_idx)
const;
171 int add_value(
const Variant& p_value);
172 int add_node_path(
const NodePath& p_path);
173 int add_node(
int p_parent,
int p_owner,
int p_type,
int p_name,
int p_instance);
174 void add_node_property(
int p_node,
int p_name,
int p_value);
175 void add_node_group(
int p_node,
int p_group);
176 void set_base_scene(
int p_idx);
177 void add_connection(
int p_from,
int p_to,
int p_signal,
int p_method,
int p_flags,
const Vector<int>& p_binds);
178 void add_editable_instance(
const NodePath& p_path);
180 virtual void set_last_modified_time(uint64_t p_time) { last_modified_time=p_time; }
181 uint64_t get_last_modified_time()
const {
return last_modified_time; }
190 RES_BASE_EXTENSION(
"scn");
194 void _set_bundled_scene(
const Dictionary& p_scene);
199 static void _bind_methods();
203 Error pack(
Node *p_scene);
207 bool can_instance()
const;
208 Node *instance(
bool p_gen_edit_state=
false)
const;
210 void recreate_state();
213 virtual void set_path(
const String& p_path,
bool p_take_over=
false);
215 virtual void set_last_modified_time(uint64_t p_time) { state->set_last_modified_time(p_time); }
224 #endif // SCENE_PRELOADER_H
Definition: packed_scene.h:62
Definition: string_db.h:48
Definition: reference.h:40
Definition: packed_scene.h:36
Definition: resource.h:89
Definition: dictionary.h:42
Definition: packed_scene.h:187