- improve "create j3m" naming scheme

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7936 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 14 years ago
parent 90a0344b25
commit 12c76b676d
  1. 8
      sdk/jme3-materialeditor/src/com/jme3/gde/materials/MaterialPropertyEditor.java

@ -109,13 +109,13 @@ public class MaterialPropertyEditor implements PropertyEditor, SceneExplorerProp
FileObject currentFile = obj.getPrimaryFile();
FileObject currentFolder = currentFile.getParent();
try {
int i = 1;
FileObject newFile = currentFolder.getFileObject(currentFile.getName() + "_" + i, "j3m");
int i = 0;
FileObject newFile = currentFolder.getFileObject(currentFile.getName(), "j3m");
while (newFile != null) {
i++;
newFile = currentFolder.getFileObject(currentFile.getName() + "_" + i, "j3m");
newFile = currentFolder.getFileObject(currentFile.getName() + "-" + i, "j3m");
}
newFile = currentFolder.createData(currentFile.getName() + "_" + i, "j3m");
newFile = currentFolder.createData(currentFile.getName() + "-" + i, "j3m");
EditableMaterialFile properties = new EditableMaterialFile(newFile, pm);
material.setKey(new MaterialKey(pm.getRelativeAssetPath(newFile.getPath())));
properties.setAsMaterial(material);

Loading…
Cancel
Save