Commit graph

201 commits

Author SHA1 Message Date
Micky
c03377653e Fix selection applying to hidden Nodes when filtering Scene Tree Editor 2022-10-03 18:28:43 +02:00
RedMser
3183b7371d SceneTreeDialog: focus search bar by default 2022-09-23 18:04:48 +02:00
kobewi
3a2abf7486 Automatically use class name for empty renames 2022-09-22 00:43:38 +02:00
Rémi Verschelde
6f5704d86f Merge pull request #65630 from aaronfranke/no-defer-ste-warn-ch
_warning_changed` signal connection
2022-09-19 15:43:23 +02:00
Tomasz Chabora
882a4f8906 Port remaining connections to callable_mp 2022-09-18 13:08:54 +02:00
Aaron Franke
408ed2235b
Don't defer SceneTreeEditor::_warning_changed signal connection 2022-09-10 14:19:29 -05:00
Rémi Verschelde
211631801d
Merge pull request #65352 from Mickeon/try-scene-tree-filter-multi-word 2022-09-09 16:11:45 +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
Micky
65cc721eb9 Fix tool script button color overriding custom type color
Also adds a small note on the tooltip noting the custom type.
2022-09-06 10:14:28 +02:00
Micky
ad5ff9f78f Mark Script button if it's tool in Scene Tree Editor
Also adds a note on the tooltip if the Script is tool.

The color is the same one used on the Script Editor's script list.
2022-09-01 12:29:18 +02:00
Rémi Verschelde
ae349d8227
Merge pull request #64377 from Mickeon/rename-canvas-redraw
Rename `CanvasItem.update()` to `queue_redraw()`
2022-08-30 14:47:41 +02:00
Micky
97f8c9b97c Rename TreeItem's set_tooltip to set_tooltip_text
`set_tooltip` -> `set_tooltip_text`
`get_tooltip` -> `get_tooltip_text`

For consistency:
`get_button_tooltip` -> `get_button_tooltip_text`
And the `tooltip` parameter in `add_button` was renamed to `tooltip_text`
2022-08-30 11:16:23 +02: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
Aaron Record
4b817a565c Remove NOTIFICATION_ENTER_TREE when paired with NOTIFICATION_THEME_CHANGED 2022-08-27 11:52:29 -06:00
Rémi Verschelde
1190fbdf2b
Merge pull request #64733 from Mickeon/try-editor-warning-spacing 2022-08-23 18:16:26 +02:00
Micky
d5f44bffe6 Add spacing after newline on editor warning tooltip 2022-08-23 10:56:38 +02:00
Rémi Verschelde
745e80fa8d
Merge pull request #58377 from MrBBBaiXue/type-filter
Add a way to filter nodes by type in scene tree dock.
2022-08-22 23:34:03 +02:00
kobewi
ece3df3938 Add per-scene UndoRedo 2022-08-22 18:05:10 +02:00
MrBBBaiXue
296640ab8f Add a way to filter nodes by type.
Add a way to filter nodes by type.
Usage:  type:NodeType or t:NodeType

Co-Authored-By: Haoyu Qiu <timothyqiu@users.noreply.github.com>
2022-08-10 00:48:11 +08:00
Rémi Verschelde
db523dd400
Merge pull request #63518 from timothyqiu/window-toggle 2022-08-08 16:13:30 +02:00
Hugo Locurcio
393cf40922
Distinguish multiple node configuration warnings in the scene tree dock
A number of dots is present next to the node configuration icon
warning when there is more than 1 warning.

Co-authored-by: Hendrik Brucker <hendrik.brucker@mail.de>
2022-08-04 02:20:11 +02:00
foxydevloper
1ff9a09e2c Improve tooltips for grouping/ungrouping nodes 2022-07-31 10:56:32 -04: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
Haoyu Qiu
42373df2d4 Add a Window visibility toggle button to the Scene tree 2022-07-27 08:57:45 +08:00
Chia-Hsiang Cheng
83d478ffcd Disable the OK button when no node is selected. 2022-07-14 12:03:27 +08:00
Rindbee
72a768b24f Avoid possibly showing two Dialogs at the same time
Update editor/scene_tree_editor.cpp

Add a comment to explain why

Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
2022-06-21 17:21:04 +08:00
kobewi
d2c8741a69 Fix crash with empty scenes 2022-06-04 00:04:49 +02:00
Rémi Verschelde
26bfaf34dd
Merge pull request #61488 from fire-forge/filter 2022-05-30 02:03:45 +02:00
FireForge
7f7244f04a Use consistent casing in editor filter/search bars 2022-05-28 18:43:16 -05: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
kobewi
379ebe304a Show list of groups in node tooltip 2022-05-12 15:46:16 +02:00
kobewi
1dc7bcc83c Cleanup metadata usage 2022-05-06 00:27:10 +02:00
Rémi Verschelde
0f8ee1d256
Merge pull request #60161 from V-Sekai/instanced_children_color
Make editable children use warning color instead of disabled color
2022-05-05 01:41:27 +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
SaracenOne
e7e4f41004 Make instance's editable children use warning color instead of disabled color 2022-04-11 02:36:20 +01:00
Michael Alexsander
c331a3a614 Fix errors when locking nodes 2022-03-27 16:10:57 -03:00
Aaron Franke
918b09cabc
Initialize bools in the headers in editor 2022-03-12 13:34:06 -06:00
Michael Alexsander
917dac78e7 Replace some bits of code left to work with the new TabContainer 2022-03-04 19:16:33 -03:00
Jakob Bouchard
6553f5c242
Convert _notification methods to switch - Chunk C 2022-02-16 13:03:05 -05:00
Rémi Verschelde
11572c6e30
Editor: Cleanup some includes dependencies
Removes some unnecessary includes from `editor_node.h`, and instead add
those where they're used.

Removes unnecessary `editor_node.h` includes in various editor classes.

Renames `dynamicfont` to `dynamic_font` in a couple files.

Misc cleanup while jumping through that rabbit hole.
2022-02-15 14:54:15 +01:00
Hendrik Brucker
b396fd4eef Improve compilation speed (forward declarations/includes cleanup) 2022-02-12 02:46:22 +01:00
Rémi Verschelde
fc076ece3d
Revert "Add missing SNAME macro optimization to all theme methods call"
This reverts commit a988fad9a0.

As discussed in #57725 and clarified in #57788, `SNAME` is not meant to be used
everywhere but only in critical code paths. For theme methods specifically, it
was by design that only getters use `SNAME` and not setters.
2022-02-08 10:17:25 +01:00
jmb462
a988fad9a0 Add missing SNAME macro optimization to all theme methods call 2022-02-06 23:06:11 +01:00
jmb462
1ce81dc5f2 Add missing SNAME macro optimization in some function calls 2022-02-06 15:54:04 +01:00
kobewi
189dab2d76 Add visibility to CanvasLayer 2022-02-05 14:02:21 +01:00
Wilson E. Alvarez
3eb5e0ac50
Rename String::is_subsequence_ofi to String::is_subsequence_ofn 2022-01-26 18:03:56 -05:00