diff options
Diffstat (limited to 'editor/editor_properties.cpp')
| -rw-r--r-- | editor/editor_properties.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index c8b4831d63..6684fe1abb 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); |