Commit graph

159 commits

Author SHA1 Message Date
Hugo Locurcio
e9f723006a
Use compile-time Unicode string conversion
Thanks to this syntax introduced in C++11, this reduces the amount of work
that needs to be performed at run-time while making the code more terse.
2023-08-07 10:38:16 +02:00
Yuri Sizov
7dbbf2eef9 Merge pull request #79743 from TokageItLab/fix-name-list-asp
Make animation name list scroll to new animation in `SpriteEditor`
2023-07-24 19:33:23 +02:00
Silc Lizard (Tokage) Renew
99451b55c2 Make animation name list scroll to new animation in SpriteEditor
Co-authored-by: DarellLdark <darell.ldark@gmail.com>
2023-07-21 19:36:25 +09:00
Rindbee
e9cd29cf22 Fix rename animation in SpriteFramesEditor/AnimationNodeStateMachineEditor
When the name suffix grows, the old name is used if it is obtained first.

Fix the case where the following error message would appear when renaming
an animation.

```
ERROR: Animation '' doesn't exist.
   at: get_frame_count (scene/resources/sprite_frames.cpp:71)
```
2023-07-18 15:39:02 +08:00
Hendrik Brucker
7e21eb7e00 Extract and reorganize texture resource classes 2023-07-14 20:04:21 +02:00
Rémi Verschelde
4f17a94d69
Merge pull request #74341 from dalexeev/sprite-frames-texture-filter
Use nearest with mipmaps texture filter in SpriteFrames editor plugin
2023-05-22 13:48:18 +02:00
Hakim
9cf2d0f058 Hide Animation Frames section when there are no animations and show message 2023-05-19 01:14:11 +02:00
kleonc
d58e832062 Make SpriteFrames editor toolbar a FlowContainer 2023-05-13 16:00:25 +02:00
Yuri Sizov
4154039832 Improve includes of EditorNode (and everything else)
Also start organizing editor-specific GUI components
into a dedicated folder, `editor/gui`.
Also move `editor_file_server` next to the rest of debugger classes.
2023-04-07 18:59:49 +02:00
Ninni Pipping
83d85048ea Improve SpriteFrameEditor frame addition ordering 2023-03-30 18:56:46 +02:00
Danil Alexeev
2edf1bd76a
Use nearest with mipmaps texture filter in SpriteFrames editor plugin 2023-03-04 08:48:49 +03:00
Eldor Zang
62976659b8
Set default name if SpriteFrames name is empty 2023-02-17 15:29:07 +01:00
Silc Renew
0069131546 Fix ghost SpriteFramesEditor cause crash 2023-02-06 14:08:12 +09:00
Silc Renew
23f566ee1f Fix switching method in SpriteFramesEditor 2023-01-31 19:56:02 +09:00
Danil Alexeev
ca7209aaef
Few improvements for SpriteFrames Editor 2023-01-30 21:14:10 +03:00
Silc Renew
17bf6238fc Make AnimatedSprite's playback API consistent with AnimationPlayer 2023-01-26 12:40:19 +09:00
Rémi Verschelde
28a24639c3
Merge pull request #48570 from Calinou/animation-editors-new-name
Tweak the name for new animations in the editor
2023-01-20 08:50:40 +01:00
Rémi Verschelde
bcaf048f33
Merge pull request #71379 from KoBeWi/destruction_of_compatibility_function
Remove set_drag_forwarding_compat()
2023-01-18 17:40:13 +01:00
kobewi
b58111588a Add EditorUndoRedoManager singleton 2023-01-16 01:11:52 +01:00
kobewi
59ea36b87c Remove set_drag_forwarding_compat() 2023-01-14 15:16:51 +01:00
kobewi
dfc4367a47 Add expand modes to TextureRect 2023-01-12 17:06:03 +01:00
Juan Linietsky
e6a4debede Change set_drag_forwarding() to use callables.
* This solution is much cleaner than the one in 3.x thanks to the use of callables.
* Works without issues in any language (no need to worry about camel or snake case).
* Editor code uses a compatibility function (too much work to redo).

Fixes #59899
2023-01-10 14:09:24 +01:00
Juan Linietsky
2b815df3c1 Use BitField<> in core type masks
* All core types masks are now correctly marked as bitfields.
* The enum hacks in MouseButtonMask and many other types are gone. This ensures that binders to other languages non C++ can actually implement type safe bitmasks.
* Most bitmask operations replaced by functions in BitField<>
* Key is still a problem because its enum and mask at the same time. While it kind of works in C++, this most likely can't be implemented safely in other languages and will have to be changed at some point. Mostly left as-is.
* Documentation and API dump updated to reflect bitfields in core types.
2023-01-08 22:17:40 +01:00
Rémi Verschelde
798582acf0
Merge pull request #65609 from dalexeev/animated-sprite
`AnimatedSprite{2D,3D}` improvements
2023-01-05 15:00:31 +01:00
Rémi Verschelde
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
Danil Alexeev
0d25d8e7fc
AnimatedSprite{2D,3D} improvements
* Add support for individual frame duration to `SpriteFrames`.
* Various minor improvements.
2023-01-05 13:13:25 +03:00
trollodel
c90d0bd84f Use forward-declarations in big editor classes 2022-11-29 09:59:43 +01:00
kobewi
8a3d2f4e0c Cleanup remaining EditorUndoRedoManager usages 2022-11-24 18:56:22 +01:00
Rémi Verschelde
315c64282b
Fix misc formatting issues
Somehow I missed the failing CI report from trailing whitespace.

Fixed a couple typos found by codespell while at it, and misc
trailing semicolons in one of the files.
2022-11-14 19:00:48 +01:00
kleonc
d135957987 SpriteFramesEditor Fix calculating frame index from mouse position 2022-10-30 21:26:58 +01:00
Rémi Verschelde
2ffb609658 Merge pull request #66337 from EricEzaM/sprite-frames
Ensure control built-in shortcuts are matched exactly & add shortcuts for SpriteFrames editor
2022-10-13 15:24:39 +02:00
Eric M
b322b3d649 Add shortcuts for SpriteFrames editor. Small renaming changes for clarity & consistency. 2022-10-13 21:14:59 +10:00
bruvzg
0103af1ddd
Fix MSVC warnings, rename shadowed variables, fix uninitialized values, change warnings=all to use /W4. 2022-10-07 11:32:33 +03:00
Rémi Verschelde
50a6905f2d
Merge pull request #65421 from V-Sekai/spriteframes_read_only 2022-09-14 14:42:18 +02:00
Yuri Sizov
43f03e2ce6 Improve naming of theme properties throughout GUI code
Rename ItemList's bg -> panel
Rename ItemList's bg_focus -> focus
Rename ProgressBar's bg -> background
Rename ProgressBar's fg -> fill
Rename Tree's bg -> panel
Rename Tree's bg_focus -> focus
Rename ScrollContainer's bg -> panel
Rename FileDialog's *_icon_modulate -> *_icon_color
Rename FileDialog's files_disabled -> file_disabled_color
Rename CheckButton's on/off -> checked/unchecked
Rename check_v_adjust -> check_v_offset
2022-09-06 22:53:17 +03:00
SaracenOne
15e2ddbbc0 Add read only mode to SpriteFrames editor. 2022-09-06 14:47:13 +01:00
Micky
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
Rémi Verschelde
fd6453c45e Revert "Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED"
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()`).
2022-08-29 11:11:29 +02:00
Rémi Verschelde
f7f8af232c
Merge pull request #64885 from Mickeon/rename-tooltip-hint
Rename `hint_tooltip` to `tooltip_text` & setter getter
2022-08-28 17:43:01 +02:00
Aaron Record
4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 -06:00
Micky
ef5b9a06a9 Rename hint_tooltip to tooltip_text & setget
`hint_tooltip` -> `tooltip_text`
`set_tooltip` -> `set_tooltip_text`
`_get_tooltip` -> `get_tooltip_text`

Updates documentation, too.
2022-08-27 01:35:01 +02:00
kobewi
ece3df3938 Add per-scene UndoRedo 2022-08-22 18:05:10 +02:00
Juan Linietsky
d4433ae6d3 Remove Signal connect binds
Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind().
Changed all uses of it to Callable.bind()
2022-07-29 16:26:13 +02:00
FireForge
468157bfe0 Capitalize the SpriteFrames search bar placeholder
Follow-up to https://github.com/godotengine/godot/pull/49488
2022-07-18 20:15:50 -05:00
kleonc
a4d8c78e48 SpriteFramesEditor Add animation searchbox 2022-07-18 15:47:12 +02:00
Hugo Locurcio
23dcc3345b
Tweak the name for new animations in the editor
- Use snake_case to "suggest" the naming that fits the Godot style guide.
- Fully spell out "new_animation" since both editors can fit it in full.
- Don't internationalize the new animation name to have consistent
  behavior between both editors.
  - Since the recommendation is to follow snake_case, special characters
    should also be avoided in the name to make animations easier to refer
    to in code.
2022-07-13 19:57:48 +02:00
FireForge
e4067064ce Add ok_button_text to AcceptDialog and cancel_button_text to ConfirmationDialog 2022-07-09 10:47:08 -05:00
Aaron Record
900c676b02 Use range iterators for RBSet in most cases 2022-05-19 12:09:16 +02:00
reduz
746dddc067 Replace most uses of Map by HashMap
* Map is unnecessary and inefficient in almost every case.
* Replaced by the new HashMap.
* Renamed Map to RBMap and Set to RBSet for cases that still make sense
  (order matters) but use is discouraged.

There were very few cases where replacing by HashMap was undesired because
keeping the key order was intended.
I tried to keep those (as RBMap) as much as possible, but might have missed
some. Review appreciated!
2022-05-16 10:37:48 +02:00
Hugo Locurcio
180e5d3028
Remove RES and REF typedefs in favor of spelled out Ref<>
These typedefs don't save much typing compared to the full `Ref<Resource>`
and `Ref<RefCounted>`, yet they sometimes introduce confusion among
new contributors.
2022-05-03 01:43:50 +02:00