Browse Source

Enhancement for tileset sorting

(cherry picked from commit 0e392bd177032dac6856df9a21f0d72de5292b1b)
Pleto 4 years ago
parent
commit
203d6375fc
1 changed files with 3 additions and 1 deletions
  1. 3 1
      editor/plugins/tile_map_editor_plugin.cpp

+ 3 - 1
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