Merge pull request #81655 from nlupugla/editor-interface-can-popup-dialogs

Expose `SceneTreeDialog` and `PropertySelector` via `EditorInterface`
This commit is contained in:
Rémi Verschelde
2024-02-08 10:53:13 +01:00
3 changed files with 154 additions and 0 deletions

View File

@ -48,6 +48,8 @@ class EditorSettings;
class FileSystemDock;
class Mesh;
class Node;
class PropertySelector;
class SceneTreeDialog;
class ScriptEditor;
class SubViewport;
class Texture2D;
@ -60,6 +62,17 @@ class EditorInterface : public Object {
static EditorInterface *singleton;
// Editor dialogs.
PropertySelector *property_selector = nullptr;
SceneTreeDialog *node_selector = nullptr;
void _node_selected(const NodePath &p_node_paths, const Callable &p_callback);
void _node_selection_canceled(const Callable &p_callback);
void _property_selected(const String &p_property_name, const Callable &p_callback);
void _property_selection_canceled(const Callable &p_callback);
void _call_dialog_callback(const Callable &p_callback, const Variant &p_selected, const String &p_context);
// Editor tools.
TypedArray<Texture2D> _make_mesh_previews(const TypedArray<Mesh> &p_meshes, int p_preview_size);
@ -111,6 +124,12 @@ public:
String get_current_feature_profile() const;
void set_current_feature_profile(const String &p_profile_name);
// Editor dialogs.
void popup_node_selector(const Callable &p_callback, const TypedArray<StringName> &p_valid_types = TypedArray<StringName>());
// Must use Vector<int> because exposing Vector<Variant::Type> is not supported.
void popup_property_selector(Object *p_object, const Callable &p_callback, const PackedInt32Array &p_type_filter = PackedInt32Array());
// Editor docks.
FileSystemDock *get_file_system_dock() const;