Commit Graph

209 Commits

Author SHA1 Message Date
Haoyu Qiu e5c321448e Create AudioStreamPlayer when dropping AudioStream
- Create AudioStreamPlayer if dropped in between nodes in the Scene dock
- Create AudioStreamPlayer2D if dropped into 2D editor
- Create AudioStreamPlayer3D if dropped into 3D editor
2024-05-19 20:26:04 +08:00
Aaron Franke 1bcbbe96c4
Organize existing code for editor plugins 2024-04-27 11:59:58 -07:00
kobewi f8cd3bbc36 Add temporary pivot for rotating multiple 2D nodes 2024-04-26 11:03:47 +02:00
Aaron Franke 6dd4a68797
Reorganize some code to have 2D things grouped together 2024-04-13 02:56:50 -07:00
Rémi Verschelde a658621cc5
Merge pull request #89264 from ryevdokimov/don't-update-snap-every-scan
Move `snap_controls_to_pixels` from process to projects settings changed method
2024-03-08 13:09:46 +01:00
Robert Yevdokimov f99de3f024 Move `snap_controls_to_pixels` from process to projects settings changed method 2024-03-07 16:21:23 -05:00
David Luevano Alvarado 71426d0f5c
Fix wrong undo-redo action when dropping files containing circular dependencies 2024-03-07 12:20:49 -06:00
jsjtxietian b047206619 Update lock and group button state when selection changed 2024-03-06 10:24:18 +08:00
Rémi Verschelde 6d8ca17139
Merge pull request #88829 from ryevdokimov/institate_message-2d
Show instantiating or inherit message when using drag to instantiate in 2D
2024-02-27 10:18:17 +01:00
Robert Yevdokimov 8875ff0a14 Show instantiating or inherit message when using to drag to instantiate in 2D 2024-02-27 01:09:13 -05:00
Muller-Castro 1638c1b28f Add const lvalue ref to editor/* container parameters 2024-02-26 15:28:15 -03:00
Robert Yevdokimov ecc8493e17 Remove unused prev_rot variable 2024-01-18 11:24:22 -05:00
Muller-Castro 96a95cb974 Add const lvalue ref to container parameters 2024-01-05 14:49:57 -03:00
J. N. Witch d832f62a01 Introduce a "Gizmos" submenu for toggling visibility of gizmos in 2D editor
instead of standalone checkboxes like "Show Group And Lock Gizmos".

Add option to toggle visibility of Position gizmos.
2023-10-25 12:41:37 +00:00
Rémi Verschelde 5a74ce9a56
Merge pull request #81557 from YuriSizov/editor-toolbars-divided
Improve the looks of 2D/3D viewport contextual toolbars
2023-09-14 23:40:33 +02:00
Yuri Sizov f542dffb39 Improve the looks of 2D/3D viewport contextual toolbars 2023-09-13 13:04:55 +02:00
Rémi Verschelde 3e68ed0ca1
Merge pull request #81255 from JohnGabrielUK/primary-line-separate-xy
Allow configuring primary line X/Ys separately
2023-09-12 12:01:15 +02:00
John Gabriel 984eb96c43 Allow configuring primary line X/Ys separately 2023-09-12 10:24:07 +01:00
Yuri Sizov fc01e2e7f6 Add a theme preview switcher to the 2D viewport
This commit adds a new View submenu that allows switching
between the project theme (default), the editor theme, and
the default theme. The last selected option is stored per
project and is restored when reloading the project.
2023-09-06 19:40:43 +02:00
kobewi 0d8f8d7054 Simplify making texture nodes in 2D editor 2023-08-19 00:17:34 +02:00
Hendrik Brucker a29a680920 Extract StyleBoxFlat, StyleBoxTexture and StyleBoxLine in their own file 2023-07-17 13:25:00 +02:00
kobewi b8a136c385 Add Center View button to 2D editor 2023-05-31 12:56:18 +02:00
Yuri Sizov 49d7041d34 Decouple EditorInterface from EditorPlugin
- Simplify some includes in the process.
- Also exposes EditorInterface.movie_maker_enabled as a property.
2023-04-17 21:59:09 +02:00
kobewi 45b47d5584 Properly remember snapping options per-project 2023-03-09 21:12:26 +01:00
Rémi Verschelde 540b17874e
Merge pull request #73685 from Calinou/textureregion-polygon-editors-default-pot-grid-size
Use 8×8 default grid size for TextureRegion and 2D polygon editors
2023-03-03 11:03:17 +01:00
bruvzg cebfc02d6f
Revert "Reordering emitted signals in PopupMenu" and fix editor selection issue in the safer way. 2023-02-24 21:17:05 +02:00
Hugo Locurcio 0f73ef1df9
Use 8×8 default grid size for TextureRegion and 2D polygon editors
Power-of-two grid sizes are more suited to most game assets.
2023-02-21 17:02:24 +01:00
Gilles Roudière a3b431b09d Add gesture to ViewPanner and simplify a bit its API 2023-01-23 16:43:53 +01:00
Rémi Verschelde d065281bc0
Merge pull request #59081 from Sauermann/fix-cursorshape-canvasitemeditor
Use get_cursor_shape for identifying the cursor shape in CanvasItemEditor
2023-01-23 12:26:35 +01:00
VolTer 1fa5597520 Fix the Frame Selection functionality 2023-01-12 19:13:00 +02: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
trollodel c90d0bd84f Use forward-declarations in big editor classes 2022-11-29 09:59:43 +01:00
Markus Sauermann 3b14f0334c Remove redundant Variant-types initializations 2022-11-14 19:35:19 +01:00
trollodel ba9e619b51 Use forward-declarations in EditorPlugin where possible 2022-11-11 20:25:51 +01:00
Markus Sauermann 69fca9286f Use get_cursor_shape for identifying the cursor shape in CanvasItemEditor
get_cursor_shape() is used in cases where a Control displays different cursors in different areas.
There is no need to set the default cursor shape on every mouse move event.
2022-11-03 19:34:43 +01:00
kobewi 15831e381b Unify usage of undo_redo in editor 2022-11-02 17:51:58 +01:00
kobewi bee0b7e583 Redraw 2D viewport when scene changes 2022-10-14 00:22:46 +02:00
Tomasz Chabora 882a4f8906 Port remaining connections to callable_mp 2022-09-18 13:08:54 +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
Aaron Record 4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 -06:00
Micky 59e11934d8 Rename `str2var` to `str_to_var` and similar
Affects the Math class, a good chunk of the audio code, and a lot of other miscellaneous classes, too.

- `var2str` -> `var_to_str`
- `str2var` -> `str_to_var`
- `bytes2var` -> `bytes_to_var`
- `bytes2var_with_objects` -> `bytes_to_var_with_objects`
- `var2bytes` -> `var_to_bytes`
- `var2bytes_with_objects` -> `var_to_bytes_with_objects`
- `linear2db` -> `linear_to_db`
- `db2linear` -> `db_to_linear`
- `deg2rad` -> `deg_to_rad`
- `rad2deg` -> `rad_to_deg`

- `dict2inst` -> `dict_to_inst`
- `inst2dict` -> `inst_to_dict`
2022-08-26 14:58:22 +02:00
kobewi ece3df3938 Add per-scene UndoRedo 2022-08-22 18:05:10 +02:00
SnailRhymer 0ac971c0d3 Fix default values for rotation snapping in canvas_item_editor_plugin.cpp
Default values for snap_rotation_step and snap_rotation_offset were transposed. Swap them back.
2022-07-30 20:05:24 +01:00
Rémi Verschelde 90019676b0 Code quality: Fix header guards consistency
Adds `header_guards.sh` bash script, used in CI to validate future
changes. Can be run locally to fix invalid header guards.
2022-07-25 11:17:40 +02:00
Yuri Sizov dcd64799ef Use FlowContainer to handle toolbar overflow more gracefully 2022-07-20 20:43:45 +03:00
kobewi 87fb95f1ff Clear drag_selection when drag ends 2022-07-14 14:51:47 +02:00
kobewi 072e2ff659 Show the transform operation numbers in 2D 2022-07-05 13:19:32 +02:00
FireForge 42d1a96904 Add rounded corners to the contextual toolbar
- Move contextual toolbar stylebox to the editor theme because it's the same in the 2D and 3D editors
2022-05-25 15:43:40 -05: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
Rémi Verschelde c273ddc3ee Style: Partially apply clang-tidy's `cppcoreguidelines-pro-type-member-init`
Didn't commit all the changes where it wants to initialize a struct
with `{}`. Should be reviewed in a separate PR.

Option `IgnoreArrays` enabled for now to be conservative, can be
disabled to see if it proposes more useful changes.

Also fixed manually a handful of other missing initializations / moved
some from constructors.
2022-05-02 16:28:25 +02:00