1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add Instant Preview to Quick Open dialog

Add toggle for instant preview

Always keep search box selected so that keyboard navigation works

Add default setting for Instant Preview

Directly set property value for resource via Quick Load menu (no undo/redo or dirty-scene functionality yet)

Add undo/redo functionality

Update class reference

Update doc/classes/EditorSettings.xml

Co-authored-by: Micky <66727710+Mickeon@users.noreply.github.com>

Slight improvement(?) to wording of setting

Allow previewing without committing change

Address various suggestions/improvements

Only allow Instant Preview to be used if Quick Open menu is being used to modify a property

Only allow property-based Quick Load when resource to modify is defined (otherwise default to old behavior)

Apply suggestions from code review

Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>

Address comments/suggestions

Get rid of duplicated code and use original callback strategy

(Attempt to) fix Instant Preview for editing multiple nodes at once and undo/redo stack for single nodes

Fix cancelling Quick Open when multiple nodes are selected

Prevent initially selected item in Quick Open dialog from overwriting the currently selected property

Apply suggestions from code review

Co-authored-by: Tomasz Chabora <kobewi4e@gmail.com>
Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com>

Make a few changes/improvements based on feedback

- Combine some duplicated code into `_finish_dialog_setup()`
- Move `ERR_FAIL_NULL(p_obj);` to top of checks
- Fix renaming of `is_instant_preview_enabled()` across code, and remove now-redundant conditions where it is used
- Make `EditorResourcePicker::property_path` be `StringName` not `String`
This commit is contained in:
Malcolm Anderson
2025-05-29 17:46:37 -07:00
parent 8d8041bd4d
commit 2f1e8dad74
9 changed files with 183 additions and 16 deletions

View File

@@ -361,7 +361,13 @@ void EditorResourcePicker::_edit_menu_cbk(int p_which) {
base_types.push_back(type);
}
EditorNode::get_singleton()->get_quick_open_dialog()->popup_dialog(base_types, callable_mp(this, &EditorResourcePicker::_file_selected));
EditorQuickOpenDialog *quick_open = EditorNode::get_singleton()->get_quick_open_dialog();
if (resource_owner) {
quick_open->popup_dialog_for_property(base_types, resource_owner, property_path, callable_mp(this, &EditorResourcePicker::_file_selected));
} else {
quick_open->popup_dialog(base_types, callable_mp(this, &EditorResourcePicker::_file_selected));
}
} break;
case OBJ_MENU_INSPECT: {