trackeditor: handle alternate pit style used by some TORCS tracks
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8485 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: 1439ca3d6d0d780032d74e095032d289322a5e5a Former-commit-id: 0ac1ab49ed596446aff55ffded0f7b71dda0dd05
This commit is contained in:
parent
045eef23de
commit
155c0cbd50
1 changed files with 22 additions and 0 deletions
|
@ -550,6 +550,28 @@ public class XmlReader
|
|||
return;
|
||||
|
||||
editorFrame.getTrackData().getMainTrack().getPits().setStyle(getAttrIntValue(pits, "pit style"));
|
||||
// try alternate representation used by some TORCS tracks
|
||||
if (editorFrame.getTrackData().getMainTrack().getPits().getStyle() == Integer.MAX_VALUE)
|
||||
{
|
||||
String pitStyle = getAttrStrValue(pits, "type");
|
||||
|
||||
if (pitStyle != null)
|
||||
{
|
||||
if (pitStyle.equals("no pit"))
|
||||
{
|
||||
editorFrame.getTrackData().getMainTrack().getPits().setStyle(0);
|
||||
}
|
||||
else if (pitStyle.equals("track side"))
|
||||
{
|
||||
editorFrame.getTrackData().getMainTrack().getPits().setStyle(1);
|
||||
}
|
||||
else if (pitStyle.equals("seperate path"))
|
||||
{
|
||||
editorFrame.getTrackData().getMainTrack().getPits().setStyle(2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
editorFrame.getTrackData().getMainTrack().getPits().setSide(getAttrStrValue(pits, "side"));
|
||||
editorFrame.getTrackData().getMainTrack().getPits().setEntry(getAttrStrValue(pits, "entry"));
|
||||
editorFrame.getTrackData().getMainTrack().getPits().setStart(getAttrStrValue(pits, "start"));
|
||||
|
|
Loading…
Reference in a new issue