Display tile ID along with name

Fixes #20895.
This commit is contained in:
Mariano Javier Suligoy 2018-08-18 10:39:50 -03:00 committed by Rémi Verschelde
parent 8b25c0513f
commit 810b73c01e
1 changed files with 3 additions and 2 deletions

View File

@ -900,12 +900,13 @@ void TileSetEditor::_on_workspace_overlay_draw() {
else if (tileset->tile_get_tile_mode(t_id) == TileSet::ATLAS_TILE)
c = COLOR_ATLAS;
c.a = tile_names_opacity;
String tile_id_name = String::num(t_id, 0) + ": " + tileset->tile_get_name(t_id);
Ref<Font> font = get_font("font", "Label");
region.set_size(font->get_string_size(tileset->tile_get_name(t_id)));
region.set_size(font->get_string_size(tile_id_name));
workspace_overlay->draw_rect(region, c);
region.position.y += region.size.y - 2;
c = Color(0.1, 0.1, 0.1, tile_names_opacity);
workspace_overlay->draw_string(font, region.position, tileset->tile_get_name(t_id), c);
workspace_overlay->draw_string(font, region.position, tile_id_name, c);
}
}
}