Merge pull request #97817 from bruvzg/prop_warn_remove

Partially revert #96780, remove warnings from project/editor settings `_get`.
This commit is contained in:
Rémi Verschelde 2024-10-04 22:43:56 +02:00
commit aaffffcd43
No known key found for this signature in database
GPG Key ID: C3336907360768E1
4 changed files with 54 additions and 62 deletions

View File

@ -348,7 +348,6 @@ bool ProjectSettings::_get(const StringName &p_name, Variant &r_ret) const {
_THREAD_SAFE_METHOD_ _THREAD_SAFE_METHOD_
if (!props.has(p_name)) { if (!props.has(p_name)) {
WARN_PRINT("Property not found: " + String(p_name));
return false; return false;
} }
r_ret = props[p_name].variant; r_ret = props[p_name].variant;

View File

@ -845,29 +845,27 @@ Error ResourceLoaderBinary::load() {
} }
} }
if (ClassDB::has_property(res->get_class_name(), name)) { if (value.get_type() == Variant::ARRAY) {
if (value.get_type() == Variant::ARRAY) { Array set_array = value;
Array set_array = value; bool is_get_valid = false;
bool is_get_valid = false; Variant get_value = res->get(name, &is_get_valid);
Variant get_value = res->get(name, &is_get_valid); if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
if (is_get_valid && get_value.get_type() == Variant::ARRAY) { Array get_array = get_value;
Array get_array = get_value; if (!set_array.is_same_typed(get_array)) {
if (!set_array.is_same_typed(get_array)) { value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
}
} }
} }
}
if (value.get_type() == Variant::DICTIONARY) { if (value.get_type() == Variant::DICTIONARY) {
Dictionary set_dict = value; Dictionary set_dict = value;
bool is_get_valid = false; bool is_get_valid = false;
Variant get_value = res->get(name, &is_get_valid); Variant get_value = res->get(name, &is_get_valid);
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) { if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
Dictionary get_dict = get_value; Dictionary get_dict = get_value;
if (!set_dict.is_same_typed(get_dict)) { if (!set_dict.is_same_typed(get_dict)) {
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(), value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script()); get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
}
} }
} }
} }

View File

@ -221,7 +221,6 @@ bool EditorSettings::_get(const StringName &p_name, Variant &r_ret) const {
const VariantContainer *v = props.getptr(p_name); const VariantContainer *v = props.getptr(p_name);
if (!v) { if (!v) {
WARN_PRINT("EditorSettings::_get - Property not found: " + String(p_name));
return false; return false;
} }
r_ret = v->variant; r_ret = v->variant;

View File

@ -612,29 +612,27 @@ Error ResourceLoaderText::load() {
} }
} }
if (ClassDB::has_property(res->get_class_name(), assign)) { if (value.get_type() == Variant::ARRAY) {
if (value.get_type() == Variant::ARRAY) { Array set_array = value;
Array set_array = value; bool is_get_valid = false;
bool is_get_valid = false; Variant get_value = res->get(assign, &is_get_valid);
Variant get_value = res->get(assign, &is_get_valid); if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
if (is_get_valid && get_value.get_type() == Variant::ARRAY) { Array get_array = get_value;
Array get_array = get_value; if (!set_array.is_same_typed(get_array)) {
if (!set_array.is_same_typed(get_array)) { value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
}
} }
} }
}
if (value.get_type() == Variant::DICTIONARY) { if (value.get_type() == Variant::DICTIONARY) {
Dictionary set_dict = value; Dictionary set_dict = value;
bool is_get_valid = false; bool is_get_valid = false;
Variant get_value = res->get(assign, &is_get_valid); Variant get_value = res->get(assign, &is_get_valid);
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) { if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
Dictionary get_dict = get_value; Dictionary get_dict = get_value;
if (!set_dict.is_same_typed(get_dict)) { if (!set_dict.is_same_typed(get_dict)) {
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(), value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script()); get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
}
} }
} }
} }
@ -754,29 +752,27 @@ Error ResourceLoaderText::load() {
} }
} }
if (ClassDB::has_property(resource->get_class_name(), assign)) { if (value.get_type() == Variant::ARRAY) {
if (value.get_type() == Variant::ARRAY) { Array set_array = value;
Array set_array = value; bool is_get_valid = false;
bool is_get_valid = false; Variant get_value = resource->get(assign, &is_get_valid);
Variant get_value = resource->get(assign, &is_get_valid); if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
if (is_get_valid && get_value.get_type() == Variant::ARRAY) { Array get_array = get_value;
Array get_array = get_value; if (!set_array.is_same_typed(get_array)) {
if (!set_array.is_same_typed(get_array)) { value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
}
} }
} }
}
if (value.get_type() == Variant::DICTIONARY) { if (value.get_type() == Variant::DICTIONARY) {
Dictionary set_dict = value; Dictionary set_dict = value;
bool is_get_valid = false; bool is_get_valid = false;
Variant get_value = resource->get(assign, &is_get_valid); Variant get_value = resource->get(assign, &is_get_valid);
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) { if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
Dictionary get_dict = get_value; Dictionary get_dict = get_value;
if (!set_dict.is_same_typed(get_dict)) { if (!set_dict.is_same_typed(get_dict)) {
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(), value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script()); get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
}
} }
} }
} }