diff options
author | Rémi Verschelde <remi@verschelde.fr> | 2023-04-04 00:18:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-04 00:18:49 +0200 |
commit | bd016c8c4d51febb6b4da52a22ff7357ac400daa (patch) | |
tree | d7ab47b4816e9808da2928b3b8fd779b0b04cf3b | |
parent | e243dfa9f6fd68740d6ae7bba02ae0114e791543 (diff) | |
parent | 0a8fdde9241c495a1a3b5f58c78910c9eaa12dee (diff) |
Merge pull request #75624 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.2) - 3rd batch
-rw-r--r-- | CHANGELOG.md | 217 | ||||
-rw-r--r-- | doc/classes/CanvasItem.xml | 7 | ||||
-rw-r--r-- | doc/classes/ConeTwistJoint3D.xml | 2 | ||||
-rw-r--r-- | doc/classes/EditorUndoRedoManager.xml | 2 | ||||
-rw-r--r-- | doc/classes/FileSystemDock.xml | 12 | ||||
-rw-r--r-- | doc/classes/InputEventFromWindow.xml | 3 | ||||
-rw-r--r-- | doc/classes/InputEventGesture.xml | 1 | ||||
-rw-r--r-- | doc/classes/InputEventMagnifyGesture.xml | 3 | ||||
-rw-r--r-- | doc/classes/InputEventPanGesture.xml | 3 | ||||
-rw-r--r-- | doc/classes/InputEventShortcut.xml | 3 | ||||
-rw-r--r-- | doc/classes/Node.xml | 20 | ||||
-rw-r--r-- | doc/classes/Node3D.xml | 3 | ||||
-rw-r--r-- | doc/classes/OS.xml | 2 | ||||
-rw-r--r-- | doc/classes/Polygon2D.xml | 3 | ||||
-rw-r--r-- | doc/classes/ProjectSettings.xml | 3 | ||||
-rw-r--r-- | doc/classes/RenderingServer.xml | 42 | ||||
-rw-r--r-- | doc/classes/UndoRedo.xml | 31 | ||||
-rw-r--r-- | doc/classes/Viewport.xml | 2 | ||||
-rw-r--r-- | editor/renames_map_3_to_4.cpp | 38 | ||||
-rw-r--r-- | misc/dist/linux/org.godotengine.Godot.xml | 2 | ||||
-rw-r--r-- | modules/gdscript/doc_classes/@GDScript.xml | 2 | ||||
-rw-r--r-- | scene/3d/physics_body_3d.cpp | 4 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 2 |
23 files changed, 384 insertions, 23 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a386e5a3c..29d7698f61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,220 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). +## [4.0.2] - TBD + +See the [release announcement](https://godotengine.org/article/maintenance-release-godot-4-0-2) for details. + +### Added + +#### Core + +- Add a missing `ImageTextureLayered::_images` setter for the C# bindings ([GH-74668](https://github.com/godotengine/godot/pull/74668)). +- Exposing more project settings for documentation ([GH-74727](https://github.com/godotengine/godot/pull/74727)). + +#### Physics + +- Expose the `apply_floor_snap` function to allow manual snap ([GH-73749](https://github.com/godotengine/godot/pull/73749)). + +#### Porting + +- Android: Use the new API for virtual keyboard height detection on Android, bugfix for old API ([GH-74398](https://github.com/godotengine/godot/pull/74398)). +- Android: Configure maven central snapshot versions for the Godot Android library ([GH-74470](https://github.com/godotengine/godot/pull/74470)). +- Android: Add "filesRoot" path to Android provider paths xml ([GH-74673](https://github.com/godotengine/godot/pull/74673)). +- macOS: Re-add support for the `_sc_` inside app bundle. ([GH-73429](https://github.com/godotengine/godot/pull/73429)). + +#### Project converter + +- Add conversion for `Vector2` `tangent()` -> `orthogonal()` ([GH-74515](https://github.com/godotengine/godot/pull/74515)). +- Add navigation renames to the converter ([GH-75513](https://github.com/godotengine/godot/pull/75513)). + +#### Shaders + +- Add drag and drop support for shader include files in shader editor ([GH-74869](https://github.com/godotengine/godot/pull/74869)). + +#### XR + +- Add `XRServer.world_origin` property ([GH-74151](https://github.com/godotengine/godot/pull/74151)). +- Enable access to the Valve Index grip force sensors ([GH-74787](https://github.com/godotengine/godot/pull/74787)). + +### Changed + +#### 2D + +- Use 8×8 default grid size for TextureRegion and 2D polygon editors ([GH-73685](https://github.com/godotengine/godot/pull/73685)). +- Don't allow selecting nodes without owner in the editor ([GH-75492](https://github.com/godotengine/godot/pull/75492)). + +#### Animation + +- Update property keying state without a full Inspector rebuild ([GH-74564](https://github.com/godotengine/godot/pull/74564)). + +#### Buildsystem + +- Exit with non-zero status if there are issues with FreeType dependencies ([GH-74645](https://github.com/godotengine/godot/pull/74645)). +- SCons: Cleanup `pulseaudio` defines for Linux ([GH-74666](https://github.com/godotengine/godot/pull/74666)). + +#### C#/.NET + +- Encode `GodotProjectDir` as Base64 to prevent issues with special characters ([GH-74312](https://github.com/godotengine/godot/pull/74312)). +- Do not print errors about missing references to intentionally ignored members ([GH-75284](https://github.com/godotengine/godot/pull/75284)). + +#### Core + +- Make `Gradient` resort points on `reverse` ([GH-75235](https://github.com/godotengine/godot/pull/75235)). +- Port robust signal (dis)connection to `ShapeCast2D` ([GH-75266](https://github.com/godotengine/godot/pull/75266)). + +#### Editor + +- Improve POT Generation dialog ([GH-74213](https://github.com/godotengine/godot/pull/74213)). +- Hide internal settings from the class reference ([GH-74226](https://github.com/godotengine/godot/pull/74226)). +- Remove disabled plugins from active plugins ([GH-75331](https://github.com/godotengine/godot/pull/75331)). +- More i18n improvements ([GH-75385](https://github.com/godotengine/godot/pull/75385)). + +#### Export + +- Delete unused compression formats from `.import` files when exporting ([GH-74684](https://github.com/godotengine/godot/pull/74684)). + +#### GDScript + +- Make GDScript number highlighting stricter ([GH-74184](https://github.com/godotengine/godot/pull/74184)). + +#### GUI + +- Improve layout direction/locale automatic selection ([GH-73716](https://github.com/godotengine/godot/pull/73716)). +- Add mutex for FreeType face creation/deletion operations in TextServer ([GH-73987](https://github.com/godotengine/godot/pull/73987)). + +#### Input + +- Remove `meta_mem` update on keyup/keydown on Windows ([GH-75172](https://github.com/godotengine/godot/pull/75172)). + +#### Physics + +- Revert attempted fix of trimesh CCD ([GH-74861](https://github.com/godotengine/godot/pull/74861)). + +#### Porting + +- Android: Bump the target SDK version to 33 (Android 13) ([GH-75203](https://github.com/godotengine/godot/pull/75203)). + +#### Project converter + +- Remove Tween properties/signals from renames ([GH-75443](https://github.com/godotengine/godot/pull/75443)). + +#### Rendering + +- Incorporating the availability of screen and depth textures for the GLES3 backend ([GH-72361](https://github.com/godotengine/godot/pull/72361)). + +#### Thirdparty + +- mymindstorm/setup-emsdk updated to 12. + +#### XR + +- Replace OpenXR operating system alert dialog with a warning log message ([GH-73144](https://github.com/godotengine/godot/pull/73144)). +- Check hardware sRGB conversion when an sRGB target is used ([GH-74892](https://github.com/godotengine/godot/pull/74892)). + +### Fixed + +#### 2D + +- Fix preview rendering and transform calculations in the tiles editor ([GH-74982](https://github.com/godotengine/godot/pull/74982)). +- Fix `ENTER_CANVAS` / `VISIBILITY_CHANGED` notification order when `CanvasItem` enters tree ([GH-75238](https://github.com/godotengine/godot/pull/75238)). +- Fix a crash in the tiles editor when merging atlases ([GH-75361](https://github.com/godotengine/godot/pull/75361)). + +#### 3D + +- Fix GridMap signal `cell_size_changed` disconnect error ([GH-74890](https://github.com/godotengine/godot/pull/74890)). + +#### Animation + +- Fix `AnimatedSprite2D` autoplay warning ([GH-75258](https://github.com/godotengine/godot/pull/75258)). + +#### Buildsystem + +- Fix xml namespace in org.godotengine.Godot.xml ([GH-74920](https://github.com/godotengine/godot/pull/74920)). + +#### C#/.NET + +- Fix building projects for MSBuild before 17.3 ([GH-74479](https://github.com/godotengine/godot/pull/74479)). +- Fix `Array.AddRange` index out of bounds ([GH-75357](https://github.com/godotengine/godot/pull/75357)). + +#### Core + +- Fix some race conditions that happen during initialization ([GH-73793](https://github.com/godotengine/godot/pull/73793)). +- Fix crash in resource load ([GH-74166](https://github.com/godotengine/godot/pull/74166)). +- Fix `randfn` to prevent it from generating nan values ([GH-74248](https://github.com/godotengine/godot/pull/74248)). +- Fix Variant hashing for floats ([GH-74600](https://github.com/godotengine/godot/pull/74600)). +- Fix type check for `max`/`min` ([GH-74770](https://github.com/godotengine/godot/pull/74770)). +- Fix `Array.slice()` rounding when step is other than 1 ([GH-74909](https://github.com/godotengine/godot/pull/74909)). + +#### Editor + +- Fix cancelling selection while gizmo editing making uncommitted changes ([GH-71156](https://github.com/godotengine/godot/pull/71156)). +- Fix `EditorUndoRedoManager`'s handling of `MERGE_ENDS` ([GH-74460](https://github.com/godotengine/godot/pull/74460)). +- Fix built-in scripts missing their methods on signal connection ([GH-74495](https://github.com/godotengine/godot/pull/74495)). +- Fix "Download Project Source" for the Web Editor ([GH-75194](https://github.com/godotengine/godot/pull/75194)). +- Fix incorrect sizes of some editor elements ([GH-75379](https://github.com/godotengine/godot/pull/75379), [GH-75381](https://github.com/godotengine/godot/pull/75381)). + +#### Export + +- Fix GDExtensions library export when multiple architectures are set ([GH-74057](https://github.com/godotengine/godot/pull/74057)). + +#### GDScript + +- Fix "Find in Files" search results not opening built-in script ([GH-74401](https://github.com/godotengine/godot/pull/74401)). +- Fix false positive `REDUNDANT_AWAIT` warning ([GH-74949](https://github.com/godotengine/godot/pull/74949)). + +#### GUI + +- Fix scrolling behavior with zero/low page value ([GH-67910](https://github.com/godotengine/godot/pull/67910)). +- Fix some ways to create inconsistent Viewport size states ([GH-73188](https://github.com/godotengine/godot/pull/73188)). +- Fix `GraphNode` resizing when its bottom border is too thin ([GH-73800](https://github.com/godotengine/godot/pull/73800)). +- Fix IME position in the single window mode sub-windows ([GH-74472](https://github.com/godotengine/godot/pull/74472)). +- Fix gutter set width results in receiving only half of the desired size ([GH-74537](https://github.com/godotengine/godot/pull/74537)). +- Fix `get_drag_data` not overridable in some Controls ([GH-75122](https://github.com/godotengine/godot/pull/75122)). +- Fix block caret size at the end of the line ([GH-75597](https://github.com/godotengine/godot/pull/75597)). + +#### Import + +- Fix `ResourceImporterLayeredTexture::import()` `high_quality` variable type ([GH-75244](https://github.com/godotengine/godot/pull/75244)). + +#### Input + +- Fix layout bug in `keyboard_get_keycode_from_physical` on Linux/X11 ([GH-75461](https://github.com/godotengine/godot/pull/75461)). + +#### Navigation + +- Fix GridMap free navigation RID error spam ([GH-74889](https://github.com/godotengine/godot/pull/74889)). +- Fix agents with disabled avoidance getting added to avoidance simulation ([GH-74893](https://github.com/godotengine/godot/pull/74893)). + +#### Networking + +- Fix list handling in `SceneReplicationConfig` ([GH-74552](https://github.com/godotengine/godot/pull/74552)). + +#### Physics + +- Fix `collide_shape` return type ([GH-75260](https://github.com/godotengine/godot/pull/75260)). +- Fix property hint for platform layers on 3D physics body ([GH-75544](https://github.com/godotengine/godot/pull/75544)). + +#### Porting + +- Android: Fix directory access when the running app has the `All files access` permission ([GH-75146](https://github.com/godotengine/godot/pull/75146)). +- macOS: Fix infinite loop caused by global menu callbacks which trigger EditorProgress dialog ([GH-75254](https://github.com/godotengine/godot/pull/75254)). + +#### Rendering + +- Fix spotlight shadows in volumetric fog ([GH-73919](https://github.com/godotengine/godot/pull/73919)). +- Fix issues with point size not functioning correctly in GLES3 ([GH-73966](https://github.com/godotengine/godot/pull/73966)). +- Update GPUParticles2D/3D speed scale on `ENTER_TREE` ([GH-75398](https://github.com/godotengine/godot/pull/75398)). + +#### Shaders + +- Fix ndc calculation for LinearSceneDepth VS node in GLES3 ([GH-74910](https://github.com/godotengine/godot/pull/74910)). + +#### XR + +- Fix typo in OpenXR pose orientation check ([GH-74928](https://github.com/godotengine/godot/pull/74928)). + + ## [4.0.1] - 2023-03-20 See the [release announcement](https://godotengine.org/article/maintenance-release-godot-4-0-1) for details. @@ -954,7 +1168,7 @@ See the [release announcement](https://godotengine.org/article/godot-3-4-is-rele #### Thirdparty -- Bullet uppdated to version 3.17. +- Bullet updated to version 3.17. - Embree updated to version 3.13.0. - MbedTLS updated to version 2.16.11 (security update). - NanoSVG updated to 2021-09-03 git snapshot (security update). @@ -2603,6 +2817,7 @@ See the [release announcement](https://godotengine.org/article/godot-3-3-has-arr - Only WebAssembly is supported now, since all browsers supporting WebGL 2.0 also support WebAssembly. +[4.0.2]: https://github.com/godotengine/godot/compare/4.0.1-stable...4.0.2-stable [4.0.1]: https://github.com/godotengine/godot/compare/4.0-stable...4.0.1-stable [4.0]: https://github.com/godotengine/godot/compare/3.2-stable...4.0-stable [3.5]: https://github.com/godotengine/godot/compare/3.4-stable...3.5-stable diff --git a/doc/classes/CanvasItem.xml b/doc/classes/CanvasItem.xml index f99d90d32c..572963b406 100644 --- a/doc/classes/CanvasItem.xml +++ b/doc/classes/CanvasItem.xml @@ -569,13 +569,14 @@ The rendering layers in which this [CanvasItem] responds to [Light2D] nodes. </member> <member name="material" type="Material" setter="set_material" getter="get_material"> - The material applied to textures on this [CanvasItem]. + The material applied to this [CanvasItem]. </member> <member name="modulate" type="Color" setter="set_modulate" getter="get_modulate" default="Color(1, 1, 1, 1)"> - The color applied to textures on this [CanvasItem]. + The color applied to this [CanvasItem]. This property does affect child [CanvasItem]s, unlike [member self_modulate] which only affects the node itself. </member> <member name="self_modulate" type="Color" setter="set_self_modulate" getter="get_self_modulate" default="Color(1, 1, 1, 1)"> - The color applied to textures on this [CanvasItem]. This is not inherited by children [CanvasItem]s. + The color applied to this [CanvasItem]. This property does [b]not[/b] affect child [CanvasItem]s, unlike [member modulate] which affects both the node itself and its children. + [b]Note:[/b] Internal children (e.g. sliders in [ColorPicker] or tab bar in [TabContainer]) are also not affected by this property (see [code]include_internal[/code] parameter of [method Node.get_child] and other similar methods). </member> <member name="show_behind_parent" type="bool" setter="set_draw_behind_parent" getter="is_draw_behind_parent_enabled" default="false"> If [code]true[/code], the object draws behind its parent. diff --git a/doc/classes/ConeTwistJoint3D.xml b/doc/classes/ConeTwistJoint3D.xml index 1cfe9d197d..ee68b156d7 100644 --- a/doc/classes/ConeTwistJoint3D.xml +++ b/doc/classes/ConeTwistJoint3D.xml @@ -15,6 +15,7 @@ <return type="float" /> <param index="0" name="param" type="int" enum="ConeTwistJoint3D.Param" /> <description> + Returns the value of the specified parameter. </description> </method> <method name="set_param"> @@ -22,6 +23,7 @@ <param index="0" name="param" type="int" enum="ConeTwistJoint3D.Param" /> <param index="1" name="value" type="float" /> <description> + Sets the value of the specified parameter. </description> </method> </methods> diff --git a/doc/classes/EditorUndoRedoManager.xml b/doc/classes/EditorUndoRedoManager.xml index 4d6938e6aa..bf2acd0805 100644 --- a/doc/classes/EditorUndoRedoManager.xml +++ b/doc/classes/EditorUndoRedoManager.xml @@ -10,6 +10,8 @@ - If the object is a built-in resource, use the scene from its path; - If the object is external resource or anything else, use global history. This guessing can sometimes yield false results, so you can provide a custom context object when creating an action. + [EditorUndoRedoManager] is intended to be used by Godot editor plugins. You can obtain it using [method EditorPlugin.get_undo_redo]. For non-editor uses or plugins that don't need to integrate with the editor's undo history, use [UndoRedo] instead. + The manager's API is mostly the same as in [UndoRedo], so you can refer to its documentation for more examples. The main difference is that [EditorUndoRedoManager] uses object + method name for actions, instead of [Callable]. </description> <tutorials> </tutorials> diff --git a/doc/classes/FileSystemDock.xml b/doc/classes/FileSystemDock.xml index f76bc2c279..f549695e72 100644 --- a/doc/classes/FileSystemDock.xml +++ b/doc/classes/FileSystemDock.xml @@ -1,8 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="FileSystemDock" inherits="VBoxContainer" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Editor dock for managing files in the project. </brief_description> <description> + This class is available only in [EditorPlugin]s and can't be instantiated. You can access it using [method EditorInterface.get_file_system_dock]. + While FileSystemDock doesn't expose any methods for file manipulation, you can listen for various file-related signals. </description> <tutorials> </tutorials> @@ -11,49 +14,58 @@ <return type="void" /> <param index="0" name="path" type="String" /> <description> + Sets the given [param path] as currently selected, ensuring that the selected file/directory is visible. </description> </method> </methods> <signals> <signal name="display_mode_changed"> <description> + Emitted when the user switches file display mode or split mode. </description> </signal> <signal name="file_removed"> <param index="0" name="file" type="String" /> <description> + Emitted when the given [param file] was removed. </description> </signal> <signal name="files_moved"> <param index="0" name="old_file" type="String" /> <param index="1" name="new_file" type="String" /> <description> + Emitted when a file is moved from [param old_file] path to [param new_file] path. </description> </signal> <signal name="folder_moved"> <param index="0" name="old_folder" type="String" /> <param index="1" name="new_folder" type="String" /> <description> + Emitted when a folder is moved from [param old_folder] path to [param new_folder] path. </description> </signal> <signal name="folder_removed"> <param index="0" name="folder" type="String" /> <description> + Emitted when the given [param folder] was removed. </description> </signal> <signal name="inherit"> <param index="0" name="file" type="String" /> <description> + Emitted when a new scene is created that inherits the scene at [param file] path. </description> </signal> <signal name="instantiate"> <param index="0" name="files" type="PackedStringArray" /> <description> + Emitted when the given scenes are being instantiated in the editor. </description> </signal> <signal name="resource_removed"> <param index="0" name="resource" type="Resource" /> <description> + Emitted when an external [param resource] had its file removed. </description> </signal> </signals> diff --git a/doc/classes/InputEventFromWindow.xml b/doc/classes/InputEventFromWindow.xml index adbf8ccc08..24b084bb5d 100644 --- a/doc/classes/InputEventFromWindow.xml +++ b/doc/classes/InputEventFromWindow.xml @@ -1,13 +1,16 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="InputEventFromWindow" inherits="InputEvent" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + Base class for [Viewport]-based input events. </brief_description> <description> + InputEventFromWindow represents events specifically received by windows. This includes mouse events, keyboard events in focused windows or touch screen actions. </description> <tutorials> </tutorials> <members> <member name="window_id" type="int" setter="set_window_id" getter="get_window_id" default="0"> + The ID of a [Window] that received this event. </member> </members> </class> diff --git a/doc/classes/InputEventGesture.xml b/doc/classes/InputEventGesture.xml index 85d1a405b2..578faab6b5 100644 --- a/doc/classes/InputEventGesture.xml +++ b/doc/classes/InputEventGesture.xml @@ -4,6 +4,7 @@ Base class for touch control gestures. </brief_description> <description> + InputEventGesture is sent when a user performs a supported gesture on a touch screen. Gestures can't be emulated using mouse, because they typically require multi-touch. </description> <tutorials> </tutorials> diff --git a/doc/classes/InputEventMagnifyGesture.xml b/doc/classes/InputEventMagnifyGesture.xml index 2063dfda6c..838809423f 100644 --- a/doc/classes/InputEventMagnifyGesture.xml +++ b/doc/classes/InputEventMagnifyGesture.xml @@ -1,13 +1,16 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="InputEventMagnifyGesture" inherits="InputEventGesture" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + [InputEvent] that represents a magnifying touch gesture. </brief_description> <description> + Magnify gesture is performed when the user pinches the touch screen. It's typically used for zooming. </description> <tutorials> </tutorials> <members> <member name="factor" type="float" setter="set_factor" getter="get_factor" default="1.0"> + The amount (or delta) of the event. This value is higher the faster the gesture is performed. </member> </members> </class> diff --git a/doc/classes/InputEventPanGesture.xml b/doc/classes/InputEventPanGesture.xml index deb76d5d38..e276f68cc3 100644 --- a/doc/classes/InputEventPanGesture.xml +++ b/doc/classes/InputEventPanGesture.xml @@ -1,13 +1,16 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="InputEventPanGesture" inherits="InputEventGesture" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + [InputEvent] that represents a panning touch gesture. </brief_description> <description> + Pan gesture is performed when the user swipes the touch screen with two fingers. It's typically used for panning/scrolling. </description> <tutorials> </tutorials> <members> <member name="delta" type="Vector2" setter="set_delta" getter="get_delta" default="Vector2(0, 0)"> + Panning amount since last pan event. </member> </members> </class> diff --git a/doc/classes/InputEventShortcut.xml b/doc/classes/InputEventShortcut.xml index 58b44132bb..93c1e84be3 100644 --- a/doc/classes/InputEventShortcut.xml +++ b/doc/classes/InputEventShortcut.xml @@ -1,13 +1,16 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="InputEventShortcut" inherits="InputEvent" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> + [InputEvent] that signifies a triggered keyboard [Shortcut]. </brief_description> <description> + InputEventShortcut is a special event that can be received in [method Node._unhandled_key_input]. It's typically sent by the editor's Command Palette to trigger actions, but can also be sent manually using [method Viewport.push_unhandled_input]. </description> <tutorials> </tutorials> <members> <member name="shortcut" type="Shortcut" setter="set_shortcut" getter="get_shortcut"> + The [Shortcut] represented by this event. Its [method Shortcut.matches_event] method will always return [code]true[/code] for this event. </member> </members> </class> diff --git a/doc/classes/Node.xml b/doc/classes/Node.xml index d904d20335..62d708618a 100644 --- a/doc/classes/Node.xml +++ b/doc/classes/Node.xml @@ -42,6 +42,18 @@ The elements in the array returned from this method are displayed as warnings in the Scene dock if the script that overrides it is a [code]tool[/code] script. Returning an empty array produces no warnings. Call [method update_configuration_warnings] when the warnings need to be updated for this node. + [codeblock] + @export var energy = 0: + set(value): + energy = value + update_configuration_warnings() + + func _get_configuration_warnings(): + if energy < 0: + return ["Energy must be 0 or greater."] + else: + return [] + [/codeblock] </description> </method> <method name="_input" qualifiers="virtual"> @@ -127,7 +139,7 @@ <description> Adds a child [param node]. Nodes can have any number of children, but every child must have a unique name. Child nodes are automatically deleted when the parent node is deleted, so an entire scene can be removed by deleting its topmost node. If [param force_readable_name] is [code]true[/code], improves the readability of the added [param node]. If not named, the [param node] is renamed to its type, and if it shares [member name] with a sibling, a number is suffixed more appropriately. This operation is very slow. As such, it is recommended leaving this to [code]false[/code], which assigns a dummy name featuring [code]@[/code] in both situations. - If [param internal] is different than [constant INTERNAL_MODE_DISABLED], the child will be added as internal node. Such nodes are ignored by methods like [method get_children], unless their parameter [code]include_internal[/code] is [code]true[/code].The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. [ColorPicker]. See [enum InternalMode] for available modes. + If [param internal] is different than [constant INTERNAL_MODE_DISABLED], the child will be added as internal node. Such nodes are ignored by methods like [method get_children], unless their parameter [code]include_internal[/code] is [code]true[/code]. The intended usage is to hide the internal nodes from the user, so the user won't accidentally delete or modify them. Used by some GUI nodes, e.g. [ColorPicker]. See [enum InternalMode] for available modes. [b]Note:[/b] If the child node already has a parent, the function will fail. Use [method remove_child] first to remove the node from its current parent. For example: [codeblocks] [gdscript] @@ -206,7 +218,7 @@ <param index="1" name="recursive" type="bool" default="true" /> <param index="2" name="owned" type="bool" default="true" /> <description> - Finds the first descendant of this node whose name matches [param pattern] as in [method String.match]. + Finds the first descendant of this node whose name matches [param pattern] as in [method String.match]. Internal children are also searched over (see [code]internal[/code] parameter in [method add_child]). [param pattern] does not match against the full path, just against individual node names. It is case-sensitive, with [code]"*"[/code] matching zero or more characters and [code]"?"[/code] matching any single character except [code]"."[/code]). If [param recursive] is [code]true[/code], all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If [param recursive] is [code]false[/code], only this node's direct children are matched. If [param owned] is [code]true[/code], this method only finds nodes who have an assigned [member Node.owner]. This is especially important for scenes instantiated through a script, because those scenes don't have an owner. @@ -222,7 +234,7 @@ <param index="2" name="recursive" type="bool" default="true" /> <param index="3" name="owned" type="bool" default="true" /> <description> - Finds descendants of this node whose name matches [param pattern] as in [method String.match], and/or type matches [param type] as in [method Object.is_class]. + Finds descendants of this node whose name matches [param pattern] as in [method String.match], and/or type matches [param type] as in [method Object.is_class]. Internal children are also searched over (see [code]internal[/code] parameter in [method add_child]). [param pattern] does not match against the full path, just against individual node names. It is case-sensitive, with [code]"*"[/code] matching zero or more characters and [code]"?"[/code] matching any single character except [code]"."[/code]). [param type] will check equality or inheritance, and is case-sensitive. [code]"Object"[/code] will match a node whose type is [code]"Node"[/code] but not the other way around. If [param recursive] is [code]true[/code], all child nodes are included, even if deeply nested. Nodes are checked in tree order, so this node's first direct child is checked first, then its own direct children, etc., before moving to the second direct child, and so on. If [param recursive] is [code]false[/code], only this node's direct children are matched. @@ -942,8 +954,10 @@ Specific to the Android platform. </constant> <constant name="NOTIFICATION_WM_SIZE_CHANGED" value="1008"> + Notification received from the OS when the window is resized. </constant> <constant name="NOTIFICATION_WM_DPI_CHANGE" value="1009"> + Notification received from the OS when the screen's DPI has been changed. Only implemented on macOS. </constant> <constant name="NOTIFICATION_VP_MOUSE_ENTER" value="1010"> Notification received when the mouse enters the viewport. diff --git a/doc/classes/Node3D.xml b/doc/classes/Node3D.xml index 61e5c44251..581cb68c92 100644 --- a/doc/classes/Node3D.xml +++ b/doc/classes/Node3D.xml @@ -344,10 +344,13 @@ In order for [constant NOTIFICATION_LOCAL_TRANSFORM_CHANGED] to work, users first need to ask for it, with [method set_notify_local_transform]. </constant> <constant name="ROTATION_EDIT_MODE_EULER" value="0" enum="RotationEditMode"> + The rotation is edited using [Vector3] Euler angles. </constant> <constant name="ROTATION_EDIT_MODE_QUATERNION" value="1" enum="RotationEditMode"> + The rotation is edited using a [Quaternion]. </constant> <constant name="ROTATION_EDIT_MODE_BASIS" value="2" enum="RotationEditMode"> + The rotation is edited using a [Basis]. In this mode, [member scale] can't be edited separately. </constant> </constants> </class> diff --git a/doc/classes/OS.xml b/doc/classes/OS.xml index 92ee2fb40b..10818e0dec 100644 --- a/doc/classes/OS.xml +++ b/doc/classes/OS.xml @@ -4,7 +4,7 @@ Operating System functions. </brief_description> <description> - Operating System functions. [OS] wraps the most common functionality to communicate with the host operating system, such as the clipboard, video driver, delays, environment variables, execution of binaries, command line, etc. + Operating System functions. [OS] wraps the most common functionality to communicate with the host operating system, such as the video driver, delays, environment variables, execution of binaries, command line, etc. [b]Note:[/b] In Godot 4, [OS] functions related to window management were moved to the [DisplayServer] singleton. </description> <tutorials> diff --git a/doc/classes/Polygon2D.xml b/doc/classes/Polygon2D.xml index a3fc326351..4f24800647 100644 --- a/doc/classes/Polygon2D.xml +++ b/doc/classes/Polygon2D.xml @@ -72,11 +72,13 @@ If [code]true[/code], polygon edges will be anti-aliased. </member> <member name="bones" type="Array" setter="_set_bones" getter="_get_bones" default="[]"> + Internal list of [Bone2D] nodes used by the assigned [member skeleton]. Edited using the Polygon2D editor ("UV" button on the top toolbar). </member> <member name="color" type="Color" setter="set_color" getter="get_color" default="Color(1, 1, 1, 1)"> The polygon's fill color. If [code]texture[/code] is defined, it will be multiplied by this color. It will also be the default color for vertices not set in [code]vertex_colors[/code]. </member> <member name="internal_vertex_count" type="int" setter="set_internal_vertex_count" getter="get_internal_vertex_count" default="0"> + Number of internal vertices, used for UV mapping. </member> <member name="invert_border" type="float" setter="set_invert_border" getter="get_invert_border" default="100.0"> Added padding applied to the bounding box when [member invert_enabled] is set to [code]true[/code]. Setting this value too small may result in a "Bad Polygon" error. @@ -95,6 +97,7 @@ The list of polygons, in case more than one is being represented. Every individual polygon is stored as a [PackedInt32Array] where each [int] is an index to a point in [member polygon]. If empty, this property will be ignored, and the resulting single polygon will be composed of all points in [member polygon], using the order they are stored in. </member> <member name="skeleton" type="NodePath" setter="set_skeleton" getter="get_skeleton" default="NodePath("")"> + Path to a [Skeleton2D] node used for skeleton-based deformations of this polygon. If empty or invalid, skeletal deformations will not be used. </member> <member name="texture" type="Texture2D" setter="set_texture" getter="get_texture"> The polygon's fill texture. Use [code]uv[/code] to set texture coordinates. diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 120dda92c4..78b7e073c7 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -1958,8 +1958,10 @@ <member name="rendering/2d/shadow_atlas/size" type="int" setter="" getter="" default="2048"> </member> <member name="rendering/2d/snap/snap_2d_transforms_to_pixel" type="bool" setter="" getter="" default="false"> + If [code]true[/code], [CanvasItem] nodes will internally snap to full pixels. Their position can still be sub-pixel, but the decimals will not have effect. </member> <member name="rendering/2d/snap/snap_2d_vertices_to_pixel" type="bool" setter="" getter="" default="false"> + If [code]true[/code], vertices of [CanvasItem] nodes will snap to full pixels. Only affects the final vertex positions, not the transforms. </member> <member name="rendering/anti_aliasing/quality/msaa_2d" type="int" setter="" getter="" default="0"> Sets the number of MSAA samples to use for 2D/Canvas rendering (as a power of two). MSAA is used to reduce aliasing around the edges of polygons. A higher MSAA value results in smoother edges but can be significantly slower on some hardware. This has no effect on shader-induced aliasing or texture aliasing. @@ -2416,6 +2418,7 @@ <member name="threading/worker_pool/low_priority_thread_ratio" type="float" setter="" getter="" default="0.3"> </member> <member name="threading/worker_pool/max_threads" type="int" setter="" getter="" default="-1"> + Maximum number of threads to be used by [WorkerThreadPool]. Value of [code]-1[/code] means no limit. </member> <member name="threading/worker_pool/use_system_threads_for_low_priority_tasks" type="bool" setter="" getter="" default="true"> </member> diff --git a/doc/classes/RenderingServer.xml b/doc/classes/RenderingServer.xml index 2ba8e40ce2..ec338cb729 100644 --- a/doc/classes/RenderingServer.xml +++ b/doc/classes/RenderingServer.xml @@ -33,6 +33,7 @@ <description> Creates a camera attributes object and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]camera_attributes_[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + This is the internal equivalent of the [CameraAttributes] resource. </description> </method> <method name="camera_attributes_set_auto_exposure"> @@ -100,6 +101,7 @@ <description> Creates a camera and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]camera_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + This is the internal equivalent of the [Camera3D] node. </description> </method> <method name="camera_set_camera_attributes"> @@ -178,6 +180,7 @@ <description> Creates a canvas and returns the assigned [RID]. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + Canvas has no [Resource] or [Node] equivalent. </description> </method> <method name="canvas_item_add_animation_slice"> @@ -350,6 +353,7 @@ <param index="4" name="modulate" type="Color" default="Color(1, 1, 1, 1)" /> <param index="5" name="transpose" type="bool" default="false" /> <description> + Draws a 2D textured rectangle on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_texture_rect] and [method Texture2D.draw_rect]. </description> </method> <method name="canvas_item_add_texture_rect_region"> @@ -362,6 +366,7 @@ <param index="5" name="transpose" type="bool" default="false" /> <param index="6" name="clip_uv" type="bool" default="true" /> <description> + Draws the specified region of a 2D textured rectangle on the [CanvasItem] pointed to by the [param item] [RID]. See also [method CanvasItem.draw_texture_rect_region] and [method Texture2D.draw_rect_region]. </description> </method> <method name="canvas_item_add_triangle_array"> @@ -388,7 +393,9 @@ <method name="canvas_item_create"> <return type="RID" /> <description> - Creates a new [CanvasItem] instance and returns its [RID]. + Creates a canvas item and returns the assigned [RID]. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_item_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + This is the internal equivalent of the [CanvasItem] node. </description> </method> <method name="canvas_item_set_canvas_group_mode"> @@ -482,6 +489,7 @@ <param index="0" name="item" type="RID" /> <param index="1" name="color" type="Color" /> <description> + Sets a color modulation to the [CanvasItem]. This also affects child canvas items. </description> </method> <method name="canvas_item_set_parent"> @@ -489,6 +497,7 @@ <param index="0" name="item" type="RID" /> <param index="1" name="parent" type="RID" /> <description> + Sets a parent [CanvasItem] to the [CanvasItem]. The item will inherit transform, modulation and visibility from its parent, like [CanvasItem] nodes in the scene tree. </description> </method> <method name="canvas_item_set_self_modulate"> @@ -496,6 +505,7 @@ <param index="0" name="item" type="RID" /> <param index="1" name="color" type="Color" /> <description> + Sets a color self-modulation to the [CanvasItem]. It does not affect the child canvas items. </description> </method> <method name="canvas_item_set_sort_children_by_y"> @@ -503,6 +513,7 @@ <param index="0" name="item" type="RID" /> <param index="1" name="enabled" type="bool" /> <description> + Enables or disables Y-sorting of a [CanvasItem]. </description> </method> <method name="canvas_item_set_transform"> @@ -510,6 +521,7 @@ <param index="0" name="item" type="RID" /> <param index="1" name="transform" type="Transform2D" /> <description> + Sets the transform of the [CanvasItem]. It affects where and how the item will be drawn. Child canvas items' transforms are multiplied by their parent's transform. </description> </method> <method name="canvas_item_set_use_parent_material"> @@ -536,6 +548,8 @@ <param index="3" name="enter_callable" type="Callable" /> <param index="4" name="exit_callable" type="Callable" /> <description> + Sets the given [CanvasItem] as visibility notifier. [param area] defines the area of detecting visibility. [param enter_callable] is called when the [CanvasItem] enters the screen, [param exit_callable] is called when the [CanvasItem] exits the screen. If [param enable] is [code]false[/code], the item will no longer function as notifier. + This method can be used to manually mimic [VisibleOnScreenNotifier2D]. </description> </method> <method name="canvas_item_set_visible"> @@ -543,6 +557,7 @@ <param index="0" name="item" type="RID" /> <param index="1" name="visible" type="bool" /> <description> + Sets the visibility of the [CanvasItem]. </description> </method> <method name="canvas_item_set_z_as_relative_to_parent"> @@ -832,6 +847,9 @@ <method name="canvas_texture_create"> <return type="RID" /> <description> + Creates a canvas texture and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]canvas_texture_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + This is the internal equivalent of the [CanvasTexture] resource. </description> </method> <method name="canvas_texture_set_channel"> @@ -855,6 +873,7 @@ <param index="0" name="canvas_texture" type="RID" /> <param index="1" name="filter" type="int" enum="RenderingServer.CanvasItemTextureFilter" /> <description> + Sets the texture filter used by the [CanvasTexture]. </description> </method> <method name="canvas_texture_set_texture_repeat"> @@ -862,6 +881,7 @@ <param index="0" name="canvas_texture" type="RID" /> <param index="1" name="repeat" type="int" enum="RenderingServer.CanvasItemTextureRepeat" /> <description> + Sets the texture repeat used by the [CanvasTexture]. </description> </method> <method name="create_local_rendering_device" qualifiers="const"> @@ -874,6 +894,9 @@ <method name="decal_create"> <return type="RID" /> <description> + Creates a decal and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]decal_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + This is the internal equivalent of the [Decal] node. </description> </method> <method name="decal_set_albedo_mix"> @@ -919,6 +942,7 @@ <param index="0" name="decal" type="RID" /> <param index="1" name="color" type="Color" /> <description> + Sets the color modulation of the [Decal]. </description> </method> <method name="decal_set_normal_fade"> @@ -933,6 +957,7 @@ <param index="0" name="decal" type="RID" /> <param index="1" name="size" type="Vector3" /> <description> + Sets the size of the [Decal]. </description> </method> <method name="decal_set_texture"> @@ -941,6 +966,7 @@ <param index="1" name="type" type="int" enum="RenderingServer.DecalTexture" /> <param index="2" name="texture" type="RID" /> <description> + Sets the texture of the [Decal]. </description> </method> <method name="decals_set_filter"> @@ -955,6 +981,7 @@ Creates a directional light and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID can be used in most [code]light_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. To place in a scene, attach this directional light to an instance using [method instance_set_base] using the returned RID. + This is the internal equivalent of the [DirectionalLight3D] node. </description> </method> <method name="directional_shadow_atlas_set_size"> @@ -983,6 +1010,7 @@ <description> Creates an environment and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]environment_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + This is the internal equivalent of the [Environment] resource. </description> </method> <method name="environment_glow_set_use_bicubic_upscale"> @@ -1244,7 +1272,9 @@ <method name="fog_volume_create"> <return type="RID" /> <description> - Creates a new fog volume and allocates an RID. + Creates a fog volume and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]fog_volume_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + This is the internal equivalent of the [FogVolume] node. </description> </method> <method name="fog_volume_set_material"> @@ -1461,6 +1491,7 @@ Creates a visual instance and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]instance_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. An instance is a way of placing a 3D object in the scenario. Objects like particles, meshes, and reflection probes need to be associated with an instance to be visible in the scenario using [method instance_set_base]. + This is the internal equivalent of the [VisualInstance3D] node. </description> </method> <method name="instance_create2"> @@ -1821,7 +1852,9 @@ <method name="lightmap_create"> <return type="RID" /> <description> - Creates a new [LightmapGI] instance. + Creates a lightmap GI and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]instance_*[/code] RenderingServer functions. + Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + This is the internal equivalent of the [LightmapGI] node. </description> </method> <method name="lightmap_get_probe_capture_bsp_tree" qualifiers="const"> @@ -1908,6 +1941,7 @@ <description> Creates an empty material and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]material_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. + This is the internal equivalent of the [Material] resource. </description> </method> <method name="material_get_param" qualifiers="const"> @@ -1982,6 +2016,7 @@ Creates a new mesh and adds it to the RenderingServer. It can be accessed with the RID that is returned. This RID will be used in all [code]mesh_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. To place in a scene, attach this mesh to an instance using [method instance_set_base] using the returned RID. + This is the internal equivalent of the [Mesh] resource. </description> </method> <method name="mesh_create_from_surfaces"> @@ -2154,6 +2189,7 @@ Creates a new multimesh on the RenderingServer and returns an [RID] handle. This RID will be used in all [code]multimesh_*[/code] RenderingServer functions. Once finished with your RID, you will want to free the RID using the RenderingServer's [method free_rid] static method. To place in a scene, attach this multimesh to an instance using [method instance_set_base] using the returned RID. + This is the internal equivalent of the [MultiMesh] resource. </description> </method> <method name="multimesh_get_aabb" qualifiers="const"> diff --git a/doc/classes/UndoRedo.xml b/doc/classes/UndoRedo.xml index e43bceb941..3365806b4c 100644 --- a/doc/classes/UndoRedo.xml +++ b/doc/classes/UndoRedo.xml @@ -1,15 +1,15 @@ <?xml version="1.0" encoding="UTF-8" ?> <class name="UndoRedo" inherits="Object" version="4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> <brief_description> - Helper to manage undo/redo operations in the editor or custom tools. + General-purpose helper to manage undo/redo operations. </brief_description> <description> - Helper to manage undo/redo operations in the editor or custom tools. It works by registering methods and property changes inside "actions". + UndoRedo works by registering methods and property changes inside "actions". Common behavior is to create an action, then add do/undo calls to functions or property changes, then committing the action. - Here's an example on how to add an action to the Godot editor's own [UndoRedo], from a plugin: + Here's an example on how to add an UndoRedo action: [codeblocks] [gdscript] - var undo_redo = get_undo_redo() # Method of EditorPlugin. + var undo_redo = UndoRedo.new() func do_something(): pass # Put your code here. @@ -20,8 +20,8 @@ func _on_my_button_pressed(): var node = get_node("MyNode2D") undo_redo.create_action("Move the node") - undo_redo.add_do_method(self, "do_something") - undo_redo.add_undo_method(self, "undo_something") + undo_redo.add_do_method(do_something) + undo_redo.add_undo_method(undo_something) undo_redo.add_do_property(node, "position", Vector2(100,100)) undo_redo.add_undo_property(node, "position", node.position) undo_redo.commit_action() @@ -31,7 +31,7 @@ public override void _Ready() { - _undoRedo = GetUndoRedo(); // Method of EditorPlugin. + _undoRedo = new UndoRedo(); } public void DoSomething() @@ -58,6 +58,7 @@ [/codeblocks] [method create_action], [method add_do_method], [method add_undo_method], [method add_do_property], [method add_undo_property], and [method commit_action] should be called one after the other, like in the example. Not doing so could lead to crashes. If you don't need to register a method, you can leave [method add_do_method] and [method add_undo_method] out; the same goes for properties. You can also register more than one method/property. + If you are making an [EditorPlugin] and want to integrate into the editor's undo history, use [EditorUndoRedoManager] instead. </description> <tutorials> </tutorials> @@ -83,6 +84,14 @@ <param index="0" name="object" type="Object" /> <description> Register a reference for "do" that will be erased if the "do" history is lost. This is useful mostly for new nodes created for the "do" call. Do not use for resources. + [codeblock] + var node = Node2D.new() + undo_redo.create_action("Add node") + undo_redo.add_do_method(add_child.bind(node)) + undo_redo.add_do_reference(node) + undo_redo.add_undo_method(remove_child.bind(node)) + undo_redo.commit_action() + [/codeblock] </description> </method> <method name="add_undo_method"> @@ -106,6 +115,14 @@ <param index="0" name="object" type="Object" /> <description> Register a reference for "undo" that will be erased if the "undo" history is lost. This is useful mostly for nodes removed with the "do" call (not the "undo" call!). + [codeblock] + var node = $Node2D + undo_redo.create_action("Remove node") + undo_redo.add_do_method(remove_child.bind(node)) + undo_redo.add_undo_method(add_child.bind(node)) + undo_redo.add_undo_reference(node) + undo_redo.commit_action() + [/codeblock] </description> </method> <method name="clear_history"> diff --git a/doc/classes/Viewport.xml b/doc/classes/Viewport.xml index e76f805e3c..8d92616d6f 100644 --- a/doc/classes/Viewport.xml +++ b/doc/classes/Viewport.xml @@ -76,6 +76,7 @@ <param index="0" name="type" type="int" enum="Viewport.RenderInfoType" /> <param index="1" name="info" type="int" enum="Viewport.RenderInfo" /> <description> + Returns rendering statistics of the given type. See [enum RenderInfoType] and [enum RenderInfo] for options. </description> </method> <method name="get_screen_transform" qualifiers="const"> @@ -165,6 +166,7 @@ <return type="void" /> <param index="0" name="text" type="String" /> <description> + Helper method which calls the [code]set_text()[/code] method on the currently focused [Control], provided that it is defined (e.g. if the focused Control is [Button] or [LineEdit]). </description> </method> <method name="push_unhandled_input"> diff --git a/editor/renames_map_3_to_4.cpp b/editor/renames_map_3_to_4.cpp index cb885b45e4..c31d274225 100644 --- a/editor/renames_map_3_to_4.cpp +++ b/editor/renames_map_3_to_4.cpp @@ -134,6 +134,7 @@ const char *RenamesMap3To4::enum_renames[][2] = { { "PAUSE_MODE_STOP", "PROCESS_MODE_PAUSABLE" }, // Node { "RENDER_DRAW_CALLS_IN_FRAME", "RENDER_TOTAL_DRAW_CALLS_IN_FRAME" }, // Performance { "RENDER_OBJECTS_IN_FRAME", "RENDER_TOTAL_OBJECTS_IN_FRAME" }, // Performance + { "SOURCE_GEOMETRY_NAVMESH_CHILDREN", "SOURCE_GEOMETRY_ROOT_NODE_CHILDREN" }, // NavigationMesh { "TEXTURE_TYPE_2D_ARRAY", "TEXTURE_LAYERED_2D_ARRAY" }, // RenderingServer { "TEXTURE_TYPE_CUBEMAP", "TEXTURE_LAYERED_CUBEMAP_ARRAY" }, // RenderingServer { "TRACKER_LEFT_HAND", "TRACKER_HAND_LEFT" }, // XRPositionalTracker @@ -309,6 +310,7 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = { { "get_endian_swap", "is_big_endian" }, // File { "get_error_string", "get_error_message" }, // JSON { "get_filename", "get_scene_file_path" }, // Node -- WARNING: This may be used in a lot of other places. + { "get_final_location", "get_final_position" }, // NavigationAgent2D, NavigationAgent3D { "get_focus_neighbour", "get_focus_neighbor" }, // Control { "get_follow_smoothing", "get_position_smoothing_speed" }, // Camera2D { "get_font_types", "get_font_type_list" }, // Theme @@ -328,6 +330,8 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = { { "get_importer_name", "_get_importer_name" }, // EditorImportPlugin { "get_interior_ambient", "get_ambient_color" }, // ReflectionProbe { "get_interior_ambient_energy", "get_ambient_color_energy" }, // ReflectionProbe + { "get_item_navmesh", "get_item_navigation_mesh" }, // MeshLibrary + { "get_item_navmesh_transform", "get_item_navigation_mesh_transform" }, // MeshLibrary { "get_iterations_per_second", "get_physics_ticks_per_second" }, // Engine { "get_last_mouse_speed", "get_last_mouse_velocity" }, // Input { "get_layer_mask_bit", "get_layer_mask_value" }, // VisualInstance3D @@ -336,11 +340,14 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = { { "get_metakey", "is_meta_pressed" }, // InputEventWithModifiers { "get_mid_height", "get_height" }, // CapsuleMesh { "get_motion_remainder", "get_remainder" }, // PhysicsTestMotionResult2D + { "get_nav_path", "get_current_navigation_path" }, // NavigationAgent2D, NavigationAgent3D + { "get_nav_path_index", "get_current_navigation_path_index" }, // NavigationAgent2D, NavigationAgent3D { "get_neighbor_dist", "get_neighbor_distance" }, // NavigationAgent2D, NavigationAgent3D { "get_network_connected_peers", "get_peers" }, // Multiplayer API { "get_network_master", "get_multiplayer_authority" }, // Node { "get_network_peer", "get_multiplayer_peer" }, // Multiplayer API { "get_network_unique_id", "get_unique_id" }, // Multiplayer API + { "get_next_location", "get_next_path_position" }, // NavigationAgent2D, NavigationAgent3D { "get_ok", "get_ok_button" }, // AcceptDialog { "get_oneshot", "get_one_shot" }, // AnimatedTexture { "get_option_visibility", "_get_option_visibility" }, // EditorImportPlugin @@ -379,6 +386,7 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = { { "get_surface_material_count", "get_surface_override_material_count" }, // MeshInstance3D { "get_tab_disabled", "is_tab_disabled" }, // Tab { "get_tab_hidden", "is_tab_hidden" }, // Tab + { "get_target_location", "get_target_position" }, // NavigationAgent2D, NavigationAgent3D { "get_text_align", "get_text_alignment" }, // Button { "get_theme_item_types", "get_theme_item_type_list" }, // Theme { "get_timer_process_mode", "get_timer_process_callback" }, // Timer @@ -387,6 +395,7 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = { { "get_unit_db", "get_volume_db" }, // AudioStreamPlayer3D { "get_unit_offset", "get_progress_ratio" }, // PathFollow2D, PathFollow3D { "get_use_in_baked_light", "is_baking_navigation" }, // GridMap + { "get_verts_per_poly", "get_vertices_per_polygon" }, // NavigationMesh { "get_v_scrollbar", "get_v_scroll_bar" }, // ScrollContainer { "get_visible_name", "_get_visible_name" }, // EditorImportPlugin { "get_window_layout", "_get_window_layout" }, // EditorPlugin @@ -467,6 +476,9 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = { { "property_list_changed_notify", "notify_property_list_changed" }, // Object { "recognize", "_recognize" }, // ResourceFormatLoader { "regen_normalmaps", "regen_normal_maps" }, // ArrayMesh + { "region_bake_navmesh", "region_bake_navigation_mesh" }, // Navigation3DServer + { "region_set_navmesh", "region_set_navigation_mesh" }, // Navigation3DServer + { "region_set_navpoly", "region_set_navigation_polygon" }, // Navigation2DServer { "remove_animation", "remove_animation_library" }, // AnimationPlayer { "remove_color_override", "remove_theme_color_override" }, // Control { "remove_constant_override", "remove_theme_constant_override" }, // Control @@ -522,6 +534,8 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = { { "set_invert_faces", "set_flip_faces" }, // CSGPrimitive3D { "set_is_initialized", "_is_initialized" }, // XRInterface { "set_is_primary", "set_primary" }, // XRInterface + { "set_item_navmesh", "set_item_navigation_mesh" }, // MeshLibrary + { "set_item_navmesh_transform", "set_item_navigation_mesh_transform" }, // MeshLibrary { "set_iterations_per_second", "set_physics_ticks_per_second" }, // Engine { "set_layer_mask_bit", "set_layer_mask_value" }, // VisualInstance3D { "set_margins_preset", "set_offsets_preset" }, // Control @@ -554,6 +568,7 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = { { "set_surface_material", "set_surface_override_material" }, // MeshInstance3D -- Breaks ImporterMesh. { "set_tab_align", "set_tab_alignment" }, // TabContainer { "set_tangent", "surface_set_tangent" }, // ImmediateGeometry -- Breaks SurfaceTool. + { "set_target_location", "set_target_position" }, // NavigationAgent2D, NavigationAgent3D { "set_text_align", "set_text_alignment" }, // Button { "set_timer_process_mode", "set_timer_process_callback" }, // Timer { "set_translation", "set_position" }, // Node3D -- This breaks GLTFNode, but it is used rarely. @@ -561,6 +576,7 @@ const char *RenamesMap3To4::gdscript_function_renames[][2] = { { "set_unit_db", "set_volume_db" }, // AudioStreamPlayer3D { "set_unit_offset", "set_progress_ratio" }, // PathFollow2D, PathFollow3D { "set_uv2", "surface_set_uv2" }, // ImmediateMesh -- Breaks SurfaceTool. + { "set_verts_per_poly", "set_vertices_per_polygon" }, // NavigationMesh { "set_v_drag_enabled", "set_drag_vertical_enabled" }, // Camera2D { "set_valign", "set_vertical_alignment" }, // Label { "set_window_layout", "_set_window_layout" }, // EditorPlugin @@ -717,6 +733,7 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = { { "GetEnabledFocusMode", "GetFocusMode" }, // BaseButton { "GetEndianSwap", "IsBigEndian" }, // File { "GetErrorString", "GetErrorMessage" }, // JSON + { "GetFinalLocation", "GetFinalPosition" }, // NavigationAgent2D, NavigationAgent3D { "GetFocusNeighbour", "GetFocusNeighbor" }, // Control { "GetFollowSmoothing", "GetPositionSmoothingSpeed" }, // Camera2D { "GetFontTypes", "GetFontTypeList" }, // Theme @@ -736,6 +753,8 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = { { "GetImporterName", "_GetImporterName" }, // EditorImportPlugin { "GetInteriorAmbient", "GetAmbientColor" }, // ReflectionProbe { "GetInteriorAmbientEnergy", "GetAmbientColorEnergy" }, // ReflectionProbe + { "GetItemNavmesh", "GetItemMavigationMesh" }, // MeshLibrary + { "GetItemNavmeshTransform", "GetItemNavigationMeshTransform" }, // MeshLibrary { "GetIterationsPerSecond", "GetPhysicsTicksPerSecond" }, // Engine { "GetLastMouseSpeed", "GetLastMouseVelocity" }, // Input { "GetLayerMaskBit", "GetLayerMaskValue" }, // VisualInstance3D @@ -744,11 +763,14 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = { { "GetMetakey", "IsMetaPressed" }, // InputEventWithModifiers { "GetMidHeight", "GetHeight" }, // CapsuleMesh { "GetMotionRemainder", "GetRemainder" }, // PhysicsTestMotionResult2D + { "GetNavPath", "GetCurrentNavigationPath" }, // NavigationAgent2D, NavigationAgent3D + { "GetNavPathIndex", "GetCurrentNavigationPathIndex" }, // NavigationAgent2D, NavigationAgent3D { "GetNeighborDist", "GetNeighborDistance" }, // NavigationAgent2D, NavigationAgent3D { "GetNetworkConnectedPeers", "GetPeers" }, // Multiplayer API { "GetNetworkMaster", "GetMultiplayerAuthority" }, // Node { "GetNetworkPeer", "GetMultiplayerPeer" }, // Multiplayer API { "GetNetworkUniqueId", "GetUniqueId" }, // Multiplayer API + { "GetNextLocation", "GetNextPathPosition" }, // NavigationAgent2D, NavigationAgent3D { "GetOneshot", "GetOneShot" }, // AnimatedTexture { "GetOk", "GetOkButton" }, // AcceptDialog { "GetOptionVisibility", "_GetOptionVisibility" }, // EditorImportPlugin @@ -784,6 +806,7 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = { { "GetSurfaceMaterialCount", "GetSurfaceOverrideMaterialCount" }, // MeshInstance3D { "GetTabDisabled", "IsTabDisabled" }, // Tab { "GetTabHidden", "IsTabHidden" }, // Tab + { "GetTargetLocation", "GetTargetPosition" }, // NavigationAgent2D, NavigationAgent3D { "GetTextAlign", "GetTextAlignment" }, // Button { "GetThemeItemTypes", "GetThemeItemTypeList" }, // Theme { "GetTimerProcessMode", "GetTimerProcessCallback" }, // Timer @@ -792,6 +815,7 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = { { "GetUnitDb", "GetVolumeDb" }, // AudioStreamPlayer3D { "GetUnitOffset", "GetProgressRatio" }, // PathFollow2D, PathFollow3D { "GetUseInBakedLight", "IsBakingNavigation" }, // GridMap + { "GetVertsPerPoly", "GetVerticesPerPolygon" }, // NavigationMesh { "GetVScrollbar", "GetVScrollBar" }, // ScrollContainer { "GetVisibleName", "_GetVisibleName" }, // EditorImportPlugin { "GetWindowLayout", "_GetWindowLayout" }, // EditorPlugin @@ -868,6 +892,9 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = { { "PropertyListChangedNotify", "NotifyPropertyListChanged" }, // Object { "Recognize", "_Recognize" }, // ResourceFormatLoader { "RegenNormalmaps", "RegenNormalMaps" }, // ArrayMesh + { "RegionBakeNavmesh", "region_bake_navigation_mesh" }, // Navigation3DServer + { "RegionSetNavmesh", "RegionSetNavigationMesh" }, // Navigation3DServer + { "RegionSetNavpoly", "RegionSetNavigationPolygon" }, // Navigation2DServer { "RemoveAnimation", "RemoveAnimationLibrary" }, // AnimationPlayer { "RemoveColorOverride", "RemoveThemeColorOverride" }, // Control { "RemoveConstantOverride", "RemoveThemeConstantOverride" }, // Control @@ -919,6 +946,8 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = { { "SetInteriorAmbientEnergy", "SetAmbientColorEnergy" }, // ReflectionProbe { "SetIsInitialized", "_IsInitialized" }, // XRInterface { "SetIsPrimary", "SetPrimary" }, // XRInterface + { "SetItemNavmesh", "SetItemNavigationMesh" }, // MeshLibrary + { "SetItemNavmeshTransform", "SetItemNavigationMeshTransform" }, // MeshLibrary { "SetIterationsPerSecond", "SetPhysicsTicksPerSecond" }, // Engine { "SetLayerMaskBit", "SetLayerMaskValue" }, // VisualInstance3D { "SetMarginsPreset", "SetOffsetsPreset" }, // Control @@ -950,6 +979,7 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = { { "SetSurfaceMaterial", "SetSurfaceOverrideMaterial" }, // MeshInstance3D -- Breaks ImporterMesh. { "SetTabAlign", "SetTabAlignment" }, // TabContainer { "SetTangent", "SurfaceSetTangent" }, // ImmediateGeometry -- Breaks SurfaceTool. + { "SetTargetLocation", "SetTargetPosition" }, // NavigationAgent2D, NavigationAgent3D { "SetTextAlign", "SetTextAlignment" }, // Button { "SetTimerProcessMode", "SetTimerProcessCallback" }, // Timer { "SetTonemapAutoExposure", "SetTonemapAutoExposureEnabled" }, // Environment @@ -958,6 +988,7 @@ const char *RenamesMap3To4::csharp_function_renames[][2] = { { "SetUnitDb", "SetVolumeDb" }, // AudioStreamPlayer3D { "SetUnitOffset", "SetProgressRatio" }, // PathFollow2D, PathFollow3D { "SetUv2", "SurfaceSetUv2" }, // ImmediateMesh -- Breaks SurfaceTool. + { "SetVertsPerPoly", "SetVerticesPerPolygon" }, // NavigationMesh { "SetVDragEnabled", "SetDragVerticalEnabled" }, // Camera2D { "SetValign", "SetVerticalAlignment" }, // Label { "SetWindowLayout", "_SetWindowLayout" }, // EditorPlugin @@ -1091,6 +1122,8 @@ const char *RenamesMap3To4::gdscript_properties_renames[][2] = { { "margin_right", "offset_right" }, // Control -- Breaks NinePatchRect, StyleBox. { "margin_top", "offset_top" }, // Control -- Breaks NinePatchRect, StyleBox. { "mid_height", "height" }, // CapsuleMesh + { "navpoly", "navigation_polygon" }, // NavigationRegion2D + { "navmesh", "navigation_mesh" }, // NavigationRegion3D { "neighbor_dist", "neighbor_distance" }, // NavigationAgent2D, NavigationAgent3D { "octaves", "fractal_octaves" }, // OpenSimplexNoise -> FastNoiseLite { "offset_h", "drag_horizontal_offset" }, // Camera2D @@ -1101,6 +1134,7 @@ const char *RenamesMap3To4::gdscript_properties_renames[][2] = { { "out_of_range_mode", "max_polyphony" }, // AudioStreamPlayer3D { "pause_mode", "process_mode" }, // Node { "physical_scancode", "physical_keycode" }, // InputEventKey + { "polygon_verts_per_poly", "polygon_vertices_per_polyon" }, // NavigationMesh { "popup_exclusive", "exclusive" }, // Window { "proximity_fade_enable", "proximity_fade_enabled" }, // Material { "rect_position", "position" }, // Control @@ -1131,6 +1165,7 @@ const char *RenamesMap3To4::gdscript_properties_renames[][2] = { { "table_hseparation", "table_h_separation" }, // Theme { "table_vseparation", "table_v_separation" }, // Theme { "tangent", "orthogonal" }, // Vector2 + { "target_location", "target_position" }, // NavigationAgent2D, NavigationAgent3D { "toplevel", "top_level" }, // Node { "translation", "position" }, // Node3D { "unit_db", "volume_db" }, // AudioStreamPlayer3D @@ -1186,6 +1221,8 @@ const char *RenamesMap3To4::csharp_properties_renames[][2] = { { "MarginRight", "OffsetRight" }, // Control -- Breaks NinePatchRect, StyleBox. { "MarginTop", "OffsetTop" }, // Control -- Breaks NinePatchRect, StyleBox. { "MidHeight", "Height" }, // CapsuleMesh + { "Navpoly", "NavigationPolygon" }, // NavigationRegion2D + { "Navmesh", "NavigationMesh" }, // NavigationRegion3D { "NeighborDist", "NeighborDistance" }, // NavigationAgent2D, NavigationAgent3D { "Octaves", "FractalOctaves" }, // OpenSimplexNoise -> FastNoiseLite { "OffsetH", "DragHorizontalOffset" }, // Camera2D @@ -1227,6 +1264,7 @@ const char *RenamesMap3To4::csharp_properties_renames[][2] = { { "TableHseparation", "TableHSeparation" }, // Theme { "TableVseparation", "TableVSeparation" }, // Theme { "Tangent", "Orthogonal" }, // Vector2 + { "TargetLocation", "TargetPosition" }, // NavigationAgent2D, NavigationAgent3D { "Toplevel", "TopLevel" }, // Node { "Translation", "Position" }, // Node3D { "UnitDb", "VolumeDb" }, // AudioStreamPlayer3D diff --git a/misc/dist/linux/org.godotengine.Godot.xml b/misc/dist/linux/org.godotengine.Godot.xml index 2f06bb3639..d4452018c4 100644 --- a/misc/dist/linux/org.godotengine.Godot.xml +++ b/misc/dist/linux/org.godotengine.Godot.xml @@ -1,5 +1,5 @@ <?xml version="1.0"?> -<mime-info xmlns="https://specifications.freedesktop.org/shared-mime-info-spec"> +<mime-info xmlns="http://www.freedesktop.org/standards/shared-mime-info"> <mime-type type="application/x-godot-project"> <comment>Godot Engine project</comment> <sub-class-of type="text/plain"/> diff --git a/modules/gdscript/doc_classes/@GDScript.xml b/modules/gdscript/doc_classes/@GDScript.xml index 13d223b0d9..b05de11882 100644 --- a/modules/gdscript/doc_classes/@GDScript.xml +++ b/modules/gdscript/doc_classes/@GDScript.xml @@ -486,7 +486,7 @@ <param index="1" name="prefix" type="String" default="""" /> <description> Define a new group for the following exported properties. This helps to organize properties in the Inspector dock. Groups can be added with an optional [param prefix], which would make group to only consider properties that have this prefix. The grouping will break on the first property that doesn't have a prefix. The prefix is also removed from the property's name in the Inspector dock. - If no [param prefix] is provided, the every following property is added to the group. The group ends when then next group or category is defined. You can also force end a group by using this annotation with empty strings for parameters, [code]@export_group("", "")[/code]. + If no [param prefix] is provided, then every following property will be added to the group. The group ends when then next group or category is defined. You can also force end a group by using this annotation with empty strings for parameters, [code]@export_group("", "")[/code]. Groups cannot be nested, use [annotation @export_subgroup] to add subgroups within groups. See also [constant PROPERTY_USAGE_GROUP]. [codeblock] diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp index ab5b054bb3..89bb1b5c65 100644 --- a/scene/3d/physics_body_3d.cpp +++ b/scene/3d/physics_body_3d.cpp @@ -2032,8 +2032,8 @@ void CharacterBody3D::_bind_methods() { ADD_GROUP("Moving Platform", "platform_"); ADD_PROPERTY(PropertyInfo(Variant::INT, "platform_on_leave", PROPERTY_HINT_ENUM, "Add Velocity,Add Upward Velocity,Do Nothing", PROPERTY_USAGE_DEFAULT), "set_platform_on_leave", "get_platform_on_leave"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "platform_floor_layers", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_platform_floor_layers", "get_platform_floor_layers"); - ADD_PROPERTY(PropertyInfo(Variant::INT, "platform_wall_layers", PROPERTY_HINT_LAYERS_2D_PHYSICS), "set_platform_wall_layers", "get_platform_wall_layers"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "platform_floor_layers", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_platform_floor_layers", "get_platform_floor_layers"); + ADD_PROPERTY(PropertyInfo(Variant::INT, "platform_wall_layers", PROPERTY_HINT_LAYERS_3D_PHYSICS), "set_platform_wall_layers", "get_platform_wall_layers"); ADD_GROUP("Collision", ""); ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "safe_margin", PROPERTY_HINT_RANGE, "0.001,256,0.001,suffix:m"), "set_safe_margin", "get_safe_margin"); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index 30bac0f58c..0560b9f2e4 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -1385,7 +1385,7 @@ void TextEdit::_notification(int p_what) { ts_caret.l_caret.position.y += ts_caret.l_caret.size.y; ts_caret.l_caret.size.y = caret_width; } - if (ts_caret.l_caret.position.x >= TS->shaped_text_get_size(rid).x) { + if (Math::ceil(ts_caret.l_caret.position.x) >= TS->shaped_text_get_size(rid).x) { ts_caret.l_caret.size.x = font->get_char_size('m', font_size).x; } else { ts_caret.l_caret.size.x = 3 * caret_width; |