godot-module-template/editor
Wilson Kazuo Mizutani b400633dc2 Show detach script button when added via inspector
Fixes #107059.

The SceneTreeDock was not tracking script changes in selected nodes in any capacity as far as I could assess. To do
that, my solution essentially connects the "script_changed" signal from selected nodes to
"SceneTreeDock::_update_script_button()" whenever the selection changes. It actually queues the update to make sure it
happens only once no matter how many nodes are selected.

However, only connecting that signal would leave previously selected nodes with a signal connection that should no
longer exist. To properly disconnect previously selected nodes, we have to store the list of currently selected nodes so
we can disconnect them when the selection changes.

The commit also includes some improvements to the SceneTreeDock class:

1. Remove unnecessary initialization in SceneTreeDock

This field is already initialized in the line that declares it. As such, initializing it on the constructor as well as
is redundant.

2. Queue script button updates in scene tree dock

Since we now have the option to defer the script button update and make sure it only runs once per frame, it's always
best to use the queued version of the update from a performance perspective. I'm not entirely sure if there could be any
unexpected side effects but it is a minor self-contained UI update, so it's likely a relatively safe change.

The replacement includes the bindings since it is a requirement for the other replacements in the class to work
(UndoRedo needs their method names registered in the class DB). It should be OK to remove the old non-queued bindings
too even though they are accessible in the public API because it is a "unofficial" method starting with an underscore.
2025-07-17 13:09:50 -03:00
..
animation Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
asset_library Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
audio Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
debugger Editor: Fix crash when specifying --debug-server 2025-07-15 07:31:31 +10:00
doc Disable tooltip fitting if FEATURE_SELF_FITTING_WINDOWS is available 2025-07-15 11:44:56 +02:00
docks Show detach script button when added via inspector 2025-07-17 13:09:50 -03:00
export Merge pull request #108478 from KoBeWi/phantom_paths 2025-07-14 10:30:42 -05:00
file_system Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
gui Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
icons Allow toggling UID display in path properties 2025-06-16 15:46:50 +02:00
import Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
inspector Merge pull request #108478 from KoBeWi/phantom_paths 2025-07-14 10:30:42 -05:00
plugins Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
project_manager Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
project_upgrade Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
run Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
scene [SpriteFramesEditor] Decompress texture before auto slicing sprite sheet. 2025-07-17 10:51:44 +03:00
script Fix some Text Editor theme issues and clean up 2025-07-15 13:43:30 -04:00
settings Merge pull request #108463 from kitbdev/fix-text-theme-issues 2025-07-16 11:27:52 -05:00
shader Add minimum scale to shader list 2025-07-15 15:01:52 +05:30
themes Fix some Text Editor theme issues and clean up 2025-07-15 13:43:30 -04:00
translations Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
version_control Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
editor_builders.py SCons: Begin decoupling generation & build code 2025-04-25 08:23:01 -05:00
editor_data.cpp Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
editor_data.h Add class icon cache to EditorNode 2025-05-27 13:59:13 +02:00
editor_interface.compat.inc
editor_interface.cpp Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
editor_interface.h Revert "Rework scene preview thumbnails" 2025-06-21 00:05:57 +02:00
editor_log.cpp Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
editor_log.h Change editor button focus mode to FOCUS_ACCESSIBILITY. 2025-06-08 15:53:27 +03:00
editor_main_screen.cpp Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
editor_main_screen.h Improve 2D/3D main screen auto-switching logic 2025-04-09 09:34:44 -07:00
editor_node.cpp Merge pull request #108396 from timothyqiu/editor-title 2025-07-09 11:33:12 -05:00
editor_node.h Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
editor_string_names.h Always use String as StringName backing internally. 2025-04-23 14:57:03 +02:00
editor_undo_redo_manager.compat.inc Allow undoredo actions to not make history unsaved 2025-05-13 02:40:31 +02:00
editor_undo_redo_manager.cpp Fix crash when checking unsaved history 2025-05-15 22:37:57 +02:00
editor_undo_redo_manager.h Allow undoredo actions to not make history unsaved 2025-05-13 02:40:31 +02:00
register_editor_types.cpp Move remaining 3D files to 3D folder and move physics gizmos to their own physics folder. 2025-07-11 18:46:13 +03:00
register_editor_types.h Style: Replace header guards with #pragma once 2025-03-07 17:33:47 -06:00
SCsub Editor: Restructure editor code 2025-07-04 18:18:22 +02:00
template_builders.py SCons: Make builders prettier, utilize constexpr 2025-03-11 18:31:20 -05:00