diff options
author | Guilherme Felipe <guilhermefelipecgs@gmail.com> | 2018-10-05 16:16:55 -0300 |
---|---|---|
committer | Guilherme Felipe <guilhermefelipecgs@gmail.com> | 2018-10-07 10:41:56 -0300 |
commit | a9ec69663fd23ab15e5211588fb0fcf56bf2c7f9 (patch) | |
tree | cefcb12eb6bb3a1e39c521d23b2dfd8bc1a7fd9c /editor/editor_properties.cpp | |
parent | f5a77f7bdd6d59f32f7d9aad81dabc5733221275 (diff) |
Fix inspector preview
Remove script preview to inspector dock
Diffstat (limited to 'editor/editor_properties.cpp')
-rw-r--r-- | editor/editor_properties.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index c5c78b2590..6eba9a9b67 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2102,12 +2102,18 @@ void EditorPropertyResource::_menu_option(int p_which) { } } -void EditorPropertyResource::_resource_preview(const String &p_path, const Ref<Texture> &p_preview, ObjectID p_obj) { +void EditorPropertyResource::_resource_preview(const String &p_path, const Ref<Texture> &p_preview, const Ref<Texture> &p_small_preview, ObjectID p_obj) { RES p = get_edited_object()->get(get_edited_property()); if (p.is_valid() && p->get_instance_id() == p_obj) { + String type = p->get_class_name(); + + if (ClassDB::is_parent_class(type, "Script")) { + assign->set_text(p->get_path().get_file()); + return; + } + if (p_preview.is_valid()) { - String type = p->get_class_name(); preview->set_margin(MARGIN_LEFT, assign->get_icon()->get_width() + assign->get_stylebox("normal")->get_default_margin(MARGIN_LEFT) + get_constant("hseparation", "Button")); if (type == "GradientTexture") { preview->set_stretch_mode(TextureRect::STRETCH_SCALE); |