summaryrefslogtreecommitdiff
path: root/editor/plugins
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-05-16 13:52:57 +0200
committerGitHub <noreply@github.com>2022-05-16 13:52:57 +0200
commitb154f445d59f5a6b332311890569fda689fe480b (patch)
tree996fe61989c7ac1859058165a7b4d37870661b7c /editor/plugins
parentdf2de05c5f2366e11af5c7746fe05f64d1b32e8a (diff)
parent05963674a7a59ae949095173da7278044e58ced8 (diff)
Merge pull request #60507 from bruvzg/textmesh
Implement TextMesh.
Diffstat (limited to 'editor/plugins')
-rw-r--r--editor/plugins/ot_features_plugin.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/editor/plugins/ot_features_plugin.cpp b/editor/plugins/ot_features_plugin.cpp
index ffa74173be..f8526fb715 100644
--- a/editor/plugins/ot_features_plugin.cpp
+++ b/editor/plugins/ot_features_plugin.cpp
@@ -31,6 +31,7 @@
#include "ot_features_plugin.h"
#include "scene/3d/label_3d.h"
+#include "scene/resources/primitive_meshes.h"
void OpenTypeFeaturesEditor::_value_changed(double val) {
if (setting) {
@@ -124,11 +125,14 @@ void OpenTypeFeaturesAdd::setup(Object *p_object) {
Control *ctrl = Object::cast_to<Control>(edited_object);
if (ctrl != nullptr) {
font = ctrl->get_theme_font(SNAME("font"));
- } else {
- Label3D *l3d = Object::cast_to<Label3D>(edited_object);
- if (l3d != nullptr) {
- font = l3d->_get_font_or_default();
- }
+ }
+ Label3D *l3d = Object::cast_to<Label3D>(edited_object);
+ if (l3d != nullptr) {
+ font = l3d->_get_font_or_default();
+ }
+ TextMesh *tm = Object::cast_to<TextMesh>(edited_object);
+ if (tm != nullptr) {
+ font = tm->_get_font_or_default();
}
if (font.is_null()) {
@@ -205,7 +209,7 @@ OpenTypeFeaturesAdd::OpenTypeFeaturesAdd() {
/*************************************************************************/
bool EditorInspectorPluginOpenTypeFeatures::can_handle(Object *p_object) {
- return (Object::cast_to<Control>(p_object) != nullptr) || (Object::cast_to<Label3D>(p_object) != nullptr);
+ return (Object::cast_to<Control>(p_object) != nullptr) || (Object::cast_to<Label3D>(p_object) != nullptr) || (Object::cast_to<TextMesh>(p_object) != nullptr);
}
bool EditorInspectorPluginOpenTypeFeatures::parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const uint32_t p_usage, const bool p_wide) {