You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-26 15:46:23 +00:00
Add support for documenting most editor settings in the class reference
Settings defined in editor plugins are missing (about 100 of them),
but all other settings (about 200 of them) can now be documented in the
EditorSettings class.
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
(cherry picked from commit 63ce655e75)
This commit is contained in:
committed by
Rémi Verschelde
parent
562d7c616d
commit
a53264ab41
@@ -39,6 +39,7 @@
|
||||
#include "core/script_language.h"
|
||||
#include "core/translation.h"
|
||||
#include "core/version.h"
|
||||
#include "editor/editor_settings.h"
|
||||
#include "scene/resources/theme.h"
|
||||
|
||||
static String _get_indent(const String &p_text) {
|
||||
@@ -290,8 +291,15 @@ void DocData::generate(bool p_basic_types) {
|
||||
|
||||
List<PropertyInfo> properties;
|
||||
List<PropertyInfo> own_properties;
|
||||
if (name == "ProjectSettings") {
|
||||
//special case for project settings, so settings can be documented
|
||||
|
||||
// Special case for editor and project settings, so they can be documented.
|
||||
if (name == "EditorSettings") {
|
||||
// We don't create the full blown EditorSettings (+ config file) with `create()`,
|
||||
// instead we just make a local instance to get default values.
|
||||
Ref<EditorSettings> edset = memnew(EditorSettings);
|
||||
edset->get_property_list(&properties);
|
||||
own_properties = properties;
|
||||
} else if (name == "ProjectSettings") {
|
||||
ProjectSettings::get_singleton()->get_property_list(&properties);
|
||||
own_properties = properties;
|
||||
} else {
|
||||
@@ -326,6 +334,13 @@ void DocData::generate(bool p_basic_types) {
|
||||
bool default_value_valid = false;
|
||||
Variant default_value;
|
||||
|
||||
if (name == "EditorSettings") {
|
||||
if (E->get().name == "resource_local_to_scene" || E->get().name == "resource_name" || E->get().name == "resource_path" || E->get().name == "script") {
|
||||
// Don't include spurious properties in the generated EditorSettings class reference.
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
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" ||
|
||||
|
||||
Reference in New Issue
Block a user