diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-11 18:31:03 +0200 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-10-11 18:31:03 +0200 |
| commit | ae5be1f9afe3f1f7176285022f350014c3ae402e (patch) | |
| tree | 573ea93c0cdb202fe8f53f6cb63f86f346b92181 | |
| parent | 3e8902d1ae64751b46ed6dbbe1f4912dd11b318d (diff) | |
| parent | a3bfd9b797586f563a15eb0fdb9a7a8b7e4dacdd (diff) | |
| download | redot-engine-ae5be1f9afe3f1f7176285022f350014c3ae402e.tar.gz | |
Merge pull request #83144 from groud/tilemap_y_sort_warning
Warn users when TileMap is set as Y-sorted but no layer is
| -rw-r--r-- | scene/2d/tile_map.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp index 7b0bd7e26c..6372330b44 100644 --- a/scene/2d/tile_map.cpp +++ b/scene/2d/tile_map.cpp @@ -4518,14 +4518,26 @@ 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()) { + // Check if Y-sort is enabled on a layer but not on the node. for (const Ref<TileMapLayer> &layer : layers) { if (layer->is_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; } } + } else { + // Check if Y-sort is enabled on the node, but not on any of the layers. + bool need_warning = true; + for (const Ref<TileMapLayer> &layer : layers) { + if (layer->is_y_sort_enabled()) { + need_warning = false; + break; + } + } + if (need_warning) { + warnings.push_back(RTR("The TileMap node is set as Y-sorted, but Y-sort is not enabled on any of the TileMap's layers.\nThis may lead to unwanted behaviors, as a layer that is not Y-sorted will be Y-sorted as a whole.")); + } } // Check if we are in isometric mode without Y-sort enabled. |
