Commit Graph

71 Commits

Author SHA1 Message Date
1d40df286b Don't put main properties of AnimatedSprite2D inside a group 2025-06-14 19:20:58 +08:00
8ba4656ea3 Compile out editor-only logic within validate_property in games 2025-06-12 12:54:19 +08:00
ad40939b6f Core: Replace C math headers with C++ equivalents
- Minor restructuring to ensure `math_funcs.h` is the central point for math functions
2025-04-16 15:49:02 -05:00
b106dfd4f9 Base accessibility API. 2025-04-08 20:14:28 +03:00
4f4031a675 Replace size() == 0 with is_empty(). 2025-04-02 19:18:43 +08:00
a1846b27ea Improve use of Ref.is_null/valid
Use `is_null` over `!is_valid` and vice versa.
2024-12-23 16:35:02 -05:00
58e79bfa9a Compile certain CanvasItem._edit_*() functions with DEBUG_ENABLED 2024-11-02 15:43:18 -03:00
194bdde947 Cleanup of raw nullptr checks with Ref
Using `is_valid/null` over checks with `nullptr` or `ERR_FAIL_NULL` etc.
2024-08-31 15:01:09 +02:00
32369d2b6d Fix Issue #94145 Incorrect text in the Node Configuration Warning dialog
Fix some translations

Revert "Fix some translations"

This reverts commit 61e586ef84fb962eefdc14593241c1d8b0fb7b6b.

Revert "Fix Issue #94145 Incorrect text in the Node Configuration Warning dialog"

This reverts commit d0832dc5e7f0657744780cdfc97ed40772ea717c.

msgid

warnings.push_back(RTR("A SpriteFrames resource must be created or set in the \"Sprite Frames\"

revert editor/translations/editor
2024-07-09 22:36:18 +02:00
6b17d51425 Add alternative pixel rounding 2024-06-29 10:33:39 -04:00
dc6e664fda Fix AnimationSprite2D/3D::play using wrong end_frame
On playing a different animation to the current backwards will start the new animation on the last animations last frame not the new ones
2024-06-26 13:50:44 +02:00
413c11357d Use Core/Scene stringnames consistently 2024-05-13 23:41:07 +02:00
a262d2d881 Add shorthand for using singleton string names 2024-05-11 18:53:08 +02:00
955d5affa8 Reduce and prevent unnecessary random-access to List
Random-access access to `List` when iterating is `O(n^2)` (`O(n)` when
accessing a single element)

* Removed subscript operator, in favor of a more explicit `get`
* Added conversion from `Iterator` to `ConstIterator`
* Remade existing operations into other solutions when applicable
2024-05-04 16:08:55 +02:00
cd2032a90b Optimise Object's get_argument_options 2024-02-29 18:00:54 +01:00
21f0529aa9 Revert "Update Node::get_configuration_warnings signature"
This reverts commit d3852deaa4.
2024-02-17 19:03:21 +01:00
35b640107f Stabilize snapping 2D transforms to pixel
Co-authored-by: Danni <34800072+KeyboardDanni@users.noreply.github.com>
2024-02-12 11:04:01 -05:00
d3852deaa4 Update Node::get_configuration_warnings signature 2024-02-08 23:05:20 +01:00
d822fd5322 Merge pull request #86733 from Mickeon/autocompletion-more-animated-sprite
Add autocompletion options for AnimatedSprite's other play methods
2024-01-03 10:15:01 +01:00
d5a7c7818c Add autocompletion options for AnimatedSprite's other play methods 2024-01-03 01:33:08 +01:00
ca2f340384 Fix missing autocompletion for inheriting classes 2024-01-03 00:13:04 +01:00
5b9e67e0a5 Add property change guards to Sprite2D and AnimatedSprite2D 2023-12-16 20:25:35 +02:00
a29416e332 [Scene,Main] Replace ERR_FAIL_COND with ERR_FAIL_NULL where applicable 2023-09-12 12:53:06 +02:00
4d4342e018 Fix AnimatedSprite2D autoplay warning
Changing of autoplay when changing `SpriteFrames` is not done by the
user and warning is unhelpful
2023-03-23 14:31:46 +01:00
fa198c482e Fix AnimatedSprite play() don't redraw immediately 2023-01-29 08:00:42 +09:00
17bf6238fc Make AnimatedSprite's playback API consistent with AnimationPlayer 2023-01-26 12:40:19 +09:00
798582acf0 Merge pull request #65609 from dalexeev/animated-sprite
`AnimatedSprite{2D,3D}` improvements
2023-01-05 15:00:31 +01:00
d95794ec8a One Copyright Update to rule them all
As many open source projects have started doing it, we're removing the
current year from the copyright notice, so that we don't need to bump
it every year.

It seems like only the first year of publication is technically
relevant for copyright notices, and even that seems to be something
that many companies stopped listing altogether (in a version controlled
codebase, the commits are a much better source of date of publication
than a hardcoded copyright statement).

We also now list Godot Engine contributors first as we're collectively
the current maintainers of the project, and we clarify that the
"exclusive" copyright of the co-founders covers the timespan before
opensourcing (their further contributions are included as part of Godot
Engine contributors).

Also fixed "cf." Frenchism - it's meant as "refer to / see".
2023-01-05 13:25:55 +01:00
0d25d8e7fc AnimatedSprite{2D,3D} improvements
* Add support for individual frame duration to `SpriteFrames`.
* Various minor improvements.
2023-01-05 13:13:25 +03:00
aed3822a93 Change return type of get_configuration_warnings to PackedStringArray 2022-09-19 16:43:15 +01:00
213cc7859e Fix outdated warning in AnimatedSprite2D 2022-09-18 02:52:20 +02:00
16d44395b5 Merge pull request #65148 from Mickeon/animated-sprite-negative-speed-scale
Allow negative `speed_scale` in AnimatedSprite2D & 3D
2022-09-16 09:18:42 +02:00
8142bc4ddd Allow negative speed_scale in AnimatedSprite2D & 3D
If the `speed_scale` is set to a negative value, the animation plays in reverse.
The second parameter of `play()` still reverses as before. if `speed_scale` and the second parameter of `play()` is true, the animation plays forward.

Also updates the documentation to better describe the pausing and playing behaviour.
2022-09-13 12:41:07 +02:00
d5c703b83e Don't store frame of playing AnimatedSprite 2022-09-12 22:59:35 +02:00
b648ee43ab Harmonise AnimatedSprite3D and its 2D counterpart
Add the following properties to AnimatedSprite3D:
- `backwards` parameter in `play()`;
- `speed_scale`.

Both classes' internals are more similar, down to the line spacings. They've also been updated to be clearer and less inconsistent (e.g. `!frames.is_valid()` -> `frames.is_null()`, use SceneStringNames instead of CoreStringNames, rename the internal _queue_update to _queue_redraw)
2022-09-09 21:06:24 +02:00
e31bb5ffeb Rename CanvasItem.update() to queue_redraw()
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`.
2022-08-29 14:59:47 +02:00
ae9560af82 Fix AnimatedSprite2D & 3D animation list in inspector 2022-08-26 00:05:58 +02:00
1a24c9e14b Make _validate_property a multilevel method 2022-08-22 18:35:11 +03:00
73ecd71b7d Fix no hint_string for frame property in AnimatedSprites 2022-07-03 15:31:43 +02:00
5dc3bfb80e Use suffixes for units in nodes and resources 2022-05-19 14:34:27 -05:00
d5f5e96e11 Fix AnimatedSprite doesn't emit animation_finished when changing playback direction 2022-05-16 21:03:22 +08:00
312ec612c7 Add autocompletion for AnimatedSprite.play() 2022-05-05 14:36:35 +08:00
7119d355eb String: Remove TTR and DTR defines in non-tools build
This ensures we don't use TTR in runtime code, as it's specifically meant
to source translations for the editor.
2022-03-28 20:26:35 +02:00
3a439a9c03 Fix AnimatedSprite infinite loop 2022-02-28 16:00:45 +08:00
0f5455230c Use switch consistently in _notification (scene folder) 2022-02-15 18:44:55 +01:00
fc27636999 Vectors: Use clear() and has().
Use clear() instead of resize(0).

Use has() instead of "find(p_val) != -1".
2022-02-02 00:11:09 +05:45
fe52458154 Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
4f9b6d9a3f Merge pull request #51235 from AnilBK/awkward-funcs 2021-12-10 16:58:11 +01:00
49403cbfa0 Replace String comparisons with "", String() to is_empty()
Also:
- Adds two stress tests to test_string.h
- Changes to .empty() on std::strings
2021-12-09 04:48:38 -06:00
0c14b930ef Fix _validate_property on AnimatedSprite 2D and 3D 2021-12-08 16:59:11 -06:00