diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-08-25 18:41:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-25 18:41:03 +0200 |
commit | a609b30ddb77bcc1c64008a7848da07b5448a10d (patch) | |
tree | 410fb0b8ade013e177921db5321194d23f06336b | |
parent | b2aae76f8553e81e9d66853918f9557f6abbecb2 (diff) | |
parent | b5fe41988b378d545cc4a88695a2e082130de81c (diff) | |
download | redot-engine-a609b30ddb77bcc1c64008a7848da07b5448a10d.tar.gz |
Merge pull request #41511 from KoBeWi/dynamite_font
Accept DynamicFontData for Fonts
-rw-r--r-- | editor/editor_properties.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index d5cc9ac5c1..4c8af615b4 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -36,6 +36,7 @@ #include "editor_properties_array_dict.h" #include "editor_scale.h" #include "scene/main/window.h" +#include "scene/resources/dynamic_font.h" ///////////////////// NULL ///////////////////////// @@ -3014,6 +3015,8 @@ bool EditorPropertyResource::_is_drop_valid(const Dictionary &p_drag_data) const allowed_types.append("Texture2D"); } else if (at == "ShaderMaterial") { allowed_types.append("Shader"); + } else if (at == "Font") { + allowed_types.append("DynamicFontData"); } } @@ -3111,6 +3114,13 @@ void EditorPropertyResource::drop_data_fw(const Point2 &p_point, const Variant & res = mat; break; } + + if (at == "Font" && ClassDB::is_parent_class(res->get_class(), "DynamicFontData")) { + Ref<DynamicFont> font = memnew(DynamicFont); + font->set_font_data(res); + res = font; + break; + } } } |