Merge pull request #77389 from vmedea/tooltip-pattern-index
Add pattern index tooltip to tilemap and tileset editor
This commit is contained in:
commit
f92634a709
|
@ -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