You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
No more metadata and dependency indices kept in resources saved.
-Node folding is now saved externally together with the properties -External resources remember their ID when scenes are saved.
This commit is contained in:
@@ -363,6 +363,26 @@ bool Resource::is_translation_remapped() const {
|
||||
return remapped_list.in_list();
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
//helps keep IDs same number when loading/saving scenes. -1 clears ID and it Returns -1 when no id stored
|
||||
void Resource::set_id_for_path(const String &p_path, int p_id) {
|
||||
if (p_id == -1) {
|
||||
id_for_path.erase(p_path);
|
||||
} else {
|
||||
id_for_path[p_path] = p_id;
|
||||
}
|
||||
}
|
||||
|
||||
int Resource::get_id_for_path(const String &p_path) const {
|
||||
|
||||
if (id_for_path.has(p_path)) {
|
||||
return id_for_path[p_path];
|
||||
} else {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void Resource::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_path", "path"), &Resource::_set_path);
|
||||
|
||||
Reference in New Issue
Block a user