[Baldur's Gate 3]: Various bug fixes (#193)

* Add additional DLLs to the lslib retriever
* Fix regex pattern for folder name in pak_parser
* Ensure log directory is created if missing
* Update pak file naming to include parent directory name
This commit is contained in:
Gabriel
2025-09-15 09:56:40 +02:00
committed by GitHub
parent d29425cef8
commit cae15affee
3 changed files with 10 additions and 2 deletions
+3
View File
@@ -25,9 +25,12 @@ class LSLibRetriever:
"Divine.dll.config",
"Divine.exe",
"Divine.runtimeconfig.json",
"K4os.Compression.LZ4.dll",
"K4os.Compression.LZ4.Streams.dll",
"LSLib.dll",
"LSLibNative.dll",
"LZ4.dll",
"Newtonsoft.Json.dll",
"System.IO.Hashing.dll",
"ZstdSharp.dll",
}
+6 -2
View File
@@ -154,7 +154,11 @@ class BG3PakParser:
f"pak with same name as packable dir exists in mod directory. not packing dir {file}"
)
return ""
pak_path = self._utils.overwrite_path / f"Mods/{file.name}.pak"
parent_mod_name = file.parent.name.replace(" ", "_")
pak_path = (
self._utils.overwrite_path
/ f"Mods/{parent_mod_name}_{file.name}.pak"
)
build_pak = True
if pak_path.exists():
pak_creation_time = os.path.getmtime(pak_path)
@@ -249,7 +253,7 @@ class BG3PakParser:
# 2. it has files in Mods/<folder_name>/ other than the meta.lsx file, or
# 3. it has files in Public/<folder_name>
result = self.run_divine(
f'list-package --use-regex -x "(/{folder_name}/(?!meta\\.lsx))|(Public/Engine/Timeline/MaterialGroups)"',
f'list-package --use-regex -x "(/{re.escape(folder_name)}/(?!meta\\.lsx))|(Public/Engine/Timeline/MaterialGroups)"',
file,
)
self._mod_cache[file] = (
+1
View File
@@ -179,6 +179,7 @@ class BG3Game(BasicGame, bg3_file_mapper.BG3FileMapper):
def _on_finished_run(self, exec_path: str, exit_code: int):
if "bin/bg3" not in exec_path:
return
self.utils.log_dir.mkdir(parents=True, exist_ok=True)
if self.utils.log_diff:
for x in difflib.unified_diff(
open(self.utils.modsettings_backup).readlines(),