summaryrefslogtreecommitdiffstats
path: root/editor/plugins/tiles/tile_set_editor.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2023-12-06 23:10:32 +0100
committerkobewi <kobewi4e@gmail.com>2023-12-07 16:57:34 +0100
commit6e31c413b60e0896d7cd6e88755f24a8fbfdfa2a (patch)
tree674068d3005431182f3ccdcdbabd4f330fef8c5c /editor/plugins/tiles/tile_set_editor.cpp
parent2f73a059cefadcd944b6874f2557ec82e46a562d (diff)
downloadredot-engine-6e31c413b60e0896d7cd6e88755f24a8fbfdfa2a.tar.gz
Add descriptions for tile properties
Diffstat (limited to 'editor/plugins/tiles/tile_set_editor.cpp')
-rw-r--r--editor/plugins/tiles/tile_set_editor.cpp11
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 5bde1f754b..e18dd35f2a 100644
--- a/editor/plugins/tiles/tile_set_editor.cpp
+++ b/editor/plugins/tiles/tile_set_editor.cpp
@@ -987,7 +987,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) {
@@ -1001,17 +1001,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;