Skip to content

Commit cab768d

Browse files
committed
Reformat and release v.1.0
1 parent d966024 commit cab768d

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

export_to_godot_tilemap.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/*global tiled, TextFile */
22
class GodotTilemapExporter {
33

4+
// noinspection DuplicatedCode
45
constructor(map, fileName) {
56
this.map = map;
67
this.fileName = fileName;
78
// noinspection JSUnresolvedFunction
89
this.projectRoot = this.map.property("projectRoot");
9-
if(!this.projectRoot) {
10+
if (!this.projectRoot) {
1011
throw new Error("Missing mandatory custom property: projectRoot!");
1112
}
1213
this.projectRoot = this.projectRoot.replace('\\', '/');
@@ -141,8 +142,8 @@ class GodotTilemapExporter {
141142
* */
142143
let yValue = y;
143144
let xValue = x;
144-
if(xValue < 0) {
145-
yValue = y +1;
145+
if (xValue < 0) {
146+
yValue = y + 1;
146147
}
147148
let firstParam = xValue + (yValue * this.tileOffset);
148149

export_to_godot_tileset.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
/*global tiled, TextFile */
22
class GodotTilesetExporter {
33

4+
// noinspection DuplicatedCode
45
constructor(tileset, fileName) {
56
this.tileset = tileset;
67
this.fileName = fileName;
78
// noinspection JSUnresolvedFunction
89
this.projectRoot = this.tileset.property("projectRoot");
9-
if(!this.projectRoot) {
10+
if (!this.projectRoot) {
1011
throw new Error("Missing mandatory custom property: projectRoot!");
1112
}
1213
this.projectRoot = this.projectRoot.replace('\\', '/');
@@ -90,7 +91,7 @@ class GodotTilesetExporter {
9091

9192
exportShapes(tile, autotileCoordinates) {
9293
if (this.firstShapeID === "") {
93-
this.firstShapeID = 'SubResource( ' + tile.id + ' )';
94+
this.firstShapeID = 'SubResource( ' + tile.id + ' )';
9495
}
9596
this.shapes += this.getShapesTemplate(
9697
autotileCoordinates,
@@ -158,7 +159,7 @@ ${this.shapesResources}[resource]
158159
object.polygon.forEach((coordinate) => {
159160
let coordinateX = (object.x + coordinate.x);
160161
let coordinateY = (object.y + coordinate.y);
161-
coordinateString += coordinateX + ", " + coordinateY + ", ";
162+
coordinateString += coordinateX + ", " + coordinateY + ", ";
162163
});
163164
// Remove trailing commas and blank
164165
coordinateString = coordinateString.replace(/,\s*$/, "");

0 commit comments

Comments
 (0)