Skip to content

Commit 97ef3c8

Browse files
committed
Merge pull request godotengine#96780 from bruvzg/no_type_ed_settings
[Resource Loader] Do not check property type for non registered properties.
2 parents 444683b + 3009073 commit 97ef3c8

File tree

4 files changed

+64
-54
lines changed

4 files changed

+64
-54
lines changed

core/io/resource_format_binary.cpp

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -845,27 +845,29 @@ Error ResourceLoaderBinary::load() {
845845
}
846846
}
847847

848-
if (value.get_type() == Variant::ARRAY) {
849-
Array set_array = value;
850-
bool is_get_valid = false;
851-
Variant get_value = res->get(name, &is_get_valid);
852-
if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
853-
Array get_array = get_value;
854-
if (!set_array.is_same_typed(get_array)) {
855-
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
848+
if (ClassDB::has_property(res->get_class_name(), name)) {
849+
if (value.get_type() == Variant::ARRAY) {
850+
Array set_array = value;
851+
bool is_get_valid = false;
852+
Variant get_value = res->get(name, &is_get_valid);
853+
if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
854+
Array get_array = get_value;
855+
if (!set_array.is_same_typed(get_array)) {
856+
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
857+
}
856858
}
857859
}
858-
}
859860

860-
if (value.get_type() == Variant::DICTIONARY) {
861-
Dictionary set_dict = value;
862-
bool is_get_valid = false;
863-
Variant get_value = res->get(name, &is_get_valid);
864-
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
865-
Dictionary get_dict = get_value;
866-
if (!set_dict.is_same_typed(get_dict)) {
867-
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
868-
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
861+
if (value.get_type() == Variant::DICTIONARY) {
862+
Dictionary set_dict = value;
863+
bool is_get_valid = false;
864+
Variant get_value = res->get(name, &is_get_valid);
865+
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
866+
Dictionary get_dict = get_value;
867+
if (!set_dict.is_same_typed(get_dict)) {
868+
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
869+
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
870+
}
869871
}
870872
}
871873
}

doc/classes/ProjectSettings.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2947,6 +2947,9 @@
29472947
<member name="xr/openxr/enabled" type="bool" setter="" getter="" default="false">
29482948
If [code]true[/code], Godot will setup and initialize OpenXR on startup.
29492949
</member>
2950+
<member name="xr/openxr/enabled.editor" type="bool" setter="" getter="" default="false">
2951+
If [code]true[/code], Godot will setup and initialize OpenXR on editor startup.
2952+
</member>
29502953
<member name="xr/openxr/environment_blend_mode" type="int" setter="" getter="" default="&quot;0&quot;">
29512954
Specify how OpenXR should blend in the environment. This is specific to certain AR and passthrough devices where camera images are blended in by the XR compositor.
29522955
</member>

main/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2541,6 +2541,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
25412541

25422542
// XR project settings.
25432543
GLOBAL_DEF_RST_BASIC("xr/openxr/enabled", false);
2544+
GLOBAL_DEF_RST_BASIC("xr/openxr/enabled.editor", false);
25442545
GLOBAL_DEF_BASIC(PropertyInfo(Variant::STRING, "xr/openxr/default_action_map", PROPERTY_HINT_FILE, "*.tres"), "res://openxr_action_map.tres");
25452546
GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "xr/openxr/form_factor", PROPERTY_HINT_ENUM, "Head Mounted,Handheld"), "0");
25462547
GLOBAL_DEF_BASIC(PropertyInfo(Variant::INT, "xr/openxr/view_configuration", PROPERTY_HINT_ENUM, "Mono,Stereo"), "1"); // "Mono,Stereo,Quad,Observer"

scene/resources/resource_format_text.cpp

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -612,27 +612,29 @@ Error ResourceLoaderText::load() {
612612
}
613613
}
614614

615-
if (value.get_type() == Variant::ARRAY) {
616-
Array set_array = value;
617-
bool is_get_valid = false;
618-
Variant get_value = res->get(assign, &is_get_valid);
619-
if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
620-
Array get_array = get_value;
621-
if (!set_array.is_same_typed(get_array)) {
622-
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
615+
if (ClassDB::has_property(res->get_class_name(), assign)) {
616+
if (value.get_type() == Variant::ARRAY) {
617+
Array set_array = value;
618+
bool is_get_valid = false;
619+
Variant get_value = res->get(assign, &is_get_valid);
620+
if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
621+
Array get_array = get_value;
622+
if (!set_array.is_same_typed(get_array)) {
623+
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
624+
}
623625
}
624626
}
625-
}
626627

627-
if (value.get_type() == Variant::DICTIONARY) {
628-
Dictionary set_dict = value;
629-
bool is_get_valid = false;
630-
Variant get_value = res->get(assign, &is_get_valid);
631-
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
632-
Dictionary get_dict = get_value;
633-
if (!set_dict.is_same_typed(get_dict)) {
634-
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
635-
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
628+
if (value.get_type() == Variant::DICTIONARY) {
629+
Dictionary set_dict = value;
630+
bool is_get_valid = false;
631+
Variant get_value = res->get(assign, &is_get_valid);
632+
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
633+
Dictionary get_dict = get_value;
634+
if (!set_dict.is_same_typed(get_dict)) {
635+
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
636+
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
637+
}
636638
}
637639
}
638640
}
@@ -752,27 +754,29 @@ Error ResourceLoaderText::load() {
752754
}
753755
}
754756

755-
if (value.get_type() == Variant::ARRAY) {
756-
Array set_array = value;
757-
bool is_get_valid = false;
758-
Variant get_value = resource->get(assign, &is_get_valid);
759-
if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
760-
Array get_array = get_value;
761-
if (!set_array.is_same_typed(get_array)) {
762-
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
757+
if (ClassDB::has_property(resource->get_class_name(), assign)) {
758+
if (value.get_type() == Variant::ARRAY) {
759+
Array set_array = value;
760+
bool is_get_valid = false;
761+
Variant get_value = resource->get(assign, &is_get_valid);
762+
if (is_get_valid && get_value.get_type() == Variant::ARRAY) {
763+
Array get_array = get_value;
764+
if (!set_array.is_same_typed(get_array)) {
765+
value = Array(set_array, get_array.get_typed_builtin(), get_array.get_typed_class_name(), get_array.get_typed_script());
766+
}
763767
}
764768
}
765-
}
766769

767-
if (value.get_type() == Variant::DICTIONARY) {
768-
Dictionary set_dict = value;
769-
bool is_get_valid = false;
770-
Variant get_value = resource->get(assign, &is_get_valid);
771-
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
772-
Dictionary get_dict = get_value;
773-
if (!set_dict.is_same_typed(get_dict)) {
774-
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
775-
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
770+
if (value.get_type() == Variant::DICTIONARY) {
771+
Dictionary set_dict = value;
772+
bool is_get_valid = false;
773+
Variant get_value = resource->get(assign, &is_get_valid);
774+
if (is_get_valid && get_value.get_type() == Variant::DICTIONARY) {
775+
Dictionary get_dict = get_value;
776+
if (!set_dict.is_same_typed(get_dict)) {
777+
value = Dictionary(set_dict, get_dict.get_typed_key_builtin(), get_dict.get_typed_key_class_name(), get_dict.get_typed_key_script(),
778+
get_dict.get_typed_value_builtin(), get_dict.get_typed_value_class_name(), get_dict.get_typed_value_script());
779+
}
776780
}
777781
}
778782
}

0 commit comments

Comments
 (0)