From 62c874732dcfd78026a5456226788ffd183b6753 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gilles=20Roudi=C3=A8re?= Date: Mon, 30 Jan 2023 10:34:35 +0100 Subject: Warn when a TileMap layer is Y-sorted but not the TileMap node itself. --- scene/2d/tile_map.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scene/2d') diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 8c5aab4c80..206c5d5e95 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -3969,6 +3969,17 @@ PackedStringArray TileMap::get_configuration_warnings() const { } } + // Check if Y-sort is enabled on a layer but not on the node. + if (!is_y_sort_enabled()) { + for (const TileMapLayer &layer : layers) { + if (layer.y_sort_enabled) { + warnings.push_back(RTR("A TileMap layer is set as Y-sorted, but Y-sort is not enabled on the TileMap node itself.")); + break; + } + } + } + + // Check if we are in isometric mode without Y-sort enabled. if (tile_set.is_valid() && tile_set->get_tile_shape() == TileSet::TILE_SHAPE_ISOMETRIC) { bool warn = !is_y_sort_enabled(); if (!warn) { -- cgit v1.2.3