mirror of
https://github.com/godotengine/godot.git
synced 2024-12-27 11:24:59 +08:00
Add pattern index tooltip to tilemap and tileset editor
Just a little UI convenience feature. Knowing the index (without having to count manually) is convenient when working with tile patterns programmatically, especially when having lots of them.
This commit is contained in:
parent
9dc286967f
commit
93248684b4
@ -321,6 +321,7 @@ void TileMapEditorTilesPlugin::_update_patterns_list() {
|
|||||||
for (int i = 0; i < tile_set->get_patterns_count(); i++) {
|
for (int i = 0; i < tile_set->get_patterns_count(); i++) {
|
||||||
int id = patterns_item_list->add_item("");
|
int id = patterns_item_list->add_item("");
|
||||||
patterns_item_list->set_item_metadata(id, tile_set->get_pattern(i));
|
patterns_item_list->set_item_metadata(id, tile_set->get_pattern(i));
|
||||||
|
patterns_item_list->set_item_tooltip(id, vformat(TTR("Index: %d"), i));
|
||||||
TilesEditorPlugin::get_singleton()->queue_pattern_preview(tile_set, tile_set->get_pattern(i), callable_mp(this, &TileMapEditorTilesPlugin::_pattern_preview_done));
|
TilesEditorPlugin::get_singleton()->queue_pattern_preview(tile_set, tile_set->get_pattern(i), callable_mp(this, &TileMapEditorTilesPlugin::_pattern_preview_done));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -418,6 +418,7 @@ void TileSetEditor::_update_patterns_list() {
|
|||||||
for (int i = 0; i < tile_set->get_patterns_count(); i++) {
|
for (int i = 0; i < tile_set->get_patterns_count(); i++) {
|
||||||
int id = patterns_item_list->add_item("");
|
int id = patterns_item_list->add_item("");
|
||||||
patterns_item_list->set_item_metadata(id, tile_set->get_pattern(i));
|
patterns_item_list->set_item_metadata(id, tile_set->get_pattern(i));
|
||||||
|
patterns_item_list->set_item_tooltip(id, vformat(TTR("Index: %d"), i));
|
||||||
TilesEditorPlugin::get_singleton()->queue_pattern_preview(tile_set, tile_set->get_pattern(i), callable_mp(this, &TileSetEditor::_pattern_preview_done));
|
TilesEditorPlugin::get_singleton()->queue_pattern_preview(tile_set, tile_set->get_pattern(i), callable_mp(this, &TileSetEditor::_pattern_preview_done));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user