Skip to content

Commit

Permalink
Merge pull request #41511 from KoBeWi/dynamite_font
Browse files Browse the repository at this point in the history
Accept DynamicFontData for Fonts
  • Loading branch information
akien-mga authored Aug 25, 2020
2 parents b2aae76 + b5fe419 commit a609b30
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions editor/editor_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 /////////////////////////

Expand Down Expand Up @@ -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");
}
}

Expand Down Expand Up @@ -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;
}
}
}

Expand Down

0 comments on commit a609b30

Please sign in to comment.