maps4fs 1.8.237__py3-none-any.whl → 1.8.238__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,7 +3,6 @@ around the map."""
3
3
 
4
4
  from __future__ import annotations
5
5
 
6
- import json
7
6
  import os
8
7
  import shutil
9
8
  from copy import deepcopy
@@ -401,13 +400,11 @@ class Background(MeshComponent, ImageComponent):
401
400
 
402
401
  def create_background_textures(self) -> None:
403
402
  """Creates background textures for the map."""
404
- if not os.path.isfile(self.game.texture_schema):
405
- self.logger.warning("Texture schema file not found: %s", self.game.texture_schema)
403
+ layers_schema = self.map.texture_schema
404
+ if not layers_schema:
405
+ self.logger.warning("No texture schema found.")
406
406
  return
407
407
 
408
- with open(self.game.texture_schema, "r", encoding="utf-8") as f:
409
- layers_schema = json.load(f)
410
-
411
408
  background_layers = []
412
409
  for layer in layers_schema:
413
410
  if layer.get("background") is True:
maps4fs/generator/map.py CHANGED
@@ -184,6 +184,18 @@ class Map:
184
184
  except Exception as e:
185
185
  raise RuntimeError(f"Can not unpack map template due to error: {e}") from e
186
186
 
187
+ @property
188
+ def texture_schema(self) -> list[dict[str, Any]] | None:
189
+ """Return texture schema (custom if provided, default otherwise).
190
+
191
+ Returns:
192
+ list[dict[str, Any]] | None: Texture schema.
193
+ """
194
+ if self.texture_custom_schema:
195
+ return self.texture_custom_schema
196
+ with open(self.game.texture_schema, "r", encoding="utf-8") as file:
197
+ return json.load(file)
198
+
187
199
  def generate(self) -> Generator[str, None, None]:
188
200
  """Launch map generation using all components. Yield component names during the process.
189
201
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: maps4fs
3
- Version: 1.8.237
3
+ Version: 1.8.238
4
4
  Summary: Generate map templates for Farming Simulator from real places.
5
5
  Author-email: iwatkot <iwatkot@gmail.com>
6
6
  License: MIT License
@@ -3,12 +3,12 @@ maps4fs/logger.py,sha256=HQrDyj72mUjVYo25aR_-_SxVn2rfFjDCNbj-JKJdSnE,1488
3
3
  maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
4
4
  maps4fs/generator/dem.py,sha256=a9B3tatj7pzvvdLIyLw7BA3JoDTibFczpqiXJnx054U,12864
5
5
  maps4fs/generator/game.py,sha256=NZaxj5z7WzMiHzAvQyr-TvVjGoHgqGldM6ZsItuYyzA,11292
6
- maps4fs/generator/map.py,sha256=tgbpu3xxtFFWMualvaOnfnBXjDYWqAa_xIpu-OvcnbQ,12636
6
+ maps4fs/generator/map.py,sha256=9tQTEMYvh4RSC5ACp7fE7RhVDGa7Mc-P5W95h-Zineg,13069
7
7
  maps4fs/generator/qgis.py,sha256=Es8hLuqN_KH8lDfnJE6He2rWYbAKJ3RGPn-o87S6CPI,6116
8
8
  maps4fs/generator/settings.py,sha256=-QdpmIoMiWXPeqYX5QQ5Pplz9xHk2OnyBdzRIc7aB44,6848
9
9
  maps4fs/generator/statistics.py,sha256=aynS3zbAtiwnU_YLKHPTiiaKW98_suvQUhy1SGBA6mc,2448
10
10
  maps4fs/generator/component/__init__.py,sha256=s01yVVVi8R2xxNvflu2D6wTd9I_g73AMM2x7vAC7GX4,490
11
- maps4fs/generator/component/background.py,sha256=RhUDOTfo7Ph9B2bM5tp85wTg6FKycpsf1L_pHYa2TLc,21152
11
+ maps4fs/generator/component/background.py,sha256=RpEjOW7ray0h_Jd6Mf8XEzGjKtJeYPzze9bPT8M1fhA,21011
12
12
  maps4fs/generator/component/config.py,sha256=RitKgFDZPzjA1fi8GcEi1na75qqaueUvpcITHjBvCXc,3674
13
13
  maps4fs/generator/component/grle.py,sha256=C6wpYQrJBVRb3vVbEAY5BYTRYU9BaefmoWCXoPrVn2A,19454
14
14
  maps4fs/generator/component/i3d.py,sha256=yWGs5eBuBT7V4F6SbTNAmF-8fj2Zy4kcC5OKZ_XVICs,21329
@@ -53,8 +53,8 @@ maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,4
53
53
  maps4fs/toolbox/background.py,sha256=RclEqxEWLbMxuEkkegQP8jybzugwQ1_R3rdfDe0s21U,2104
54
54
  maps4fs/toolbox/custom_osm.py,sha256=X6ZlPqiOhNjkmdD_qVroIfdOl9Rb90cDwVSLDVYgx80,1892
55
55
  maps4fs/toolbox/dem.py,sha256=z9IPFNmYbjiigb3t02ZenI3Mo8odd19c5MZbjDEovTo,3525
56
- maps4fs-1.8.237.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
57
- maps4fs-1.8.237.dist-info/METADATA,sha256=cYwHiebwnB_vFE-JNMqZBw2xXiU4XNL5rJjWAOpldCY,46159
58
- maps4fs-1.8.237.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
59
- maps4fs-1.8.237.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
60
- maps4fs-1.8.237.dist-info/RECORD,,
56
+ maps4fs-1.8.238.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
57
+ maps4fs-1.8.238.dist-info/METADATA,sha256=5zXEOsIxjrknQLlwShN1CsM7Br62aJUMaDJ2F2UlGec,46159
58
+ maps4fs-1.8.238.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
59
+ maps4fs-1.8.238.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
60
+ maps4fs-1.8.238.dist-info/RECORD,,