diff --git a/src/Classes/Project.gd b/src/Classes/Project.gd index d8cb9d59d..3d0307dcc 100644 --- a/src/Classes/Project.gd +++ b/src/Classes/Project.gd @@ -352,7 +352,7 @@ func deserialize(dict: Dictionary, zip_reader: ZIPReader = null, file: FileAcces if dict.has("tilesets"): for saved_tileset in dict["tilesets"]: var tile_size = str_to_var("Vector2i" + saved_tileset.get("tile_size")) - var tileset := TileSetCustom.new(tile_size) + var tileset := TileSetCustom.new(tile_size, "", false) tileset.deserialize(saved_tileset) tilesets.append(tileset) if dict.has("frames") and dict.has("layers"): diff --git a/src/Classes/TileSetCustom.gd b/src/Classes/TileSetCustom.gd index 8870629f6..dd6aeb451 100644 --- a/src/Classes/TileSetCustom.gd +++ b/src/Classes/TileSetCustom.gd @@ -39,11 +39,12 @@ class Tile: return times_used <= 0 -func _init(_tile_size: Vector2i, _name := "") -> void: +func _init(_tile_size: Vector2i, _name := "", add_empty_tile := true) -> void: tile_size = _tile_size name = _name - var empty_image := Image.create_empty(tile_size.x, tile_size.y, false, Image.FORMAT_RGBA8) - tiles.append(Tile.new(empty_image)) + if add_empty_tile: + var empty_image := Image.create_empty(tile_size.x, tile_size.y, false, Image.FORMAT_RGBA8) + tiles.append(Tile.new(empty_image)) ## Adds a new [param image] as a tile to the tileset.