Commit Graph

52878 Commits

Author SHA1 Message Date
Ryan Roden-Corrent 6cd227a35c Correct superclass constructors in 3to4.
Fixes #70542.

The 3to4 conversion tool was not handling superclass constructors.
We should translate the godot3 syntax:

```gdscript
func _init(a,b,c).(a,b,c):
    pass

func _init(a,b,c):
    super(a,b,c)
```

Originally, the _init conversion was intended to remove `void` return types from _init functions, as this was disallowed due to #50589.
As that was resolved by #53366, I removed that part of the conversion logic. If a void return type is present on a constructor, the converter now leaves it.

Here's a sample diff from my own project:

```diff
@@ -103,10 +105,11 @@ class Real:
 class Text:
        extends Setting

-       var choices: PoolStringArray
-       var value: String setget set_value, get_value
+       var choices: PackedStringArray
+       var value: String : get = get_value, set = set_value

-       func _init(section: String, key: String, default: String, choice_list: Array).(section, key, default) -> void:
+       func _init(section: String, key: String, default: String, choice_list: Array) -> void:
+               super(section, key, default)
                choices = choice_list

        func normalize(val):
@@ -129,9 +132,10 @@ class Text:
 class Boolean:
        extends Setting

-       var value: bool setget set_value, get_value
+       var value: bool : get = get_value, set = set_value

-       func _init(section: String, key: String, default: bool).(section, key, default) -> void:
+       func _init(section: String, key: String, default: bool) -> void:
+               super(section, key, default)
                pass
```

(cherry picked from commit 53a00abb11)
2023-03-13 21:19:53 +01:00
Ryan Roden-Corrent 1421838ba7 Don't strip whitespace when converting 3to4.
Fixes #74204.

The style guide says

> Always use one space around operators and after commas

The 3to4 conversion tool currently strips space in certain scenarios.
I've updated it to add space whenever it is generating new code.
In any case where it substitutes existing code, it leaves it as-is.

For example, connect(a,b,c) becomes `connect(a, callable(b, c))`, because the converter is adding new commads/parens.

However, `xform(Vector3(a,b,c))` becomes `Transform * Vector3(a,b,c)` because it uses the user's original Vector3 string whole. If the user originally had `xform(Vector3(a, b, c))`, then it becomes `Transform * Vector3(a, b, c)`.

Ideally we'd always preserve original formatting, but this seems quite difficult, so I tried to preserve it where we can, but air on the side of following the style guide whenever we're transforming code.

(cherry picked from commit d3684e662f)
2023-03-13 21:18:53 +01:00
Yuri Sizov 30e81fcc26
Merge pull request #74866 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.1) - 1st batch
2023-03-13 16:58:31 +01:00
Ninni Pipping 857cd853de Fix TileSetEditor paiting texture_origin Vector2i
(cherry picked from commit fb317546fe)
2023-03-13 14:52:22 +01:00
Raul Santos 1640b1a150 C#: Always show "Create C# solution" option
Prevents ending up with an empty C# menu.
The option to create the C# solution no longer disappears, to avoid confusing users.
If an user tries to use it when a C# solution already exists they are warned that it will override their sln and csproj files.

(cherry picked from commit a1a2fc2255)
2023-03-13 14:50:57 +01:00
Haoyu Qiu 093d237138 Fix dock name lost translation after layout change
* After you click in the dock select panel
* After you load an editor layout

(cherry picked from commit 43bf0ca8d2)
2023-03-13 14:49:17 +01:00
bruvzg 764fe8ac51 Automatically reparent editor message dialogs to avoid error spam.
(cherry picked from commit 921f3b7589)
2023-03-13 14:48:33 +01:00
SaracenOne d929784491 Stop toaster notification circle flickering when notifications are all hidden.
(cherry picked from commit ab61624c78)
2023-03-13 14:47:14 +01:00
Niels Drost 94db7f866b TileSet editor was out of sync with TileMap and incorrectly overwrote old selected TileSet after an edit call with a null pointer.
(cherry picked from commit 66374c8dce)
2023-03-13 14:45:26 +01:00
Danil Alexeev f4ea9df0f4 Fix GDScript code style regarding colon
(cherry picked from commit ea5fd3d732)
2023-03-13 14:42:27 +01:00
Isaac Clerencia acdb1bdbd7 Clarify Thread documentation
The current documentation uses the term "running" for two different things.

In the description of get_id() it claims "it will return empty string if the thread is not running", but it actually will return the thread id until wait_to_finish is called.

In the description of is_alive() it claims "it will return true if the thread is running", but in this case it means "the provided function hasn't finished running yet".

Updated the functions documentation slighly to make this clear.

(cherry picked from commit 2a4f38d54f)
2023-03-13 14:41:26 +01:00
Aaron Franke 9e6f0ee9c7 Document GLTFNode and some of GLTFState
(cherry picked from commit 2cc22fb964)
2023-03-13 14:40:30 +01:00
BrunoSXS 3aa3fb8771 Fix for AABB methods with wrong description
(cherry picked from commit df0de07494)
2023-03-13 14:38:17 +01:00
kobewi 9997250051 Discourage reusing Tweens
(cherry picked from commit 9785b23a0a)
2023-03-13 14:34:08 +01:00
themancalledjakob e043484d36 improve documentation for Font and FontVariation
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
(cherry picked from commit fb5c2d9f75)
2023-03-13 14:33:24 +01:00
Andreas Raddau a026669cc5 Fixed minor typo in turbulence documentation
(cherry picked from commit c618f9fce2)
2023-03-13 14:30:21 +01:00
kobewi 4bd16e6493 Safeguard Makefile commands
(cherry picked from commit d29030fdd0)
2023-03-13 14:29:23 +01:00
JustKoi ed139593bf Fix small mistake in Window.xml
Fix small mistake in Window.xml

(cherry picked from commit 7f8425d6fb)
2023-03-13 14:28:35 +01:00
George Marques b880bde10f Remove outdated note about const in Dictionary and Array docs
(cherry picked from commit d2b1d6e69b)
2023-03-13 14:27:48 +01:00
Haoyu Qiu 80cde341d4 Fix various typos in the classref
(cherry picked from commit 03fcac3aa5)
2023-03-13 14:27:06 +01:00
titus125 8732a8af47 Fixed typos in the Transform2D and Transform3D class reference
(cherry picked from commit 36270d39d2)
2023-03-13 14:26:29 +01:00
Ninni Pipping 8dca093d97 Document `editor/naming/scene_name_casing` setting
Moved definitions of editor related project settings to `editor/register_editor_types.cpp` to make documentation work.

(cherry picked from commit 3de5332fcb)
2023-03-13 14:25:46 +01:00
Malcolm Nixon 5180116c07 Fix null-pointer dereference on Android systems when using gl_compatibility renderer.
(cherry picked from commit d186b7438f)
2023-03-13 14:22:45 +01:00
RedworkDE 0112862e70 C#: Fix crash when errors occur before language initialization.
(cherry picked from commit c0ebc28136)
2023-03-13 14:21:06 +01:00
Yuri Sizov 234c601a61 Improve logic related to editing audio buses (and prevent crashes)
(cherry picked from commit 68c18c0e2b)
2023-03-13 14:19:41 +01:00
Yuri Sizov 3c2e952889 Prevent crashing on startup if project has scripted theme types
Also avoid order of operation conflicts by moving C# binding generation hook to main.cpp

(cherry picked from commit 8402927d3f)
2023-03-13 14:18:32 +01:00
bruvzg d83245f2f9 [TextServer] Add invalid font scaling check, restrict Linux/BSD system fonts lookup to TrueType/CFF only.
(cherry picked from commit 8d501a2dc3)
2023-03-13 14:17:42 +01:00
Yuri Sizov 048c252602 Prevent cache corruption when saving resources in the editor
(cherry picked from commit 496bd94c21)
2023-03-13 14:16:13 +01:00
Hayden Leete 7490f89238 Fix crash when revealing file in floating FileSystem Dock
When selecting "Show in FileSystem" from the context menu of a resource
in the inspector, the engine would crash if the FileSystem dock was
floating because it was trying to focus the FileSystem tab, but floating
docks don't use Tab Containers. This commit makes the FileSystem dock's
window grab focus instead if it's floating.

(cherry picked from commit c4d1513e15)
2023-03-13 14:15:18 +01:00
Paweł Fertyk 41f4068a6e Fix RichTextLabel crash with out of bound exception
Fixes #68242.

(cherry picked from commit 44592c8c19)
2023-03-13 14:13:36 +01:00
Yuri Sizov 755a86f502 Generate empty textures for theme icons if the SVG module is disabled
(cherry picked from commit 64215ad119)
2023-03-13 14:12:44 +01:00
Haoyu Qiu 2d0d07f51b Fix crash when dumping extension API in a non-writable directory
(cherry picked from commit 49400e0c1c)
2023-03-13 14:11:24 +01:00
clayjohn 5662542526 Avoid copying CanvasTexture when updating proxy
(cherry picked from commit 84482ef90b)
2023-03-13 14:10:38 +01:00
bruvzg 1d21652f80 [Linux/X11] Check if required xkb functions exist before using it.
(cherry picked from commit 8a675f3824)
2023-03-13 14:08:31 +01:00
Nicholas Huelin f55c61d601 Modify the default theme GraphNode close_h_offset
Modifies the close_h_offset to be 12 instead of 22. This better aligns the default position.

(cherry picked from commit 961d6763fb)
2023-03-13 14:06:08 +01:00
bruvzg 466d226a4a [TextServer] Ensure ICU data is initialised only one and cleaned only at exit.
(cherry picked from commit 7f24433e15)
2023-03-13 14:04:41 +01:00
Abdulrahman Al Zeidi e290448fe3 Fix glTF mesh importer not freeing nodes correctly on import
(cherry picked from commit 5e0641ea9a)
2023-03-13 14:00:38 +01:00
Yuri Sizov eb503fb461
Merge pull request #74750 from YuriSizov/project-manager-lighten-up-4.0
[4.0] Ensure that editor color map is initialized in the project manager
2023-03-13 13:48:33 +01:00
Yuri Sizov 671f8eb790 Ensure that editor color map is initialized in the project manager 2023-03-11 02:04:54 +01:00
Haoyu Qiu 17a130cbd1
Fix "Convert Full Project" button not translated
Also fixes a typo in the CHANGELOG.

(cherry picked from commit e03bfd6f7f)
2023-03-06 10:10:02 +01:00
Rémi Verschelde 47114a77f8
CI: Pin SCons to 4.4.0, the new 4.5.0 is broken
(cherry picked from commit 85bb561713)
2023-03-06 10:08:43 +01:00
Rémi Verschelde 284a1b6a6e
Bump version to 4.0.1-rc 2023-03-01 14:09:30 +01:00
Rémi Verschelde 92bee43adb
Bump version to 4.0-stable \o/
4 years of development.
12,000 merged pull requests.
7,000 fixed issues.
1,500 individual contributors across engine and docs.

The Godot 4.0 release is by all metrics our biggest release so far.
No stone has been left unturned, all parts of the engine have been
modernized, refactored, overhauled, rewritten, redesigned.

Our work is far from done. Many areas still have significant known issues,
and will require focused work from all willing contributors to fix blocking
bugs, implement missing features, optimize for performance or compatibility,
and improve the user experience.

But Godot 4.0 marks the start of the new, modern Godot Engine, and a solid
foundation for us all to build upon. Future 4.x releases will come with a
much faster cadence, enabling us to iterate quickly on new features and
improvements to what we already provide.

To all of you who were involved in making Godot 4.0 what it is today, however
big or small your contributions were:

THANK YOU!

This was a massive undertaking, and you all participated in unique and
wonderful ways to build a free and open source game engine for everyone to
use and enjoy. You are breathtaking! <3
2023-03-01 01:38:07 +01:00
Rémi Verschelde 5f5bef1306
Update CHANGELOG.md for 4.0 release
We couldn't hope to complete an in-depth curated changelog for such
a massive release, so we simply link to our in-depth release notes :)

Also adds back the 3.3, 3.4, and 3.5 curated changelogs. Those were
released from the 3.x branch so theoretically do not share a common
history with 4.0 (which started development after 3.2), but in practice
users will still perceive 4.0 as the natural upgrade to 3.5.
2023-03-01 01:29:51 +01:00
Rémi Verschelde 2f34a35722
i18n: Sync translations with Weblate 2023-03-01 00:11:39 +01:00
Rémi Verschelde 491ded1898
Minor typo and docs URL fixes 2023-02-28 13:38:01 +01:00
Rémi Verschelde 0bc36c8954
Merge pull request #74072 from akien-mga/sync-gamecontrollerdb
Sync controller mappings DB with SDL2 community repo
2023-02-27 21:38:00 +01:00
Rémi Verschelde e757bb3d97
Merge pull request #74063 from groud/fix_crash_glb_import
Fix a crash in the GLB importer
2023-02-27 21:37:33 +01:00
Rémi Verschelde 2fcd1885f2
Merge pull request #73890 from jtnicholl/mesh_docs
Update documentation for Mesh and MeshInstance3D
2023-02-27 21:36:22 +01:00
Gilles Roudière 1a2caf28e3 Fix a crash in the GLB importer 2023-02-27 17:24:03 +01:00