summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPleto <pleto@mail.com>2020-10-24 15:35:24 +0300
committerPleto <pleto@mail.com>2020-10-26 06:34:14 +0200
commit0e392bd177032dac6856df9a21f0d72de5292b1b (patch)
treef1864906e5b4707b21a74c6547dd0526d657685b
parentb67ccf1a6f326c5d4d5fa1cc7cd15eff3573f8f7 (diff)
Enhancement for tileset sorting
-rw-r--r--editor/plugins/tile_map_editor_plugin.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/editor/plugins/tile_map_editor_plugin.cpp b/editor/plugins/tile_map_editor_plugin.cpp
index cb3c0c8be0..e43b8c4b7f 100644
--- a/editor/plugins/tile_map_editor_plugin.cpp
+++ b/editor/plugins/tile_map_editor_plugin.cpp
@@ -413,7 +413,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