|
1 | 1 | /*global tiled, TextFile */
|
2 | 2 | class GodotTilesetExporter {
|
3 | 3 |
|
| 4 | + // noinspection DuplicatedCode |
4 | 5 | constructor(tileset, fileName) {
|
5 | 6 | this.tileset = tileset;
|
6 | 7 | this.fileName = fileName;
|
7 | 8 | // noinspection JSUnresolvedFunction
|
8 | 9 | this.projectRoot = this.tileset.property("projectRoot");
|
9 |
| - if(!this.projectRoot) { |
| 10 | + if (!this.projectRoot) { |
10 | 11 | throw new Error("Missing mandatory custom property: projectRoot!");
|
11 | 12 | }
|
12 | 13 | this.projectRoot = this.projectRoot.replace('\\', '/');
|
@@ -90,7 +91,7 @@ class GodotTilesetExporter {
|
90 | 91 |
|
91 | 92 | exportShapes(tile, autotileCoordinates) {
|
92 | 93 | if (this.firstShapeID === "") {
|
93 |
| - this.firstShapeID = 'SubResource( ' + tile.id + ' )'; |
| 94 | + this.firstShapeID = 'SubResource( ' + tile.id + ' )'; |
94 | 95 | }
|
95 | 96 | this.shapes += this.getShapesTemplate(
|
96 | 97 | autotileCoordinates,
|
@@ -158,7 +159,7 @@ ${this.shapesResources}[resource]
|
158 | 159 | object.polygon.forEach((coordinate) => {
|
159 | 160 | let coordinateX = (object.x + coordinate.x);
|
160 | 161 | let coordinateY = (object.y + coordinate.y);
|
161 |
| - coordinateString += coordinateX + ", " + coordinateY + ", "; |
| 162 | + coordinateString += coordinateX + ", " + coordinateY + ", "; |
162 | 163 | });
|
163 | 164 | // Remove trailing commas and blank
|
164 | 165 | coordinateString = coordinateString.replace(/,\s*$/, "");
|
|
0 commit comments