summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/classes/@GlobalScope.xml3
-rw-r--r--doc/classes/Button.xml2
-rw-r--r--doc/classes/EditorInspector.xml1
-rw-r--r--doc/classes/Geometry2D.xml1
-rw-r--r--doc/classes/ProjectSettings.xml4
-rw-r--r--doc/classes/TextEdit.xml2
-rw-r--r--doc/classes/Tree.xml6
-rw-r--r--doc/classes/TreeItem.xml23
-rwxr-xr-xdoc/tools/doc_status.py8
-rwxr-xr-xdoc/tools/make_rst.py40
10 files changed, 51 insertions, 39 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml
index 4b32acaaa0..bcab80ea94 100644
--- a/doc/classes/@GlobalScope.xml
+++ b/doc/classes/@GlobalScope.xml
@@ -1571,9 +1571,6 @@
<member name="Geometry3D" type="Geometry3D" setter="" getter="">
The [Geometry3D] singleton.
</member>
- <member name="GodotSharp" type="GodotSharp" setter="" getter="">
- The [GodotSharp] singleton.
- </member>
<member name="IP" type="IP" setter="" getter="">
The [IP] singleton.
</member>
diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml
index 30df4fd10d..d2af6179d9 100644
--- a/doc/classes/Button.xml
+++ b/doc/classes/Button.xml
@@ -122,7 +122,7 @@
The horizontal space between [Button]'s icon and text. Negative values will be treated as [code]0[/code] when used.
</theme_item>
<theme_item name="icon_max_width" data_type="constant" type="int" default="0">
- The maximum allowed width of the [Button]'s icon. This limit is applied on top of the default size of the icon, or its expanded size if [member expand_icon] is [code]true[/code]. The height is adjusted according to the icon's ratio.
+ The maximum allowed width of the [Button]'s icon. This limit is applied on top of the default size of the icon, or its expanded size if [member expand_icon] is [code]true[/code]. The height is adjusted according to the icon's ratio. If the button has additional icons (e.g. [CheckBox]), they will also be limited.
</theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">
The size of the text outline.
diff --git a/doc/classes/EditorInspector.xml b/doc/classes/EditorInspector.xml
index 6b25be490e..cfdc172fd1 100644
--- a/doc/classes/EditorInspector.xml
+++ b/doc/classes/EditorInspector.xml
@@ -28,7 +28,6 @@
</method>
</methods>
<members>
- <member name="follow_focus" type="bool" setter="set_follow_focus" getter="is_following_focus" overrides="ScrollContainer" default="true" />
<member name="horizontal_scroll_mode" type="int" setter="set_horizontal_scroll_mode" getter="get_horizontal_scroll_mode" overrides="ScrollContainer" enum="ScrollContainer.ScrollMode" default="0" />
</members>
<signals>
diff --git a/doc/classes/Geometry2D.xml b/doc/classes/Geometry2D.xml
index dfcf299fe6..f21696d02c 100644
--- a/doc/classes/Geometry2D.xml
+++ b/doc/classes/Geometry2D.xml
@@ -116,6 +116,7 @@
<param index="0" name="polygon" type="PackedVector2Array" />
<description>
Returns [code]true[/code] if [param polygon]'s vertices are ordered in clockwise order, otherwise returns [code]false[/code].
+ [b]Note:[/b] Assumes a Cartesian coordinate system where [code]+x[/code] is right and [code]+y[/code] is up. If using screen coordinates ([code]+y[/code] is down), the result will need to be flipped (i.e. a [code]true[/code] result will indicate counter-clockwise).
</description>
</method>
<method name="line_intersects_line">
diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml
index 926d981f68..5ac4c96d93 100644
--- a/doc/classes/ProjectSettings.xml
+++ b/doc/classes/ProjectSettings.xml
@@ -554,10 +554,10 @@
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when defining a local or subclass member variable that would shadow a variable that is inherited from a parent class.
</member>
<member name="debug/gdscript/warnings/standalone_expression" type="int" setter="" getter="" default="1">
- When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling an expression that has no effect on the surrounding code, such as writing [code]2 + 2[/code] as a statement.
+ When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling an expression that may have no effect on the surrounding code, such as writing [code]2 + 2[/code] as a statement.
</member>
<member name="debug/gdscript/warnings/standalone_ternary" type="int" setter="" getter="" default="1">
- When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling a ternary expression that has no effect on the surrounding code, such as writing [code]42 if active else 0[/code] as a statement.
+ When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling a ternary expression that may have no effect on the surrounding code, such as writing [code]42 if active else 0[/code] as a statement.
</member>
<member name="debug/gdscript/warnings/static_called_on_instance" type="int" setter="" getter="" default="1">
When set to [code]warn[/code] or [code]error[/code], produces a warning or an error respectively when calling a static method from an instance of a class instead of from the class directly.
diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml
index 4dda1f8db8..75cad4d08b 100644
--- a/doc/classes/TextEdit.xml
+++ b/doc/classes/TextEdit.xml
@@ -1314,7 +1314,7 @@
[b]Note:[/b] This method is only implemented on Linux.
</member>
<member name="minimap_draw" type="bool" setter="set_draw_minimap" getter="is_drawing_minimap" default="false">
- If [code]true[/code], a minimap is shown, providing an outline of your source code.
+ If [code]true[/code], a minimap is shown, providing an outline of your source code. The minimap uses a fixed-width text size.
</member>
<member name="minimap_width" type="int" setter="set_minimap_width" getter="get_minimap_width" default="80">
The width, in pixels, of the minimap.
diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml
index 43cd1a8aaa..b0cb25fafd 100644
--- a/doc/classes/Tree.xml
+++ b/doc/classes/Tree.xml
@@ -655,13 +655,13 @@
[StyleBox] used for the cursor, when the [Tree] is not being focused.
</theme_item>
<theme_item name="custom_button" data_type="style" type="StyleBox">
- Default [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell.
+ Default [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when button is enabled with [method TreeItem.set_custom_as_button].
</theme_item>
<theme_item name="custom_button_hover" data_type="style" type="StyleBox">
- [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's hovered.
+ [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode button cell when it's hovered.
</theme_item>
<theme_item name="custom_button_pressed" data_type="style" type="StyleBox">
- [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode cell when it's pressed.
+ [StyleBox] for a [constant TreeItem.CELL_MODE_CUSTOM] mode button cell when it's pressed.
</theme_item>
<theme_item name="focus" data_type="style" type="StyleBox">
The focused style for the [Tree], drawn on top of everything.
diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml
index c679838ec5..78a703c213 100644
--- a/doc/classes/TreeItem.xml
+++ b/doc/classes/TreeItem.xml
@@ -318,12 +318,14 @@
<return type="int" enum="TextServer.StructuredTextParser" />
<param index="0" name="column" type="int" />
<description>
+ Returns the BiDi algorithm override set for this cell.
</description>
</method>
<method name="get_structured_text_bidi_override_options" qualifiers="const">
<return type="Array" />
<param index="0" name="column" type="int" />
<description>
+ Returns the additional BiDi options set for this cell.
</description>
</method>
<method name="get_suffix" qualifiers="const">
@@ -401,6 +403,7 @@
<return type="bool" />
<param index="0" name="column" type="int" />
<description>
+ Returns [code]true[/code] if the cell was made into a button with [method set_custom_as_button].
</description>
</method>
<method name="is_edit_multiline" qualifiers="const">
@@ -532,7 +535,7 @@
<param index="0" name="column" type="int" />
<param index="1" name="mode" type="int" enum="TreeItem.TreeCellMode" />
<description>
- Sets the given column's cell mode to [param mode]. See [enum TreeCellMode] constants.
+ Sets the given column's cell mode to [param mode]. This determines how the cell is displayed and edited. See [enum TreeCellMode] constants for details.
</description>
</method>
<method name="set_checked">
@@ -555,6 +558,7 @@
<param index="0" name="column" type="int" />
<param index="1" name="enable" type="bool" />
<description>
+ Makes a cell with [constant CELL_MODE_CUSTOM] display as a non-flat button with a [StyleBox].
</description>
</method>
<method name="set_custom_bg_color">
@@ -589,7 +593,7 @@
<param index="0" name="column" type="int" />
<param index="1" name="callback" type="Callable" />
<description>
- Sets the given column's custom draw callback. Use an empty [Callable] ([code skip-lint]Callable()[/code]) to clear the custom callback.
+ Sets the given column's custom draw callback. Use an empty [Callable] ([code skip-lint]Callable()[/code]) to clear the custom callback. The cell has to be in [constant CELL_MODE_CUSTOM] to use this feature.
The [param callback] should accept two arguments: the [TreeItem] that is drawn and its position and size as a [Rect2].
</description>
</method>
@@ -639,7 +643,7 @@
<param index="0" name="column" type="int" />
<param index="1" name="texture" type="Texture2D" />
<description>
- Sets the given column's icon [Texture2D].
+ Sets the given cell's icon [Texture2D]. The cell has to be in [constant CELL_MODE_ICON] mode.
</description>
</method>
<method name="set_icon_max_width">
@@ -724,6 +728,7 @@
<param index="0" name="column" type="int" />
<param index="1" name="parser" type="int" enum="TextServer.StructuredTextParser" />
<description>
+ Set BiDi algorithm override for the structured text. Has effect for cells that display text.
</description>
</method>
<method name="set_structured_text_bidi_override_options">
@@ -731,6 +736,7 @@
<param index="0" name="column" type="int" />
<param index="1" name="args" type="Array" />
<description>
+ Set additional options for BiDi override. Has effect for cells that display text.
</description>
</method>
<method name="set_suffix">
@@ -805,18 +811,21 @@
</members>
<constants>
<constant name="CELL_MODE_STRING" value="0" enum="TreeCellMode">
- Cell contains a string.
+ Cell shows a string label. When editable, the text can be edited using a [LineEdit], or a [TextEdit] popup if [method set_edit_multiline] is used.
</constant>
<constant name="CELL_MODE_CHECK" value="1" enum="TreeCellMode">
- Cell contains a checkbox.
+ Cell shows a checkbox, optionally with text. The checkbox can be pressed, released, or indeterminate (via [method set_indeterminate]). The checkbox can't be clicked unless the cell is editable.
</constant>
<constant name="CELL_MODE_RANGE" value="2" enum="TreeCellMode">
- Cell contains a range.
+ Cell shows a numeric range. When editable, it can be edited using a range slider. Use [method set_range] to set the value and [method set_range_config] to configure the range.
+ This cell can also be used in a text dropdown mode when you assign a text with [method set_text]. Separate options with a comma, e.g. [code]"Option1,Option2,Option3"[/code].
</constant>
<constant name="CELL_MODE_ICON" value="3" enum="TreeCellMode">
- Cell contains an icon.
+ Cell shows an icon. It can't be edited nor display text.
</constant>
<constant name="CELL_MODE_CUSTOM" value="4" enum="TreeCellMode">
+ Cell shows as a clickable button. It will display an arrow similar to [OptionButton], but doesn't feature a dropdown (for that you can use [constant CELL_MODE_RANGE]). Clicking the button emits the [signal Tree.item_edited] signal. The button is flat by default, you can use [method set_custom_as_button] to display it with a [StyleBox].
+ This mode also supports custom drawing using [method set_custom_draw_callback].
</constant>
</constants>
</class>
diff --git a/doc/tools/doc_status.py b/doc/tools/doc_status.py
index a23c11b585..57c03bfdee 100755
--- a/doc/tools/doc_status.py
+++ b/doc/tools/doc_status.py
@@ -1,11 +1,11 @@
#!/usr/bin/env python3
import fnmatch
-import os
-import sys
-import re
import math
+import os
import platform
+import re
+import sys
import xml.etree.ElementTree as ET
from typing import Dict, List, Set
@@ -286,7 +286,7 @@ class ClassStatus:
status.progresses[tag.tag].increment(is_deprecated or is_experimental or has_descr)
elif tag.tag in ["constants", "members", "theme_items"]:
for sub_tag in list(tag):
- if not sub_tag.text is None:
+ if sub_tag.text is not None:
is_deprecated = "deprecated" in sub_tag.attrib
is_experimental = "experimental" in sub_tag.attrib
has_descr = len(sub_tag.text.strip()) > 0
diff --git a/doc/tools/make_rst.py b/doc/tools/make_rst.py
index 0b722757f9..bc379f8553 100755
--- a/doc/tools/make_rst.py
+++ b/doc/tools/make_rst.py
@@ -4,17 +4,16 @@
import argparse
import os
-import platform
import re
import sys
import xml.etree.ElementTree as ET
from collections import OrderedDict
-from typing import List, Dict, TextIO, Tuple, Optional, Any, Union
+from typing import Any, Dict, List, Optional, TextIO, Tuple, Union
# Import hardcoded version information from version.py
root_directory = os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../")
sys.path.append(root_directory) # Include the root directory
-import version
+import version # noqa: E402
# $DOCS_URL/path/to/page.html(#fragment-tag)
GODOT_DOCS_PATTERN = re.compile(r"^\$DOCS_URL/(.*)\.html(#.*)?$")
@@ -677,17 +676,6 @@ class ScriptLanguageParityCheck:
# Entry point for the RST generator.
def main() -> None:
- # Enable ANSI escape code support on Windows 10 and later (for colored console output).
- # <https://bugs.python.org/issue29059>
- if platform.system().lower() == "windows":
- from ctypes import windll, c_int, byref # type: ignore
-
- stdout_handle = windll.kernel32.GetStdHandle(c_int(-11))
- mode = c_int(0)
- windll.kernel32.GetConsoleMode(c_int(stdout_handle), byref(mode))
- mode = c_int(mode.value | 4)
- windll.kernel32.SetConsoleMode(c_int(stdout_handle), mode)
-
parser = argparse.ArgumentParser()
parser.add_argument("path", nargs="+", help="A path to an XML file or a directory containing XML files to parse.")
parser.add_argument("--filter", default="", help="The filepath pattern for XML files to filter.")
@@ -711,7 +699,25 @@ def main() -> None:
)
args = parser.parse_args()
- should_color = args.color or (hasattr(sys.stdout, "isatty") and sys.stdout.isatty())
+ should_color = bool(args.color or sys.stdout.isatty() or os.environ.get("CI"))
+
+ # Enable ANSI escape code support on Windows 10 and later (for colored console output).
+ # <https://github.com/python/cpython/issues/73245>
+ if should_color and sys.stdout.isatty() and sys.platform == "win32":
+ try:
+ from ctypes import WinError, byref, windll # type: ignore
+ from ctypes.wintypes import DWORD # type: ignore
+
+ stdout_handle = windll.kernel32.GetStdHandle(DWORD(-11))
+ mode = DWORD(0)
+ if not windll.kernel32.GetConsoleMode(stdout_handle, byref(mode)):
+ raise WinError()
+ mode = DWORD(mode.value | 4)
+ if not windll.kernel32.SetConsoleMode(stdout_handle, mode):
+ raise WinError()
+ except Exception:
+ should_color = False
+
STYLES["red"] = "\x1b[91m" if should_color else ""
STYLES["green"] = "\x1b[92m" if should_color else ""
STYLES["yellow"] = "\x1b[93m" if should_color else ""
@@ -1406,7 +1412,7 @@ def make_rst_class(class_def: ClassDef, state: State, dry_run: bool, output_dir:
operator_anchor = f".. _class_{class_name}_operator_{sanitize_operator_name(m.name, state)}"
for parameter in m.parameters:
operator_anchor += f"_{parameter.type_name.type_name}"
- operator_anchor += f":\n\n"
+ operator_anchor += ":\n\n"
f.write(operator_anchor)
f.write(".. rst-class:: classref-operator\n\n")
@@ -1546,7 +1552,7 @@ def make_method_signature(
out += f":ref:`{op_name}<class_{class_def.name}_{ref_type}_{sanitize_operator_name(definition.name, state)}"
for parameter in definition.parameters:
out += f"_{parameter.type_name.type_name}"
- out += f">`"
+ out += ">`"
elif ref_type == "method":
ref_type_qualifier = ""
if definition.name.startswith("_"):