commit 1380e6a8
Prevent selecting txt files in the editor. They will crash the editor
Changed files
| M | src/editor/SagoTextureSelector.cpp before |
diff --git a/src/editor/SagoTextureSelector.cpp b/src/editor/SagoTextureSelector.cpp
index 7d18b6e..af5bc27 100644
--- a/src/editor/SagoTextureSelector.cpp
+++ b/src/editor/SagoTextureSelector.cpp
@@ -101,7 +101,8 @@ static void addFolderToList(const std::string& folder, std::vector<std::string>&
std::vector<std::string> textures = sago::GetFileList(folder.c_str());
for (const auto& texture : textures) {
std::cout << "Texture: " << texture << "\n";
- if (texture.find(".png") == std::string::npos) {
+ if (!texture.ends_with(".png") && !texture.ends_with(".jpg") &&
+ !texture.ends_with(".jpeg") && !texture.ends_with(".bmp")) {
continue;
}
if (filter.empty() || texture.find(filter) != std::string::npos) {