From b3992f7e6edb76a1d7e757efcab79a50425972f7 Mon Sep 17 00:00:00 2001 From: Yuri Sizov Date: Thu, 2 Dec 2021 22:38:49 +0300 Subject: Make overridden properties link to parent definition Co-authored-by: Josh DeGraw --- core/doc_data.h | 1 + doc/classes/AcceptDialog.xml | 10 +++--- doc/classes/AnimationNodeStateMachinePlayback.xml | 2 +- doc/classes/BaseButton.xml | 2 +- doc/classes/ButtonGroup.xml | 2 +- doc/classes/CheckBox.xml | 4 +-- doc/classes/CheckButton.xml | 4 +-- doc/classes/CodeEdit.xml | 4 +-- doc/classes/ColorPickerButton.xml | 2 +- doc/classes/ConfirmationDialog.xml | 6 ++-- doc/classes/Container.xml | 2 +- doc/classes/DirectionalLight3D.xml | 2 +- doc/classes/EditorCommandPalette.xml | 2 +- doc/classes/EditorFileDialog.xml | 4 +-- doc/classes/EditorInspector.xml | 2 +- doc/classes/EditorSpinSlider.xml | 2 +- doc/classes/FileDialog.xml | 4 +-- doc/classes/GraphEdit.xml | 4 +-- doc/classes/GraphNode.xml | 2 +- doc/classes/ItemList.xml | 4 +-- doc/classes/Label.xml | 4 +-- doc/classes/LineEdit.xml | 4 +-- doc/classes/LinkButton.xml | 4 +-- doc/classes/MenuButton.xml | 8 ++--- doc/classes/NinePatchRect.xml | 2 +- doc/classes/OptionButton.xml | 6 ++-- doc/classes/PanelContainer.xml | 2 +- doc/classes/ParallaxBackground.xml | 2 +- doc/classes/PhysicsBody2D.xml | 2 +- doc/classes/Popup.xml | 10 +++--- doc/classes/ProgressBar.xml | 4 +-- doc/classes/RichTextLabel.xml | 2 +- doc/classes/ScriptCreateDialog.xml | 4 +-- doc/classes/ScrollBar.xml | 4 +-- doc/classes/ScrollContainer.xml | 2 +- doc/classes/Slider.xml | 4 +-- doc/classes/SpotLight3D.xml | 2 +- doc/classes/TextEdit.xml | 4 +-- doc/classes/TextureProgressBar.xml | 2 +- doc/classes/TextureRect.xml | 2 +- doc/classes/Tree.xml | 4 +-- doc/classes/VScrollBar.xml | 4 +-- doc/classes/VSlider.xml | 4 +-- doc/classes/VehicleBody3D.xml | 2 +- doc/classes/ViewportTexture.xml | 2 +- doc/tools/make_rst.py | 19 ++++++----- editor/doc_tools.cpp | 12 +++++-- editor/editor_help.cpp | 39 ++++++++++++++++++---- .../mobile_vr/doc_classes/MobileVRInterface.xml | 2 +- 49 files changed, 130 insertions(+), 97 deletions(-) diff --git a/core/doc_data.h b/core/doc_data.h index 27ea098513..db83dda8aa 100644 --- a/core/doc_data.h +++ b/core/doc_data.h @@ -123,6 +123,7 @@ public: String setter, getter; String default_value; bool overridden = false; + String overrides; bool operator<(const PropertyDoc &p_prop) const { return name < p_prop.name; } diff --git a/doc/classes/AcceptDialog.xml b/doc/classes/AcceptDialog.xml index df0cc6f268..8fa4e9a309 100644 --- a/doc/classes/AcceptDialog.xml +++ b/doc/classes/AcceptDialog.xml @@ -68,11 +68,11 @@ The text displayed by the dialog. - - - - - + + + + + diff --git a/doc/classes/AnimationNodeStateMachinePlayback.xml b/doc/classes/AnimationNodeStateMachinePlayback.xml index b299f8654a..48507471e9 100644 --- a/doc/classes/AnimationNodeStateMachinePlayback.xml +++ b/doc/classes/AnimationNodeStateMachinePlayback.xml @@ -72,6 +72,6 @@ - + diff --git a/doc/classes/BaseButton.xml b/doc/classes/BaseButton.xml index 981b3167d9..1b77a5b4d8 100644 --- a/doc/classes/BaseButton.xml +++ b/doc/classes/BaseButton.xml @@ -57,7 +57,7 @@ If [code]true[/code], the button is in disabled state and can't be clicked or toggled. - + If [code]true[/code], the button stays pressed when moving the cursor outside the button while pressing it. [b]Note:[/b] This property only affects the button's visual appearance. Signals will be emitted at the same moment regardless of this property's value. diff --git a/doc/classes/ButtonGroup.xml b/doc/classes/ButtonGroup.xml index 9229e69fa7..e3e781ac10 100644 --- a/doc/classes/ButtonGroup.xml +++ b/doc/classes/ButtonGroup.xml @@ -24,7 +24,7 @@ - + diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 4604b952d7..7dddacf3c9 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -10,8 +10,8 @@ - - + + diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index d880656d0a..c0315b93be 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -10,8 +10,8 @@ - - + + diff --git a/doc/classes/CodeEdit.xml b/doc/classes/CodeEdit.xml index 4f42f2adbb..04c3d73357 100644 --- a/doc/classes/CodeEdit.xml +++ b/doc/classes/CodeEdit.xml @@ -487,7 +487,7 @@ Use spaces instead of tabs for indentation. - + Sets whether line folding is allowed. @@ -497,7 +497,7 @@ Set when a validated word from [signal symbol_validate] is clicked, the [signal symbol_lookup] should be emitted. - + diff --git a/doc/classes/ColorPickerButton.xml b/doc/classes/ColorPickerButton.xml index 351591b24d..2f78b10660 100644 --- a/doc/classes/ColorPickerButton.xml +++ b/doc/classes/ColorPickerButton.xml @@ -35,7 +35,7 @@ If [code]true[/code], the alpha channel in the displayed [ColorPicker] will be visible. - + diff --git a/doc/classes/ConfirmationDialog.xml b/doc/classes/ConfirmationDialog.xml index c4bdaf436d..bf4210ac98 100644 --- a/doc/classes/ConfirmationDialog.xml +++ b/doc/classes/ConfirmationDialog.xml @@ -27,8 +27,8 @@ - - - + + + diff --git a/doc/classes/Container.xml b/doc/classes/Container.xml index 24e73534d3..83655425fc 100644 --- a/doc/classes/Container.xml +++ b/doc/classes/Container.xml @@ -26,7 +26,7 @@ - + diff --git a/doc/classes/DirectionalLight3D.xml b/doc/classes/DirectionalLight3D.xml index 661dbef07c..74450c311e 100644 --- a/doc/classes/DirectionalLight3D.xml +++ b/doc/classes/DirectionalLight3D.xml @@ -34,7 +34,7 @@ The distance from shadow split 2 to split 3. Relative to [member directional_shadow_max_distance]. Only used when [member directional_shadow_mode] is [constant SHADOW_PARALLEL_4_SPLITS]. - + If [code]true[/code], this [DirectionalLight3D] will not be used for anything except sky shaders. Use this for lights that impact your sky shader that you may want to hide from affecting the rest of the scene. For example, you may want to enable this when the sun in your sky shader falls below the horizon. diff --git a/doc/classes/EditorCommandPalette.xml b/doc/classes/EditorCommandPalette.xml index 01b8593f89..28f51228ca 100644 --- a/doc/classes/EditorCommandPalette.xml +++ b/doc/classes/EditorCommandPalette.xml @@ -49,6 +49,6 @@ - + diff --git a/doc/classes/EditorFileDialog.xml b/doc/classes/EditorFileDialog.xml index 79758281ac..1d2146348a 100644 --- a/doc/classes/EditorFileDialog.xml +++ b/doc/classes/EditorFileDialog.xml @@ -49,7 +49,7 @@ The file system path in the address bar. - + If [code]true[/code], the [EditorFileDialog] will not warn the user before overwriting files. @@ -62,7 +62,7 @@ If [code]true[/code], hidden files and directories will be visible in the [EditorFileDialog]. - + diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml index 0c47298180..46cebbd795 100644 --- a/doc/classes/EditorInspector.xml +++ b/doc/classes/EditorInspector.xml @@ -10,7 +10,7 @@ - + diff --git a/doc/classes/EditorSpinSlider.xml b/doc/classes/EditorSpinSlider.xml index 9341b514c7..9636c33565 100644 --- a/doc/classes/EditorSpinSlider.xml +++ b/doc/classes/EditorSpinSlider.xml @@ -11,7 +11,7 @@ - + diff --git a/doc/classes/FileDialog.xml b/doc/classes/FileDialog.xml index b3c2d67ef5..1207288159 100644 --- a/doc/classes/FileDialog.xml +++ b/doc/classes/FileDialog.xml @@ -63,7 +63,7 @@ The currently selected file path of the file dialog. - + The dialog's open or save mode, which affects the selection behavior. See [enum FileMode]. @@ -76,7 +76,7 @@ If [code]true[/code], the dialog will show hidden files. - + diff --git a/doc/classes/GraphEdit.xml b/doc/classes/GraphEdit.xml index df599a95c7..76b255e273 100644 --- a/doc/classes/GraphEdit.xml +++ b/doc/classes/GraphEdit.xml @@ -159,7 +159,7 @@ The thickness of the lines between the nodes. - + If [code]true[/code], the minimap is visible. @@ -169,7 +169,7 @@ The size of the minimap rectangle. The map itself is based on the size of the grid area and is scaled to fit this rectangle. - + If [code]true[/code], enables disconnection of existing connections in the GraphEdit by dragging the right end. diff --git a/doc/classes/GraphNode.xml b/doc/classes/GraphNode.xml index 59ae88978e..d5780dce2d 100644 --- a/doc/classes/GraphNode.xml +++ b/doc/classes/GraphNode.xml @@ -218,7 +218,7 @@ Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. - + Sets the overlay shown above the GraphNode. See [enum Overlay]. diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index 647b9aad0b..0626df0414 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -374,7 +374,7 @@ The size all icons will be adjusted to. If either X or Y component is not greater than zero, icon size won't be affected. - + The icon position, whether above or to the left of the text. See the [enum IconMode] constants. @@ -393,7 +393,7 @@ Maximum lines of text allowed in each item. Space will be reserved even when there is not enough lines of text to display. [b]Note:[/b] This property takes effect only when [member icon_mode] is [constant ICON_MODE_TOP]. To make the text wrap, [member fixed_column_width] should be greater than zero. - + Whether all columns will have the same width. If [code]true[/code], the width is equal to the largest column width of all columns. diff --git a/doc/classes/Label.xml b/doc/classes/Label.xml index f25795b7df..bb273bcf48 100644 --- a/doc/classes/Label.xml +++ b/doc/classes/Label.xml @@ -79,11 +79,11 @@ Limits the lines of text the node shows on screen. - + Limits the amount of visible characters. If you set [code]percent_visible[/code] to 0.5, only up to half of the text's characters will display on screen. Useful to animate the text in a dialog box. - + Set BiDi algorithm override for the structured text. diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 614f2fd9e4..40e1057ed0 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -199,7 +199,7 @@ If [code]true[/code], the [LineEdit] don't display decoration. - + Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. @@ -232,7 +232,7 @@ If [code]false[/code], using middle mouse button to paste clipboard will be disabled. [b]Note:[/b] This method is only implemented on Linux. - + Opacity of the [member placeholder_text]. From [code]0[/code] to [code]1[/code]. diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index d70c7393ca..17a9e13842 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -33,11 +33,11 @@ - + Language code used for line-breaking and text shaping algorithms, if left empty current locale is used instead. - + Set BiDi algorithm override for the structured text. diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index 79ca1972ca..93f514cc63 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -27,16 +27,16 @@ - - - + + + The number of items currently in the list. If [code]true[/code], when the cursor hovers above another [MenuButton] within the same parent which also has [code]switch_on_hover[/code] enabled, it will close the current [MenuButton] and open the other one. - + diff --git a/doc/classes/NinePatchRect.xml b/doc/classes/NinePatchRect.xml index 636ed368d1..02144d641e 100644 --- a/doc/classes/NinePatchRect.xml +++ b/doc/classes/NinePatchRect.xml @@ -35,7 +35,7 @@ If [code]true[/code], draw the panel's center. Else, only draw the 9-slice's borders. - + The height of the 9-slice's bottom row. A margin of 16 means the 9-slice's bottom corners and side will have a height of 16 pixels. You can set all 4 margin values individually to create panels with non-uniform borders. diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index 750ab401d1..d914b86a33 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -163,12 +163,12 @@ - - + + The index of the currently selected item, or [code]-1[/code] if no item is selected. - + diff --git a/doc/classes/PanelContainer.xml b/doc/classes/PanelContainer.xml index 95d038e2af..80005cce15 100644 --- a/doc/classes/PanelContainer.xml +++ b/doc/classes/PanelContainer.xml @@ -10,7 +10,7 @@ https://godotengine.org/asset-library/asset/520 - + diff --git a/doc/classes/ParallaxBackground.xml b/doc/classes/ParallaxBackground.xml index 5670660d01..592f12d9d7 100644 --- a/doc/classes/ParallaxBackground.xml +++ b/doc/classes/ParallaxBackground.xml @@ -9,7 +9,7 @@ - + The base position offset for all [ParallaxLayer] children. diff --git a/doc/classes/PhysicsBody2D.xml b/doc/classes/PhysicsBody2D.xml index 08f9de53ca..43e27ea437 100644 --- a/doc/classes/PhysicsBody2D.xml +++ b/doc/classes/PhysicsBody2D.xml @@ -57,6 +57,6 @@ - + diff --git a/doc/classes/Popup.xml b/doc/classes/Popup.xml index a47f72b2b6..dc5dd47287 100644 --- a/doc/classes/Popup.xml +++ b/doc/classes/Popup.xml @@ -9,14 +9,14 @@ - + If [code]true[/code], the [Popup] will close when its parent is focused. - - - - + + + + diff --git a/doc/classes/ProgressBar.xml b/doc/classes/ProgressBar.xml index 763ab6c794..24cc490ce7 100644 --- a/doc/classes/ProgressBar.xml +++ b/doc/classes/ProgressBar.xml @@ -12,8 +12,8 @@ If [code]true[/code], the fill percentage is displayed on the bar. - - + + diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 006b2de341..a74b0ed812 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -399,7 +399,7 @@ The range of characters to display, as a [float] between 0.0 and 1.0. When assigned an out of range value, it's the same as assigning 1.0. [b]Note:[/b] Setting this property updates [member visible_characters] based on current [method get_total_character_count]. - + If [code]true[/code], the scrollbar is visible. Setting this to [code]false[/code] does not block scrolling completely. See [method scroll_to_line]. diff --git a/doc/classes/ScriptCreateDialog.xml b/doc/classes/ScriptCreateDialog.xml index 349adb9111..33ca5b4dc9 100644 --- a/doc/classes/ScriptCreateDialog.xml +++ b/doc/classes/ScriptCreateDialog.xml @@ -39,8 +39,8 @@ - - + + diff --git a/doc/classes/ScrollBar.xml b/doc/classes/ScrollBar.xml index 1f1415bebe..2dcde10616 100644 --- a/doc/classes/ScrollBar.xml +++ b/doc/classes/ScrollBar.xml @@ -12,8 +12,8 @@ Overrides the step used when clicking increment and decrement buttons or when using arrow keys when the [ScrollBar] is focused. - - + + diff --git a/doc/classes/ScrollContainer.xml b/doc/classes/ScrollContainer.xml index 976c32c243..f0c739bfa3 100644 --- a/doc/classes/ScrollContainer.xml +++ b/doc/classes/ScrollContainer.xml @@ -37,7 +37,7 @@ If [code]true[/code], the ScrollContainer will automatically scroll to focused children (including indirect children) to make sure they are fully visible. - + diff --git a/doc/classes/Slider.xml b/doc/classes/Slider.xml index 21a45645b8..41ceb7b8b3 100644 --- a/doc/classes/Slider.xml +++ b/doc/classes/Slider.xml @@ -13,11 +13,11 @@ If [code]true[/code], the slider can be interacted with. If [code]false[/code], the value can be changed only by code. - + If [code]true[/code], the value can be changed using the mouse wheel. - + Number of ticks displayed on the slider, including border ticks. Ticks are uniformly-distributed value markers. diff --git a/doc/classes/SpotLight3D.xml b/doc/classes/SpotLight3D.xml index f9f9a62baa..b5276d25ea 100644 --- a/doc/classes/SpotLight3D.xml +++ b/doc/classes/SpotLight3D.xml @@ -11,7 +11,7 @@ https://godotengine.org/asset-library/asset/678 - + The spotlight's angle in degrees. diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index 0ed37bad34..ffc91decca 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -971,7 +971,7 @@ If [code]false[/code], existing text cannot be modified and new text cannot be added. - + If [code]true[/code], all occurrences of the selected text will be highlighted. @@ -991,7 +991,7 @@ The width, in pixels, of the minimap. - + If [code]true[/code], custom [code]font_selected_color[/code] will be used for selected text. diff --git a/doc/classes/TextureProgressBar.xml b/doc/classes/TextureProgressBar.xml index ee47557b39..25725d2f67 100644 --- a/doc/classes/TextureProgressBar.xml +++ b/doc/classes/TextureProgressBar.xml @@ -27,7 +27,7 @@ The fill direction. See [enum FillMode] for possible values. - + If [code]true[/code], Godot treats the bar's textures like in [NinePatchRect]. Use the [code]stretch_margin_*[/code] properties like [member stretch_margin_bottom] to set up the nine patch's 3×3 grid. When using a radial [member fill_mode], this setting will enable stretching. diff --git a/doc/classes/TextureRect.xml b/doc/classes/TextureRect.xml index 4f18f43ddf..a160eceb35 100644 --- a/doc/classes/TextureRect.xml +++ b/doc/classes/TextureRect.xml @@ -19,7 +19,7 @@ If [code]true[/code], texture is flipped vertically. - + Controls the texture's behavior when resizing the node's bounding rectangle. See [enum StretchMode]. diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index e603d344ec..29c482917b 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -335,14 +335,14 @@ The drop mode as an OR combination of flags. See [enum DropModeFlags] constants. Once dropping is done, reverts to [constant DROP_MODE_DISABLED]. Setting this during [method Control._can_drop_data] is recommended. This controls the drop sections, i.e. the decision and drawing of possible drop locations based on the mouse position. - + If [code]true[/code], the folding arrow is hidden. If [code]true[/code], the tree's root is hidden. - + If [code]true[/code], enables horizontal scrolling. diff --git a/doc/classes/VScrollBar.xml b/doc/classes/VScrollBar.xml index ce78b83c20..09df3411d8 100644 --- a/doc/classes/VScrollBar.xml +++ b/doc/classes/VScrollBar.xml @@ -9,8 +9,8 @@ - - + + diff --git a/doc/classes/VSlider.xml b/doc/classes/VSlider.xml index aa43fac347..c1fea97ddc 100644 --- a/doc/classes/VSlider.xml +++ b/doc/classes/VSlider.xml @@ -10,8 +10,8 @@ - - + + diff --git a/doc/classes/VehicleBody3D.xml b/doc/classes/VehicleBody3D.xml index 9315f6e6ad..9960eeedc2 100644 --- a/doc/classes/VehicleBody3D.xml +++ b/doc/classes/VehicleBody3D.xml @@ -20,7 +20,7 @@ [b]Note:[/b] The simulation does not take the effect of gears into account, you will need to add logic for this if you wish to simulate gears. A negative value will result in the vehicle reversing. - + The steering angle for the vehicle. Setting this to a non-zero value will result in the vehicle turning when it's moving. Wheels that have [member VehicleWheel3D.use_as_steering] set to [code]true[/code] will automatically be rotated. diff --git a/doc/classes/ViewportTexture.xml b/doc/classes/ViewportTexture.xml index c0cf3b3c7b..de32413fdd 100644 --- a/doc/classes/ViewportTexture.xml +++ b/doc/classes/ViewportTexture.xml @@ -14,7 +14,7 @@ https://godotengine.org/asset-library/asset/586 - + The path to the [Viewport] node to display. This is relative to the scene root, not to the node which uses the texture. diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py index b5e5cf8fa7..1523194a85 100755 --- a/doc/tools/make_rst.py +++ b/doc/tools/make_rst.py @@ -40,15 +40,15 @@ class TypeName: class PropertyDef: def __init__( - self, name, type_name, setter, getter, text, default_value, overridden - ): # type: (str, TypeName, Optional[str], Optional[str], Optional[str], Optional[str], Optional[bool]) -> None + self, name, type_name, setter, getter, text, default_value, overrides + ): # type: (str, TypeName, Optional[str], Optional[str], Optional[str], Optional[str], Optional[str]) -> None self.name = name self.type_name = type_name self.setter = setter self.getter = getter self.text = text self.default_value = default_value - self.overridden = overridden + self.overrides = overrides class ParameterDef: @@ -162,10 +162,10 @@ class State: default_value = property.get("default") or None if default_value is not None: default_value = "``{}``".format(default_value) - overridden = property.get("override") or False + overrides = property.get("overrides") or None property_def = PropertyDef( - property_name, type_name, setter, getter, property.text, default_value, overridden + property_name, type_name, setter, getter, property.text, default_value, overrides ) class_def.properties[property_name] = property_def @@ -520,8 +520,9 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S for property_def in class_def.properties.values(): type_rst = property_def.type_name.to_rst(state) default = property_def.default_value - if default is not None and property_def.overridden: - ml.append((type_rst, property_def.name, default + " *(parent override)*")) + if default is not None and property_def.overrides: + ref = ":ref:`{1}`".format(property_def.name, property_def.overrides) + ml.append((type_rst, property_def.name, default + " (overrides " + ref + ")")) else: ref = ":ref:`{0}`".format(property_def.name, class_name) ml.append((type_rst, ref, default)) @@ -624,12 +625,12 @@ def make_rst_class(class_def, state, dry_run, output_dir): # type: (ClassDef, S f.write("\n\n") # Property descriptions - if any(not p.overridden for p in class_def.properties.values()) > 0: + if any(not p.overrides for p in class_def.properties.values()) > 0: f.write(make_heading("Property Descriptions", "-")) index = 0 for property_def in class_def.properties.values(): - if property_def.overridden: + if property_def.overrides: continue if index != 0: diff --git a/editor/doc_tools.cpp b/editor/doc_tools.cpp index f2b08a574f..f1d427648a 100644 --- a/editor/doc_tools.cpp +++ b/editor/doc_tools.cpp @@ -341,11 +341,17 @@ void DocTools::generate(bool p_basic_types) { } DocData::PropertyDoc prop; - prop.name = E.name; - prop.overridden = inherited; + if (inherited) { + String parent = ClassDB::get_parent_class(c.name); + while (!ClassDB::has_property(parent, prop.name, true)) { + parent = ClassDB::get_parent_class(parent); + } + prop.overrides = parent; + } + bool default_value_valid = false; Variant default_value; @@ -1357,7 +1363,7 @@ Error DocTools::save_classes(const String &p_default_path, const Map"); + _write_string(f, 2, ""); } else { _write_string(f, 2, ""); _write_string(f, 3, p.description.strip_edges().xml_escape()); diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 4082dcefbc..c95b1c753e 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -673,7 +673,7 @@ void EditorHelp::_update_doc() { class_desc->add_newline(); class_desc->push_font(doc_code_font); class_desc->push_indent(1); - class_desc->push_table(2); + class_desc->push_table(4); class_desc->set_table_column_expand(1, true); for (int i = 0; i < cd.properties.size(); i++) { @@ -683,13 +683,14 @@ void EditorHelp::_update_doc() { } property_line[cd.properties[i].name] = class_desc->get_line_count() - 2; //gets overridden if description + // Property type. class_desc->push_cell(); class_desc->push_paragraph(RichTextLabel::ALIGN_RIGHT, Control::TEXT_DIRECTION_AUTO, ""); class_desc->push_font(doc_code_font); _add_type(cd.properties[i].type, cd.properties[i].enumeration); class_desc->pop(); class_desc->pop(); - class_desc->pop(); + class_desc->pop(); // cell bool describe = false; @@ -710,6 +711,7 @@ void EditorHelp::_update_doc() { describe = false; } + // Property name. class_desc->push_cell(); class_desc->push_font(doc_code_font); class_desc->push_color(headline_color); @@ -725,18 +727,43 @@ void EditorHelp::_update_doc() { property_descr = true; } + class_desc->pop(); + class_desc->pop(); + class_desc->pop(); // cell + + // Property value. + class_desc->push_cell(); + class_desc->push_font(doc_code_font); + if (cd.properties[i].default_value != "") { class_desc->push_color(symbol_color); - class_desc->add_text(cd.properties[i].overridden ? " [" + TTR("override:") + " " : " [" + TTR("default:") + " "); + if (cd.properties[i].overridden) { + class_desc->add_text(" ["); + class_desc->push_meta("@member " + cd.properties[i].overrides + "." + cd.properties[i].name); + _add_text(vformat(TTR("overrides %s:"), cd.properties[i].overrides)); + class_desc->pop(); + class_desc->add_text(" "); + } else { + class_desc->add_text(" [" + TTR("default:") + " "); + } class_desc->pop(); + class_desc->push_color(value_color); _add_text(_fix_constant(cd.properties[i].default_value)); class_desc->pop(); + class_desc->push_color(symbol_color); class_desc->add_text("]"); class_desc->pop(); } + class_desc->pop(); + class_desc->pop(); // cell + + // Property setters and getters. + class_desc->push_cell(); + class_desc->push_font(doc_code_font); + if (cd.is_script_doc && (cd.properties[i].setter != "" || cd.properties[i].getter != "")) { class_desc->push_color(symbol_color); class_desc->add_text(" [" + TTR("property:") + " "); @@ -764,12 +791,10 @@ void EditorHelp::_update_doc() { } class_desc->pop(); - class_desc->pop(); - - class_desc->pop(); + class_desc->pop(); // cell } - class_desc->pop(); //table + class_desc->pop(); // table class_desc->pop(); class_desc->pop(); // font class_desc->add_newline(); diff --git a/modules/mobile_vr/doc_classes/MobileVRInterface.xml b/modules/mobile_vr/doc_classes/MobileVRInterface.xml index 18a77c8b8d..df099f2c98 100644 --- a/modules/mobile_vr/doc_classes/MobileVRInterface.xml +++ b/modules/mobile_vr/doc_classes/MobileVRInterface.xml @@ -37,6 +37,6 @@ The oversample setting. Because of the lens distortion we have to render our buffers at a higher resolution then the screen can natively handle. A value between 1.5 and 2.0 often provides good results but at the cost of performance. - + -- cgit v1.2.3