Skip to content

Commit 96e23fa

Browse files
committed
add yaml <-> json conversion options
1 parent ae7f8c7 commit 96e23fa

1 file changed

Lines changed: 15 additions & 7 deletions

File tree

games/game_baldursgate3.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ def settings(self):
229229
"Convert YAMLs to JSONs when executable runs. Allows one to configure ScriptExtender and related mods with YAML files.",
230230
False,
231231
),
232+
mobase.PluginSetting(
233+
"convert_yamls_to_json",
234+
"Convert YAMLs to JSONs when executable runs. Allows one to configure ScriptExtender and related mods with YAML files.",
235+
False,
236+
),
232237
]
233238
for setting in custom_settings:
234239
setting.description = self.__tr(setting.description)
@@ -305,14 +310,17 @@ def map_files(
305310
(lambda f: os.path.relpath(f, path)) if rel else lambda f: f.name
306311
)
307312
found_jsons: set[Path] = set()
308-
add_mapping: Callable[[Path], None] = lambda file: mappings.append(
309-
mobase.Mapping(
310-
source=str(file),
311-
destination=str(dest / dest_func(file)),
312-
is_directory=file.is_dir(),
313-
create_target=True,
313+
314+
def add_mapping(file: Path):
315+
mappings.append(
316+
mobase.Mapping(
317+
source=str(file),
318+
destination=str(dest / dest_func(file)),
319+
is_directory=file.is_dir(),
320+
create_target=True,
321+
)
314322
)
315-
)
323+
316324
for file in list(path.rglob(pattern)):
317325
if self._convert_yamls_to_json and (
318326
file.name.endswith(".yaml") or file.name.endswith(".yml")

0 commit comments

Comments
 (0)