trackeditor: start adding suport for Cars-Sports-Racing version of track file (only lossless read/write for now, editing will come next)
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9399 30fe4595-0a0c-4342-8851-515496e4dcbd Former-commit-id: e8efa4d82d3904c25302a1d8435a191b5e7b8c17 Former-commit-id: 2a66dc1290cf1da8ab03eaa743fe8719a6d4d43b
This commit is contained in:
parent
c1d8aa125c
commit
a2f3ca0096
4 changed files with 186 additions and 2 deletions
|
@ -776,6 +776,7 @@ public class XmlWriter
|
||||||
addContent(element, "longitude", "deg", editorFrame.getTrackData().getLocalInfo().getLongitude());
|
addContent(element, "longitude", "deg", editorFrame.getTrackData().getLocalInfo().getLongitude());
|
||||||
addContent(element, "climat", null, editorFrame.getTrackData().getLocalInfo().getClimat());
|
addContent(element, "climat", null, editorFrame.getTrackData().getLocalInfo().getClimat());
|
||||||
addContent(element, "precipitation", null, editorFrame.getTrackData().getLocalInfo().getPrecipitation());
|
addContent(element, "precipitation", null, editorFrame.getTrackData().getLocalInfo().getPrecipitation());
|
||||||
|
addContent(element, "best lap", null, editorFrame.getTrackData().getLocalInfo().getBestLap());
|
||||||
|
|
||||||
return element;
|
return element;
|
||||||
}
|
}
|
||||||
|
@ -807,9 +808,35 @@ public class XmlWriter
|
||||||
Element element = new Element("section");
|
Element element = new Element("section");
|
||||||
element.setAttribute(new Attribute("name", "Graphic"));
|
element.setAttribute(new Attribute("name", "Graphic"));
|
||||||
|
|
||||||
|
if (editorFrame.getTrackData().getGraphic().getDescription() == null)
|
||||||
addContent(element, "3d description", trackname + ".ac");
|
addContent(element, "3d description", trackname + ".ac");
|
||||||
|
else
|
||||||
|
addContent(element, "3d description", editorFrame.getTrackData().getGraphic().getDescription());
|
||||||
addContent(element, "3d description night", editorFrame.getTrackData().getGraphic().getDescriptionNight());
|
addContent(element, "3d description night", editorFrame.getTrackData().getGraphic().getDescriptionNight());
|
||||||
addContent(element, "3d description rain+night", editorFrame.getTrackData().getGraphic().getDescriptionRainNight());
|
addContent(element, "3d description rain+night", editorFrame.getTrackData().getGraphic().getDescriptionRainNight());
|
||||||
|
|
||||||
|
addContent(element, "3d separate objects", editorFrame.getTrackData().getGraphic().getSeparateObjects());
|
||||||
|
addContent(element, "3d terrain", editorFrame.getTrackData().getGraphic().getTerrainObjects());
|
||||||
|
addContent(element, "3d road", editorFrame.getTrackData().getGraphic().getRoadObjects());
|
||||||
|
addContent(element, "3d road2", editorFrame.getTrackData().getGraphic().getRoad2Objects());
|
||||||
|
addContent(element, "3d trees", editorFrame.getTrackData().getGraphic().getTreesObjects());
|
||||||
|
addContent(element, "3d building", editorFrame.getTrackData().getGraphic().getBuildingObjects());
|
||||||
|
addContent(element, "3d house", editorFrame.getTrackData().getGraphic().getHouseObjects());
|
||||||
|
addContent(element, "3d cars", editorFrame.getTrackData().getGraphic().getCarsObjects());
|
||||||
|
addContent(element, "3d truck", editorFrame.getTrackData().getGraphic().getTruckObjects());
|
||||||
|
addContent(element, "3d tribunes", editorFrame.getTrackData().getGraphic().getTribunesObjects());
|
||||||
|
addContent(element, "3d pub", editorFrame.getTrackData().getGraphic().getPubObjects());
|
||||||
|
addContent(element, "3d decors", editorFrame.getTrackData().getGraphic().getDecorsObjects());
|
||||||
|
addContent(element, "3d water", editorFrame.getTrackData().getGraphic().getWaterObjects());
|
||||||
|
addContent(element, "3d grass", editorFrame.getTrackData().getGraphic().getGrassObjects());
|
||||||
|
addContent(element, "3d sand", editorFrame.getTrackData().getGraphic().getSandObjects());
|
||||||
|
addContent(element, "3d rock", editorFrame.getTrackData().getGraphic().getRockObjects());
|
||||||
|
addContent(element, "3d curb", editorFrame.getTrackData().getGraphic().getCurbObjects());
|
||||||
|
addContent(element, "3d fence", editorFrame.getTrackData().getGraphic().getFenceObjects());
|
||||||
|
addContent(element, "3d barrier", editorFrame.getTrackData().getGraphic().getBarrierObjects());
|
||||||
|
addContent(element, "3d wall", editorFrame.getTrackData().getGraphic().getWallObjects());
|
||||||
|
addContent(element, "3d environment", editorFrame.getTrackData().getGraphic().getEnvironmentObjects());
|
||||||
|
|
||||||
addContent(element, "background image", editorFrame.getTrackData().getGraphic().getBackgroundImage());
|
addContent(element, "background image", editorFrame.getTrackData().getGraphic().getBackgroundImage());
|
||||||
addContent(element, "background type", null, editorFrame.getTrackData().getGraphic().getBackgroundType());
|
addContent(element, "background type", null, editorFrame.getTrackData().getGraphic().getBackgroundType());
|
||||||
addContent(element, "background color R", null, editorFrame.getTrackData().getGraphic().getBackgroundColorR());
|
addContent(element, "background color R", null, editorFrame.getTrackData().getGraphic().getBackgroundColorR());
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class Properties
|
||||||
private static Properties instance = new Properties();
|
private static Properties instance = new Properties();
|
||||||
private Vector<ActionListener> propertiesListeners = new Vector<ActionListener>();
|
private Vector<ActionListener> propertiesListeners = new Vector<ActionListener>();
|
||||||
public final String title = "sd2-trackeditor";
|
public final String title = "sd2-trackeditor";
|
||||||
public final String version = "1.4.62";
|
public final String version = "1.4.63";
|
||||||
private String path;
|
private String path;
|
||||||
|
|
||||||
private double imageScale = 1;
|
private double imageScale = 1;
|
||||||
|
|
|
@ -6,6 +6,29 @@ public class Graphic {
|
||||||
private String description = null;
|
private String description = null;
|
||||||
private String descriptionNight = null;
|
private String descriptionNight = null;
|
||||||
private String descriptionRainNight = null;
|
private String descriptionRainNight = null;
|
||||||
|
|
||||||
|
private String separateObjects = null;
|
||||||
|
private String terrainObjects = null;
|
||||||
|
private String roadObjects = null;
|
||||||
|
private String road2Objects = null;
|
||||||
|
private String treesObjects = null;
|
||||||
|
private String buildingObjects = null;
|
||||||
|
private String houseObjects = null;
|
||||||
|
private String carsObjects = null;
|
||||||
|
private String truckObjects = null;
|
||||||
|
private String tribunesObjects = null;
|
||||||
|
private String pubObjects = null;
|
||||||
|
private String decorsObjects = null;
|
||||||
|
private String waterObjects = null;
|
||||||
|
private String grassObjects = null;
|
||||||
|
private String sandObjects = null;
|
||||||
|
private String rockObjects = null;
|
||||||
|
private String curbObjects = null;
|
||||||
|
private String fenceObjects = null;
|
||||||
|
private String barrierObjects = null;
|
||||||
|
private String wallObjects = null;
|
||||||
|
private String environmentObjects = null;
|
||||||
|
|
||||||
private String backgroundImage = null;
|
private String backgroundImage = null;
|
||||||
private int backgroundType = Integer.MAX_VALUE;
|
private int backgroundType = Integer.MAX_VALUE;
|
||||||
private double backgroundColorR = Double.NaN;
|
private double backgroundColorR = Double.NaN;
|
||||||
|
@ -47,6 +70,132 @@ public class Graphic {
|
||||||
public void setDescriptionRainNight(String descriptionRaiNight) {
|
public void setDescriptionRainNight(String descriptionRaiNight) {
|
||||||
this.descriptionRainNight = descriptionRaiNight;
|
this.descriptionRainNight = descriptionRaiNight;
|
||||||
}
|
}
|
||||||
|
public String getSeparateObjects() {
|
||||||
|
return separateObjects;
|
||||||
|
}
|
||||||
|
public void setSeparateObjects(String separateObjects) {
|
||||||
|
this.separateObjects = separateObjects;
|
||||||
|
}
|
||||||
|
public String getTerrainObjects() {
|
||||||
|
return terrainObjects;
|
||||||
|
}
|
||||||
|
public void setTerrainObjects(String terrainObjects) {
|
||||||
|
this.terrainObjects = terrainObjects;
|
||||||
|
}
|
||||||
|
public String getRoadObjects() {
|
||||||
|
return roadObjects;
|
||||||
|
}
|
||||||
|
public void setRoadObjects(String roadObjects) {
|
||||||
|
this.roadObjects = roadObjects;
|
||||||
|
}
|
||||||
|
public String getRoad2Objects() {
|
||||||
|
return road2Objects;
|
||||||
|
}
|
||||||
|
public void setRoad2Objects(String road2Objects) {
|
||||||
|
this.road2Objects = road2Objects;
|
||||||
|
}
|
||||||
|
public String getTreesObjects() {
|
||||||
|
return treesObjects;
|
||||||
|
}
|
||||||
|
public void setTreesObjects(String treesObjects) {
|
||||||
|
this.treesObjects = treesObjects;
|
||||||
|
}
|
||||||
|
public String getBuildingObjects() {
|
||||||
|
return buildingObjects;
|
||||||
|
}
|
||||||
|
public void setBuildingObjects(String buildingObjects) {
|
||||||
|
this.buildingObjects = buildingObjects;
|
||||||
|
}
|
||||||
|
public String getHouseObjects() {
|
||||||
|
return houseObjects;
|
||||||
|
}
|
||||||
|
public void setHouseObjects(String houseObjects) {
|
||||||
|
this.houseObjects = houseObjects;
|
||||||
|
}
|
||||||
|
public String getCarsObjects() {
|
||||||
|
return carsObjects;
|
||||||
|
}
|
||||||
|
public void setCarsObjects(String carsObjects) {
|
||||||
|
this.carsObjects = carsObjects;
|
||||||
|
}
|
||||||
|
public String getTruckObjects() {
|
||||||
|
return truckObjects;
|
||||||
|
}
|
||||||
|
public void setTruckObjects(String truckObjects) {
|
||||||
|
this.truckObjects = truckObjects;
|
||||||
|
}
|
||||||
|
public String getTribunesObjects() {
|
||||||
|
return tribunesObjects;
|
||||||
|
}
|
||||||
|
public void setTribunesObjects(String tribunesObjects) {
|
||||||
|
this.tribunesObjects = tribunesObjects;
|
||||||
|
}
|
||||||
|
public String getPubObjects() {
|
||||||
|
return pubObjects;
|
||||||
|
}
|
||||||
|
public void setPubObjects(String pubObjects) {
|
||||||
|
this.pubObjects = pubObjects;
|
||||||
|
}
|
||||||
|
public String getDecorsObjects() {
|
||||||
|
return decorsObjects;
|
||||||
|
}
|
||||||
|
public void setDecorsObjects(String decorsObjects) {
|
||||||
|
this.decorsObjects = decorsObjects;
|
||||||
|
}
|
||||||
|
public String getWaterObjects() {
|
||||||
|
return waterObjects;
|
||||||
|
}
|
||||||
|
public void setWaterObjects(String waterObjects) {
|
||||||
|
this.waterObjects = waterObjects;
|
||||||
|
}
|
||||||
|
public String getGrassObjects() {
|
||||||
|
return grassObjects;
|
||||||
|
}
|
||||||
|
public void setGrassObjects(String grassObjects) {
|
||||||
|
this.grassObjects = grassObjects;
|
||||||
|
}
|
||||||
|
public String getSandObjects() {
|
||||||
|
return sandObjects;
|
||||||
|
}
|
||||||
|
public void setSandObjects(String sandObjects) {
|
||||||
|
this.sandObjects = sandObjects;
|
||||||
|
}
|
||||||
|
public String getRockObjects() {
|
||||||
|
return rockObjects;
|
||||||
|
}
|
||||||
|
public void setRockObjects(String rockObjects) {
|
||||||
|
this.rockObjects = rockObjects;
|
||||||
|
}
|
||||||
|
public String getCurbObjects() {
|
||||||
|
return curbObjects;
|
||||||
|
}
|
||||||
|
public void setCurbObjects(String curbObjects) {
|
||||||
|
this.curbObjects = curbObjects;
|
||||||
|
}
|
||||||
|
public String getFenceObjects() {
|
||||||
|
return fenceObjects;
|
||||||
|
}
|
||||||
|
public void setFenceObjects(String fenceObjects) {
|
||||||
|
this.fenceObjects = fenceObjects;
|
||||||
|
}
|
||||||
|
public String getBarrierObjects() {
|
||||||
|
return barrierObjects;
|
||||||
|
}
|
||||||
|
public void setBarrierObjects(String barrierObjects) {
|
||||||
|
this.barrierObjects = barrierObjects;
|
||||||
|
}
|
||||||
|
public String getWallObjects() {
|
||||||
|
return wallObjects;
|
||||||
|
}
|
||||||
|
public void setWallObjects(String wallObjects) {
|
||||||
|
this.wallObjects = wallObjects;
|
||||||
|
}
|
||||||
|
public String getEnvironmentObjects() {
|
||||||
|
return environmentObjects;
|
||||||
|
}
|
||||||
|
public void setEnvironmentObjects(String environmentObjects) {
|
||||||
|
this.environmentObjects = environmentObjects;
|
||||||
|
}
|
||||||
public String getBackgroundImage() {
|
public String getBackgroundImage() {
|
||||||
return backgroundImage;
|
return backgroundImage;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ public class LocalInfo {
|
||||||
private double longitude = Double.NaN;
|
private double longitude = Double.NaN;
|
||||||
private int climat = Integer.MAX_VALUE;
|
private int climat = Integer.MAX_VALUE;
|
||||||
private double precipitation = Double.NaN;
|
private double precipitation = Double.NaN;
|
||||||
|
private double bestLap = Double.NaN;
|
||||||
|
|
||||||
public String getStation() {
|
public String getStation() {
|
||||||
return station;
|
return station;
|
||||||
|
@ -87,6 +88,12 @@ public class LocalInfo {
|
||||||
public void setPrecipitation(double precipitation) {
|
public void setPrecipitation(double precipitation) {
|
||||||
this.precipitation = precipitation;
|
this.precipitation = precipitation;
|
||||||
}
|
}
|
||||||
|
public double getBestLap() {
|
||||||
|
return bestLap;
|
||||||
|
}
|
||||||
|
public void setBestLap(double bestLap) {
|
||||||
|
this.bestLap = bestLap;
|
||||||
|
}
|
||||||
|
|
||||||
public void dump(String indent)
|
public void dump(String indent)
|
||||||
{
|
{
|
||||||
|
@ -103,5 +110,6 @@ public class LocalInfo {
|
||||||
System.out.println(indent + " longitude : " + longitude);
|
System.out.println(indent + " longitude : " + longitude);
|
||||||
System.out.println(indent + " climat : " + climat);
|
System.out.println(indent + " climat : " + climat);
|
||||||
System.out.println(indent + " precipitation : " + precipitation);
|
System.out.println(indent + " precipitation : " + precipitation);
|
||||||
|
System.out.println(indent + " bestLap : " + bestLap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue