/**
* Reloads textures default catalog.
*/
private void updateTexturesDefaultCatalog() {
// Delete default textures of current textures catalog
TexturesCatalog texturesCatalog = getTexturesCatalog();
for (TexturesCategory category : texturesCatalog.getCategories()) {
for (CatalogTexture texture : category.getTextures()) {
if (!texture.isModifiable()) {
texturesCatalog.delete(texture);
}
}
}
// Read again default textures catalog with new default locale
// Add default textures that don't have homonym among user catalog
TexturesCatalog defaultTexturesCatalog =
new DefaultTexturesCatalog(this, getTexturesLibrariesPluginFolders());
for (TexturesCategory category : defaultTexturesCatalog.getCategories()) {
for (CatalogTexture texture : category.getTextures()) {
try {
texturesCatalog.add(category, texture);
} catch (IllegalHomonymException ex) {
// Ignore textures that have the same name as an existing piece