From e9bbb97acccc08ae03fde41e4cc6d2dc6722021a Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 22 Jun 2015 00:03:19 -0300 Subject: 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 --- core/object.cpp | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) (limited to 'core/object.cpp') diff --git a/core/object.cpp b/core/object.cpp index 83a6dada80..cdb2c6517a 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -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 keys; + d.get_key_list(&keys); + + for (List::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 pinfo; + + get_property_list(&pinfo); + + for(List::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); -- cgit v1.2.3 From 48f1d02da4795ba9d485fe5fe2bea907be2fc467 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Wed, 24 Jun 2015 13:29:23 -0300 Subject: added ability to define signals in script closes #2175 --- core/object.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'core/object.cpp') diff --git a/core/object.cpp b/core/object.cpp index cdb2c6517a..6bb7973cef 100644 --- a/core/object.cpp +++ b/core/object.cpp @@ -1302,6 +1302,10 @@ Array Object::_get_signal_connection_list(const String& p_signal) const{ void Object::get_signal_list(List *p_signals ) const { + if (!script.is_null()) { + Ref