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
```
Pretty hacky solution but it's better than an infinite loop.
All this import setup needs to be redone, it's very difficult to properly
bail out from an invalid import without triggering reimport loops.
Also fix underline not visible at default editor scale in LinkButton.
Fixes#73319.
* Avoid "property not found" warnings when adding a file for the first
time.
* When no file is added, disable the Generate POT button instead of
printing a warning.
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.
This is now required after #72031 when using HDRs.
Could have further cleanup as I think these import options may not be needed
at all anymore, and etc/etc2 support doesn't seem to make much sense.
Likewise, the hardcoded "s3tc" in `get_platform_features` could maybe be
removed. But this is material for after 4.1.
Fixes#73789.
Implements create_convex_shape in ImpoterMesh.
Note: ImporterMeshInstance3D::get_mesh() is safe.
The only dangerous function with side effects is ImpoterMesh::get_mesh()
Solves incorrect defaults, as well as applied scale failing to apply.
The default values are removed, and they differ from collision shape defaults
These values must match the defaults defined in resource_importer_scene.cpp
The project manager can now only create projects that use a rendering
method compatible with the current platform. Rendering methods that
are disabled at build-time are also grayed out (only for OpenGL).
While it is possible in theory to create a project using Forward+
on web (thanks to the automatic fallback),
it will look different once edited on a desktop platform.
Since they are postponed sometimes due to transient script errors, it
needs to try again without the cache to compile the script again
instead of using the failed one.
- Import must rename nodes/root_type="Spatial" to "Node3D":
- Resolves ownership issues with calling:
scene->replace_by(base_node);
when the original root type was Spatial.
This is more of a workaround than a fix.
The underlying issue is that `ConfirmationDialog` doesn't always update its size
if you change its text. (or it updates it AFTER it had already popped up).
`wrap_controls` doesn't help here.
Recent changes in Godot cause the theme editor to become hidden when
editing a child resource. This causes a crash when editing style box
resources marked as "main styles" (= leading styleboxes in the code), as
they try to reference the currently edited theme.
This commit works around the issue by permitting the Theme Editor to
keep a reference to the most recently edited Theme. Furthermore, it adds
an assertion to avoid a similar crash in the future.
Long-term, the workaround should probably be removed when the theme editor
is fixed to remain visible while editing child resources, but I'd keep
the assertion.
Having local_space enabled when starting a transform changed the
behavior of VIEW space transforms. Now we disable local_space when
starting a blender transform (there was already logic to restore the
setting after the transform ends).
This also hides the gizmo while performing a blender transform,
otherwise the user will see it snap back and forth between the local and
global alignment. I think the transform looks cleaner with the gizmo
hidden anyways.
Fixes#59392.
Generally moves comments and some entries around, as well as fixing typos and miscellaneous inconsistencies.
To go more in detail on a few things:
- In comments, separate between class names and notes with "--";
- In comments, replace all "broke" with "-- Breaks"
- Moves `@GlobalScope` constants to its own group in `enum_renames`
- Move `{ "remove", "remove_at" },` underneath the Builtin Types methods.
- Move C#'s `AddNode3dGizmoPlugin` to where it should be, in alphabetical order.
- Give more details to some class renames.
- Comments out `remove` -> `remove_at`
Prevents recursion when importing files due to the ill nature of EditorProgress.
The progress dialog will have to be entirely rewritten after 4.0 is out due to it being a constant source of bugs.
In the meantime, this fixes the problem.
Fixes#53871. Supersedes #73159.
* Description of `ui_text_submit` action should be "Submit Text" instead of "Text Submitted".
* Spell out "Animation" instead of using "Anim.".
* Treat "Max" as regular word instead of writing "Max.".
* Use generic "Set %s" for action name instead of a dedicated "Set target_position".
* Add translator comment for:
* "Inclusive" and "Self" in the profiler.
* Places where it needs the context about being an editor progress label.
* "Duplicated Animation Name" since it's refering to the new name of a duplicated animation.
* Disambiguation of "View Plane Transform", "Paste Selects" and "Display Normal".
* Fix wrong undo action name for renaming an input action.
* Fix missing end quote in a shader error message.
* In class reference:
* Fix duplicated "if" in the description of `signf()`.
* Fix mismatched example output in `String.operator %()`.
* Fix typo in the description of `Decal.texture_emission`.
* Unify description of `String.match()` and `StringName.match()`.
Fix bugs if 2 selections were on same line.
Fix bugs when selection ended at new line.
Make carets stay in place after operation and on undo.
Affects: delete lines, move lines, toggle comments, bookmarks and breakpoints.
- Migrates the existing cache to the standard theme cache struct
- Moves some parts of the codebase to use cache instead of ad-hoc fetching
- Adds hooks to editor settings previously missing from theme regeneration
Fix a bug where scattering could be set to e.g. 0.9 but a tile would still always be placed, as the check rand > 0.9 would be run on every mouse movement until it was successful.
It's a bit hacky as the choice mainly impacts the main setting, but there are
pre-existing overrides which supersede it. We should treat this checkbox as
the highest allowed rendering method, and replace the ones which would be
higher end (here replace `mobile` with the chosen `gl_compatibility`).
This allows properly limiting what features depend on the RegEx module
(doing the actual conversion) and what features only require the renames
data (GDScript suggestions).
Also better excludes the conversion command line options when actually
disabling deprecated code.
Fixes#73029.
- Remove WIP translation templates, moved to godot-editor-l10n which
will be the source and target for Weblate contributions.
* https://github.com/godotengine/godot-editor-l10n
- Re-add translations with a high completion ratio, stripped of the
untranslated and fuzzy strings, and of the location and translator
comments, to keep the size lower.
* Threshold editor interface: 20% complete.
* Threshold properties: 20% complete.
* Threshold classes: 10% complete.
1. `number_width` isn't used later
2. `return_type` is used only once
3. AudioServer::get_singleton()->get_channel_count() always returns a channel_count of 1 or larger
4. negative `aa->backward` conditional
5. `current_canvas` == `find_world_2d()->get_canvas()`
6. identical if `render_shadows`
- Separate editor interface and property translations.
- Add property translation in TranslationServer.
- The split and merge of the POT/PO/Makefiles and extract scripts is done
directly in godot-editor-l10n, the files will be removed in the next commit.
- Remove the hardcoded "to_include" lists from the SCsub, we'll only commit the
files which are ready to inclue.