summaryrefslogtreecommitdiff
path: root/editor/doc
diff options
context:
space:
mode:
authorBojidar Marinov <bojidar.marinov.bg@gmail.com>2020-01-22 15:22:21 +0200
committerBojidar Marinov <bojidar.marinov.bg@gmail.com>2020-01-22 15:57:10 +0200
commit387ee7d763df51b0d5f9311c0068abef7bd11257 (patch)
treed538a1ef3cb898b388d98d834629cdf2b58ebd84 /editor/doc
parent829d21f1c223a159f58cc3f30a98a63ce1f3a9d2 (diff)
Get real default values for project settings in documentation
Also, ignore custom project settings and values for input/ entries Fixes #34154
Diffstat (limited to 'editor/doc')
-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) {