Implement missing Node & Resource placeholders
Implemented by request of @neikeq to advance in the GDExtension version of Mono. * If a Resource type is missing upon load, it will be remembered together with its data (Unless manually overriden). * If a Node type is missing upon load, it will be also be remembered together with its data (unless deleted). This feature makes working with GDExtension much easier, as it ensures that missing types no longer cause data loss.
This commit is contained in:
parent
d5d86cb26e
commit
0a57f964a3
17 changed files with 630 additions and 58 deletions
|
|
@ -434,15 +434,6 @@ void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid
|
|||
}
|
||||
}
|
||||
|
||||
// Something inside the object... :|
|
||||
bool success = _setv(p_name, p_value);
|
||||
if (success) {
|
||||
if (r_valid) {
|
||||
*r_valid = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
if (script_instance) {
|
||||
bool valid;
|
||||
|
|
@ -456,6 +447,15 @@ void Object::set(const StringName &p_name, const Variant &p_value, bool *r_valid
|
|||
}
|
||||
#endif
|
||||
|
||||
// Something inside the object... :|
|
||||
bool success = _setv(p_name, p_value);
|
||||
if (success) {
|
||||
if (r_valid) {
|
||||
*r_valid = true;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (r_valid) {
|
||||
*r_valid = false;
|
||||
}
|
||||
|
|
@ -518,15 +518,6 @@ Variant Object::get(const StringName &p_name, bool *r_valid) const {
|
|||
return ret;
|
||||
|
||||
} else {
|
||||
// Something inside the object... :|
|
||||
bool success = _getv(p_name, ret);
|
||||
if (success) {
|
||||
if (r_valid) {
|
||||
*r_valid = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
if (script_instance) {
|
||||
bool valid;
|
||||
|
|
@ -539,6 +530,14 @@ Variant Object::get(const StringName &p_name, bool *r_valid) const {
|
|||
}
|
||||
}
|
||||
#endif
|
||||
// Something inside the object... :|
|
||||
bool success = _getv(p_name, ret);
|
||||
if (success) {
|
||||
if (r_valid) {
|
||||
*r_valid = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (r_valid) {
|
||||
*r_valid = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue