diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index c8b4831d63d..6684fe1abb2 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -795,6 +795,7 @@ EditorPropertyLayers::EditorPropertyLayers() { layers->set_hide_on_checkable_item_selection(false); layers->connect("id_pressed", this, "_menu_pressed"); } + ///////////////////// INT ///////////////////////// void EditorPropertyInteger::_value_changed(double val) { @@ -1951,6 +1952,23 @@ EditorPropertyNodePath::EditorPropertyNodePath() { scene_tree = NULL; //do not allocate unnecessarily } +///////////////////// RID ///////////////////////// + +void EditorPropertyRID::update_property() { + RID rid = get_edited_object()->get(get_edited_property()); + if (rid.is_valid()) { + int id = rid.get_id(); + label->set_text("RID: " + itos(id)); + } else { + label->set_text(TTR("Invalid RID")); + } +} + +EditorPropertyRID::EditorPropertyRID() { + label = memnew(Label); + add_child(label); +} + ////////////// RESOURCE ////////////////////// void EditorPropertyResource::_file_selected(const String &p_path) { @@ -3117,6 +3135,8 @@ bool EditorInspectorDefaultPlugin::parse_property(Object *p_object, Variant::Typ } break; // 15 case Variant::_RID: { + EditorPropertyRID *editor = memnew(EditorPropertyRID); + add_property_editor(p_path, editor); } break; case Variant::OBJECT: { EditorPropertyResource *editor = memnew(EditorPropertyResource); diff --git a/editor/editor_properties.h b/editor/editor_properties.h index 28964df20cc..2051ab40194 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -515,6 +515,15 @@ public: EditorPropertyNodePath(); }; +class EditorPropertyRID : public EditorProperty { + GDCLASS(EditorPropertyRID, EditorProperty) + Label *label; + +public: + virtual void update_property(); + EditorPropertyRID(); +}; + class EditorPropertyResource : public EditorProperty { GDCLASS(EditorPropertyResource, EditorProperty) diff --git a/editor/editor_properties_array_dict.cpp b/editor/editor_properties_array_dict.cpp index c4bca692229..dd802bc72ee 100644 --- a/editor/editor_properties_array_dict.cpp +++ b/editor/editor_properties_array_dict.cpp @@ -29,9 +29,11 @@ /*************************************************************************/ #include "editor_properties_array_dict.h" + #include "core/io/marshalls.h" #include "editor/editor_scale.h" #include "editor_properties.h" + bool EditorPropertyArrayObject::_set(const StringName &p_name, const Variant &p_value) { String pn = p_name;