Merge pull request #77389 from vmedea/tooltip-pattern-index

Add pattern index tooltip to tilemap and tileset editor
This commit is contained in:
Rémi Verschelde 2023-05-24 08:49:33 +02:00
commit f92634a709
No known key found for this signature in database
GPG Key ID: C3336907360768E1
2 changed files with 2 additions and 0 deletions

View File

@ -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));
} }

View File

@ -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));
} }