trackeditor: check for duplicate object colors
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8490 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: f1fe6ed4078f7757bbe43d902702efc3db8002af Former-commit-id: 9f0ae30e0cb4cd659a7a8deb93106f42c9b85e59
This commit is contained in:
parent
ea179b7bd3
commit
b89f932996
1 changed files with 32 additions and 2 deletions
|
@ -234,7 +234,7 @@ public class CheckDialog extends JDialog
|
||||||
{
|
{
|
||||||
if (name.equals(trackData.getObjects().get(j).getName()))
|
if (name.equals(trackData.getObjects().get(j).getName()))
|
||||||
{
|
{
|
||||||
textArea.append("Track object " + (i + 1) + " " + name + " has same name as Track object " + (j + 1) + " " + trackData.getObjects().get(i).getName() + "\n");
|
textArea.append("Track object " + (i + 1) + " " + name + " has same name as Track object " + (j + 1) + " " + trackData.getObjects().get(j).getName() + "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,7 +242,37 @@ public class CheckDialog extends JDialog
|
||||||
{
|
{
|
||||||
if (name.equals(defaultObjects.get(j).getName()))
|
if (name.equals(defaultObjects.get(j).getName()))
|
||||||
{
|
{
|
||||||
textArea.append("Track object " + (i + 1) + " " + name + " has same name as Default object " + (j + 1) + " " + defaultObjects.get(i).getName() + "\n");
|
textArea.append("Track object " + (i + 1) + " " + name + " has same name as Default object " + (j + 1) + " " + defaultObjects.get(j).getName() + "\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// check for duplicate colors
|
||||||
|
for (int i = 0; i < trackData.getObjects().size(); i++)
|
||||||
|
{
|
||||||
|
String name = trackData.getObjects().get(i).getName();
|
||||||
|
int color = trackData.getObjects().get(i).getColor();
|
||||||
|
|
||||||
|
if (color == Integer.MAX_VALUE)
|
||||||
|
{
|
||||||
|
textArea.append("Track object " + (i + 1) + " missing color\n");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int j = i + 1; j < trackData.getObjects().size(); j++)
|
||||||
|
{
|
||||||
|
if (color == trackData.getObjects().get(j).getColor())
|
||||||
|
{
|
||||||
|
textArea.append("Track object " + (i + 1) + " " + name + " has same color as Track object " + (j + 1) + " " + trackData.getObjects().get(j).getName() + "\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int j = 0; j < defaultObjects.size(); j++)
|
||||||
|
{
|
||||||
|
if (color == defaultObjects.get(j).getColor())
|
||||||
|
{
|
||||||
|
textArea.append("Track object " + (i + 1) + " " + name + " has same color as Default object " + (j + 1) + " " + defaultObjects.get(j).getName() + "\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue