summaryrefslogtreecommitdiff
path: root/editor/doc/doc_data.cpp
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-01-22 18:26:32 +0100
committerGitHub <noreply@github.com>2020-01-22 18:26:32 +0100
commit40e41e22540c9b88b5afa1d9eb586bc8ae392d58 (patch)
treef8ed2c37884421abe880307ae1f0cf50a50f9667 /editor/doc/doc_data.cpp
parent7ffc3ec6be38042db63b154b9aadb09ae810b699 (diff)
parent387ee7d763df51b0d5f9311c0068abef7bd11257 (diff)
Merge pull request #35435 from bojidar-bg/34154-project-setting-properties
Get real default values for project settings in documentation
Diffstat (limited to 'editor/doc/doc_data.cpp')
-rw-r--r--editor/doc/doc_data.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/editor/doc/doc_data.cpp b/editor/doc/doc_data.cpp
index ea9bf508f1..f9f8761247 100644
--- a/editor/doc/doc_data.cpp
+++ b/editor/doc/doc_data.cpp
@@ -280,13 +280,27 @@ void DocData::generate(bool p_basic_types) {
prop.overridden = inherited;
bool default_value_valid = false;
- Variant default_value = get_documentation_default_value(name, E->get().name, default_value_valid);
+ Variant default_value;
- if (inherited) {
- bool base_default_value_valid = false;
- Variant base_default_value = get_documentation_default_value(ClassDB::get_parent_class(name), E->get().name, base_default_value_valid);
- if (!default_value_valid || !base_default_value_valid || default_value == base_default_value)
+ if (name == "ProjectSettings") {
+ // Special case for project settings, so that settings are not taken from the current project's settings
+ if (E->get().name == "script" ||
+ ProjectSettings::get_singleton()->get_order(E->get().name) >= ProjectSettings::NO_BUILTIN_ORDER_BASE) {
continue;
+ }
+ if (E->get().usage & PROPERTY_USAGE_EDITOR) {
+ default_value = ProjectSettings::get_singleton()->property_get_revert(E->get().name);
+ default_value_valid = true;
+ }
+ } else {
+ default_value = get_documentation_default_value(name, E->get().name, default_value_valid);
+
+ if (inherited) {
+ bool base_default_value_valid = false;
+ Variant base_default_value = get_documentation_default_value(ClassDB::get_parent_class(name), E->get().name, base_default_value_valid);
+ if (!default_value_valid || !base_default_value_valid || default_value == base_default_value)
+ continue;
+ }
}
if (default_value_valid && default_value.get_type() != Variant::OBJECT) {