diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-02-13 11:24:42 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-02-13 11:24:42 +0100 |
commit | 391a8e5327ad1cb9e31b9bffc164a7996d88b956 (patch) | |
tree | 6b1dd051fe137b30e95b2c2dfc7a9d438066ce81 /editor/plugins/tiles/tile_set_editor.cpp | |
parent | ccd1fa2be82c151e3a81f6a05972c4f3001979d1 (diff) | |
parent | 6e31c413b60e0896d7cd6e88755f24a8fbfdfa2a (diff) | |
download | redot-engine-391a8e5327ad1cb9e31b9bffc164a7996d88b956.tar.gz |
Merge pull request #85868 from KoBeWi/knowyourtiles
Add descriptions for tile properties
Diffstat (limited to 'editor/plugins/tiles/tile_set_editor.cpp')
-rw-r--r-- | editor/plugins/tiles/tile_set_editor.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/editor/plugins/tiles/tile_set_editor.cpp b/editor/plugins/tiles/tile_set_editor.cpp index c43995d167..bb950dbf63 100644 --- a/editor/plugins/tiles/tile_set_editor.cpp +++ b/editor/plugins/tiles/tile_set_editor.cpp @@ -988,7 +988,7 @@ void TileSourceInspectorPlugin::_show_id_edit_dialog(Object *p_for_source) { void TileSourceInspectorPlugin::_confirm_change_id() { edited_source->set("id", id_input->get_value()); - id_label->set_text(vformat(TTR("ID: %d"), edited_source->get("id"))); // Use get(), because the provided ID might've been invalid. + id_label->set_text(itos(edited_source->get("id"))); // Use get(), because the provided ID might've been invalid. } bool TileSourceInspectorPlugin::can_handle(Object *p_object) { @@ -1002,17 +1002,22 @@ bool TileSourceInspectorPlugin::parse_property(Object *p_object, const Variant:: return true; } + EditorProperty *ep = memnew(EditorProperty); + HBoxContainer *hbox = memnew(HBoxContainer); hbox->set_alignment(BoxContainer::ALIGNMENT_CENTER); - id_label = memnew(Label(vformat(TTR("ID: %d"), value))); + id_label = memnew(Label(itos(value))); + id_label->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbox->add_child(id_label); Button *button = memnew(Button(TTR("Edit"))); + button->set_h_size_flags(Control::SIZE_EXPAND_FILL); hbox->add_child(button); button->connect("pressed", callable_mp(this, &TileSourceInspectorPlugin::_show_id_edit_dialog).bind(p_object)); - add_custom_control(hbox); + ep->add_child(hbox); + add_property_editor(p_path, ep); return true; } return false; |