trackeditor: don't run trackgen when there are duplicate object names

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9333 30fe4595-0a0c-4342-8851-515496e4dcbd
This commit is contained in:
iobyte 2024-02-21 17:50:36 +00:00
parent 2ac59800de
commit ab2c64770d
2 changed files with 15 additions and 1 deletions

View File

@ -2347,6 +2347,20 @@ public class EditorFrame extends JFrame
private void exportAc3d(String additionalArgs)
{
//check for graphic objects with same name
Vector<GraphicObject> graphicObjects = trackData.getGraphicObjects();
for (int i = 0; i < graphicObjects.size() - 1; i++)
{
for (int j = i + 1; j < graphicObjects.size(); j++)
{
if (graphicObjects.get(i).getName().equals(graphicObjects.get(j).getName()))
{
JOptionPane.showMessageDialog(this, "Graphic Objects has duplicate name: " + graphicObjects.get(i).getName(), "Exporting AC3", JOptionPane.ERROR_MESSAGE);
return;
}
}
}
String reliefBorder = getTrackData().getGraphic().getTerrainGeneration().getReliefBorder();
String newArgs = additionalArgs;
if (reliefBorder != null && reliefBorder.equals("yes"))

View File

@ -34,7 +34,7 @@ public class Properties
private static Properties instance = new Properties();
private Vector<ActionListener> propertiesListeners = new Vector<ActionListener>();
public final String title = "sd2-trackeditor";
public final String version = "1.4.51";
public final String version = "1.4.52";
private String path;
private double imageScale = 1;