Commit graph

55 commits

Author SHA1 Message Date
Micky
33092b6f45 Expose and warn about Node Filters in Scene Tree Dock
Adds "Filter by Type" and "Filter by Group" in the Scene Tree Dock's MenuButton.
Hovering on them displays an useful tooltip.
When selecting these items, the matching parameter is appended to the terms, and the caret is automatically brought to the end.

When typing a filter that cannot be identified, a warning icon is displayed. The reason is explained as a tooltip.

The same options are also quickly available by right-clicking or middle-clicking in the text field.
2022-10-06 13:36:40 +02:00
Tomasz Chabora
882a4f8906 Port remaining connections to callable_mp 2022-09-18 13:08:54 +02:00
Micky
1c4095a66a Improve Scene Tree Dock's Node filter (Allow multiple terms & more)
- Allows more than one parameter to be passed in the "Filter Node" search box, each term separated by spaces.
- Grays out any parent Node not matching the search, but still having to be there because a child is.
- Adds a `group:` filter. It matches any Node belonging to the passed group. If no argument is passed, it matches all Nodes belonging to any group. It also ignores groups used internally, and its alias is `g`.
2022-09-09 13:40:29 +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
kobewi
ece3df3938 Add per-scene UndoRedo 2022-08-22 18:05:10 +02: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
Chia-Hsiang Cheng
83d478ffcd Disable the OK button when no node is selected. 2022-07-14 12:03:27 +08:00
kobewi
b923cc8f13 Optimize SceneTreeEditor filtering 2022-05-24 18:07:18 +02:00
trollodel
307427af89 Add the button pressed to some signals in Tree 2022-05-21 17:16:52 +02:00
reduz
45af29da80 Add a new HashSet template
* Intended to replace RBSet in most cases.
* Optimized for iteration speed
2022-05-20 22:40:38 +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
reduz
8580f377a3 Implement Scene Unique Nodes
Implements https://github.com/godotengine/godot-proposals/issues/4096

* Nodes can be marked unique to the scene in the editor (or via code).
* Unique nodes can be accessed via the **%** prefix at any point in the path. From that point in the path (depending on whether the scene of the path is), the unique node will be fetched.
* Implementation is very optimal, as these nodes are cached.
2022-04-25 12:19:17 +02:00
Rémi Verschelde
f8ab79e68a Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been
assigned something valid by comparing to nullptr.
2022-04-04 19:49:50 +02:00
Aaron Franke
918b09cabc
Initialize bools in the headers in editor 2022-03-12 13:34:06 -06:00
Hendrik Brucker
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Yuri Roubinsky
5003d4351e Fix theming update in several editor classes 2022-01-16 14:49:03 +03:00
Rémi Verschelde
fe52458154
Update copyright statements to 2022
Happy new year to the wonderful Godot community!
2022-01-03 21:27:34 +01:00
Marcel Admiraal
87a4ba492e Remove unimplemented methods 2021-10-21 18:44:25 +01:00
kobewi
e401cd58f1 Add option to not expand tree on node select 2021-08-12 00:36:56 +02:00
Silc 'Tokage' Renew
32640edac7 Revert "Fix duplicate selection in SceneTree"
This reverts commit 7d20d78847.

# Conflicts:
#	editor/scene_tree_editor.cpp
2021-07-23 17:34:21 +09:00
reduz
7d20d78847 Fix duplicate selection in SceneTree
* It seems both cell_selected and multi_selected were being triggered,
* This caused inspector updating twice.
* cell_selected connection and callback were removed.

This may be a bug in Godot 3.x too, recommend checking.
2021-07-17 13:35:28 -03:00
reduz
90056460ad Implement Particle Trails
-Enable the trails and set the length in seconds
-Provide a mesh with a skeleton and a skin
-Or, alternatively use one of the built-in TubeTrailMesh/RibbonTrailMesh
-Works deterministically
-Fixed particle collisions (were broken)
-Not working in 2D yet (that will happen next)
2021-04-30 17:38:02 -03:00
Hugo Locurcio
5d124c4a8f
Remove uses of auto for better readability and online code reviews
The current code style guidelines forbid the use of `auto`.

Some uses of `auto` are still present, such as in UWP code (which
can't be currently tested) and macros (where removing `auto` isn't
easy).
2021-04-26 14:59:28 +02:00
Dominik 'dreamsComeTrue' Jasiński
08a45ebfba Make Animation's SceneTreeDialog filter nodes properly 2021-03-19 22:30:32 +01:00
reduz
083aa9b95e Refactor Process Mode
Implements https://github.com/godotengine/godot-proposals/issues/1835#issuecomment-727186192

* PauseMode is now ProcessMode, containing the following states:
	```
	PROCESS_MODE_INHERIT, // same as parent node
	PROCESS_MODE_NORMAL, // process only if not paused
	PROCESS_MODE_PAUSE_ONLY, // process only if paused
	PROCESS_MODE_ALWAYS, // process always
	PROCESS_MODE_DISABLED, // never process
	```
* NOTIFICATION_PAUSED and NOTIFICATION_UNPAUSED are received effectively when the node is paused and unpaused (not any longer when pause mode is set in SceneTree).
* Renamed some nodes that used ProcessMode/process_mode to specify a callback type to ProcessCallback to avoid clashes.
2021-02-18 20:39:55 -03:00
Pedro J. Estébanez
ef062b1c37 Keep selected node visible after filter change
(Implemented both for the local and remote scene tree docks.)
2021-02-08 02:19:14 +01:00
Rémi Verschelde
b5334d14f7
Update copyright statements to 2021
Happy new year to the wonderful Godot community!

2020 has been a tough year for most of us personally, but a good year for
Godot development nonetheless with a huge amount of work done towards Godot
4.0 and great improvements backported to the long-lived 3.2 branch.

We've had close to 400 contributors to engine code this year, authoring near
7,000 commit! (And that's only for the `master` branch and for the engine code,
there's a lot more when counting docs, demos and other first-party repos.)

Here's to a great year 2021 for all Godot users 🎆
2021-01-01 20:19:21 +01:00
Tomasz Chabora
2c048ea164 Cleanup unused engine code 2020-12-09 12:12:36 +01:00
reduz
127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
Stijn Hinlopen
526e060b73 Resize dialogs (FileDialog, EditorFileDialog, Reparent, SceneTreeDialog and resource depency dialogs). 2020-07-14 14:35:22 +02:00
Rémi Verschelde
0be6d925dc Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to
will now be changed automatically to remove the first empty line.

This makes us lean closer to 1TBS (the one true brace style) instead
of hybridating it with some Allman-inspired spacing.

There's still the case of braces around single-statement blocks that
needs to be addressed (but clang-format can't help with that, but
clang-tidy may if we agree about it).

Part of #33027.
2020-05-14 16:54:55 +02:00
Rémi Verschelde
a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
IAmActuallyCthulhu
82b9557803
Remove redundant author doc comments 2019-08-12 04:26:38 -05:00
unknown
8934a26565 Added filter to SceneTreeDialog 2019-07-06 22:41:47 +05:30
Michael Alexsander Silva Dias
31218a07de Improve conections dialog 2019-06-06 02:40:20 -03:00
PouleyKetchoupp
3f174c86d0 Fixed scene tree update after changing node name in tool script 2019-05-24 15:27:22 +02:00
Juan Linietsky
9f4b5a91c0 Reorganized connection dialog for much improved ease of use.
-Removed dest path field
-Added a "Source" signal
-Added an "Advanced" button to hide complexity
-Fix bug on Tree to make sure "ensure visible" works on hidden trees
-Fix bug on TextEdit to ensure signals created with script not open sill focus the right line
2019-04-11 23:23:24 -03:00
Michael Alexsander Silva Dias
73aaf06be7 Cleanup relationship line coding after 5f079e2 2019-03-06 14:33:26 -03:00
Rémi Verschelde
b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Rémi Verschelde
277b24dfb7 Make core/ includes absolute, remove subfolders from include path
This allows more consistency in the manner we include core headers,
where previously there would be a mix of absolute, relative and
include path-dependent includes.
2018-09-12 09:52:22 +02:00
Juan Linietsky
eeab3502d5 Changes to how node paths are selected from property, allowing setting a hint. 2018-06-27 20:50:25 -03:00
Juan Linietsky
b659fd6d74 Entirely new (and much improved) animation editor. 2018-06-07 12:52:00 -03:00
volzhs
bcb24a0bb7 Respect visibility change by Scene dock when using Sync Scene Changes
Fix #18757 with keeping a feature introduced at 8343c9fbd
2018-05-15 23:13:48 +09:00
Rémi Verschelde
3fd4a35ce6
Merge pull request #15235 from sersoong/master-batchtoggle
Enhanced Toggle Visibility button in scene tree editor
2018-02-18 17:20:15 +01:00
Rémi Verschelde
e4213e66b2 Add missing copyright headers and fix formatting
Using `misc/scripts/fix_headers.py` on all Godot files.
Some missing header guards were added, and the header inclusion order
was fixed in the Bullet module.
2018-01-05 01:22:23 +01:00
sersoong
8343c9fbd9 Enhanced Toggle Visibility button 2018-01-04 09:01:51 +08:00
Rémi Verschelde
b50a9114b1 Update copyright statements to 2018
Happy new year to the wonderful Godot community!
2018-01-01 14:40:47 +01:00
Dmitry Koteroff
b8b5bb6577 Scene Tree Dock: added ability to deselect items when clicking on empty space 2017-11-26 18:30:48 +03:00
Rémi Verschelde
bd282ff43f Use HTTPS URL for Godot's website in the headers 2017-08-27 14:16:55 +02:00