From e5cd08bb981297a01fd8b66a45e783faefc165ac Mon Sep 17 00:00:00 2001 From: Benjamin Auquite Date: Fri, 15 Mar 2024 11:06:25 -0500 Subject: [PATCH] use code from #56 to fix issue with utp inventory --- Libraries/PyKotor/src/pykotor/extract/installation.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Libraries/PyKotor/src/pykotor/extract/installation.py b/Libraries/PyKotor/src/pykotor/extract/installation.py index 836987628..1fe996737 100644 --- a/Libraries/PyKotor/src/pykotor/extract/installation.py +++ b/Libraries/PyKotor/src/pykotor/extract/installation.py @@ -697,7 +697,7 @@ def override_list(self) -> list[str]: def override_resources( self, - directory: str, + directory: str | None = None, ) -> list[FileResource]: """Returns a list of FileResources stored in the specified subdirectory located in the 'override' folder linked to the Installation. @@ -707,7 +707,14 @@ def override_resources( ------- A list of FileResources. """ - return self._override[directory] + if not self._override or directory and directory not in self._override: + self.load_override() + + return ( + self._override[directory] + if directory + else [override_resource for ov_subfolder_name in self._override for override_resource in self._override[ov_subfolder_name]] + ) # endregion