Multiple scene editing *POTENTIALLY UNSTABLE*
-ability to edit multiple scenes at the same time -resource internal IDs are now persistent, this makes multiple scene editing possible but maaaaay result in file corruption bugs (tested and could not find anything but possibility exists because core code changed, report immediately if you find this). -properly save settings, layout, etc when edited -script editing is independent from scene editing now -show a yellow box when a script belongs to the scene
This commit is contained in:
parent
37af8b4136
commit
e9bbb97acc
37 changed files with 1268 additions and 284 deletions
|
|
@ -34,6 +34,7 @@
|
|||
#include "core_string_names.h"
|
||||
#include "translation.h"
|
||||
#include "os/os.h"
|
||||
#include "resource.h"
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
|
||||
|
|
@ -1464,6 +1465,63 @@ StringName Object::tr(const StringName& p_message) const {
|
|||
|
||||
}
|
||||
|
||||
|
||||
void Object::_clear_internal_resource_paths(const Variant &p_var) {
|
||||
|
||||
switch(p_var.get_type()) {
|
||||
|
||||
case Variant::OBJECT: {
|
||||
|
||||
RES r = p_var;
|
||||
if (!r.is_valid())
|
||||
return;
|
||||
|
||||
if (!r->get_path().begins_with("res://") || r->get_path().find("::")==-1)
|
||||
return; //not an internal resource
|
||||
|
||||
Object *object=p_var;
|
||||
if (!object)
|
||||
return;
|
||||
|
||||
r->set_path("");
|
||||
r->clear_internal_resource_paths();
|
||||
} break;
|
||||
case Variant::ARRAY: {
|
||||
|
||||
Array a=p_var;
|
||||
for(int i=0;i<a.size();i++) {
|
||||
_clear_internal_resource_paths(a[i]);
|
||||
}
|
||||
|
||||
} break;
|
||||
case Variant::DICTIONARY: {
|
||||
|
||||
Dictionary d=p_var;
|
||||
List<Variant> keys;
|
||||
d.get_key_list(&keys);
|
||||
|
||||
for (List<Variant>::Element *E=keys.front();E;E=E->next()) {
|
||||
|
||||
_clear_internal_resource_paths(E->get());
|
||||
_clear_internal_resource_paths(d[E->get()]);
|
||||
}
|
||||
} break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void Object::clear_internal_resource_paths() {
|
||||
|
||||
List<PropertyInfo> pinfo;
|
||||
|
||||
get_property_list(&pinfo);
|
||||
|
||||
for(List<PropertyInfo>::Element *E=pinfo.front();E;E=E->next()) {
|
||||
|
||||
_clear_internal_resource_paths(get(E->get().name));
|
||||
}
|
||||
}
|
||||
|
||||
void Object::_bind_methods() {
|
||||
|
||||
ObjectTypeDB::bind_method(_MD("get_type"),&Object::get_type);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue