Before this change, the SceneTree had methods named “change_scene” and
“change_scene_to”. One of them accepted a String as a parameter and the
other accepted a PackedScene, but you couldn’t tell which one was which
just by looking at their names.
This change renames those two methods to “change_scene_to_file” and
“change_scene_to_packed”. These new names came from this suggestion [1].
These new names make the difference between the two methods more clear
and hint at the fact that there’s more than one change_scene method.
[1]: <https://github.com/godotengine/godot/issues/27640#issuecomment-1081870955>
Fixes#27640.
With the introduction of Scene Unique Nodes, `is_unique_in_owner`, "Unique Name in Scene" and other descriptions related to the feature, the second parameter of add_child() and add_simbling() could be misunderstood to be related, at first glance.
"less" should be used for quantity, rather than "lesser".
Existing scripts that use `or_lesser` in `_get_property_list()`
will need to be updated to account for this change.
This allows light sources to be specified in physical light units in addition to the regular energy multiplier. In order to avoid loss of precision at high values, brightness values are premultiplied by an exposure normalization value.
In support of Physical Light Units this PR also renames CameraEffects to CameraAttributes.
Affects a lot of classes. Very thoroughly checked signal connections and deferred calls to this method, add_do_method/add_undo_method calls, and so on.
Also renames the internal `_update_callback()` to `_redraw_callback()` for consistency.
Just a few comments have also been changed to say "redraw".
In CPUParticles2D, there was a private variable with the same name. It has been renamed to `do_redraw`.
This reverts commit 4b817a565c.
Fixes#64988.
Fixes#64997.
This caused several regressions (#64988, #64997,
https://github.com/godotengine/godot/issues/64997#issuecomment-1229970605)
which point at a flaw in the current logic:
- `Control::NOTIFICATION_ENTER_TREE` triggers a *deferred* notification with
`NOTIFCATION_THEME_CHANGED` as introduced in #62845.
- Some classes use their `THEME_CHANGED` to cache theme items in
member variables (e.g. `style_normal`, etc.), and use those member
variables in `ENTER_TREE`, `READY`, `DRAW`, etc. Since the `THEME_CHANGE`
notification is now deferred, they end up accessing invalid state and this
can lead to not applying theme properly (e.g. for EditorHelp) or crashing
(e.g. for EditorLog or CodeEdit).
So we need to go back to the drawing board and see if `THEME_CHANGED` can be
called earlier so that the previous logic still works?
Or can we refactor all engine code to make sure that:
- `ENTER_TREE` and similar do not depend on theme properties cached in member
variables.
- Or `THEME_CHANGE` does trigger a general UI update to make sure that any
bad theme handling in `ENTER_TREE` and co. gets fixed when `THEME_CHANGE`
does arrive for the first time. But that means having a temporary invalid
(and possibly still crashing) state, and doing some computations twice
which might be heavy (e.g. `EditorHelp::_update_doc()`).