From 203d6375fcfa1f893afa8144b64ce3dfaead66e2 Mon Sep 17 00:00:00 2001 From: Pleto Date: Sat, 24 Oct 2020 15:35:24 +0300 Subject: [PATCH] Enhancement for tileset sorting (cherry picked from commit 0e392bd177032dac6856df9a21f0d72de5292b1b) --- editor/plugins/tile_map_editor_plugin.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp index 0bb4c599fa3..fdb5a015a1c 100644 --- a/editor/plugins/tile_map_editor_plugin.cpp +++ b/editor/plugins/tile_map_editor_plugin.cpp @@ -424,7 +424,9 @@ struct _PaletteEntry { String name; bool operator<(const _PaletteEntry &p_rhs) const { - return name < p_rhs.name; + // Natural no case comparison will compare strings based on CharType + // order (except digits) and on numbers that start on the same position. + return name.naturalnocasecmp_to(p_rhs.name) < 0; } }; } // namespace