Skip to content

Commit 3730421

Browse files
committed
2 parents 060b3ff + d24e955 commit 3730421

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

games/game_stalker2heartofchornobyl.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,19 @@ def __init__(self):
5353
def resolve_path(self, path: str) -> str:
5454
path = path.replace("%USERPROFILE%", os.environ.get("USERPROFILE", ""))
5555

56+
5657
if "%GAME_DOCUMENTS%" in path:
5758
game_docs = self.GameDocumentsDirectory.replace(
5859
"%USERPROFILE%", os.environ.get("USERPROFILE", "")
5960
)
6061
path = path.replace("%GAME_DOCUMENTS%", game_docs)
6162

63+
6264
if "%GAME_PATH%" in path:
6365
game_path = self._gamePath if hasattr(self, "_gamePath") else ""
6466
path = path.replace("%GAME_PATH%", game_path)
6567

68+
6669
return path
6770

6871
def init(self, organizer: mobase.IOrganizer) -> bool:
@@ -135,16 +138,20 @@ def mappings(self) -> List[mobase.Mapping]:
135138
pak_extensions = ["*.pak", "*.utoc", "*.ucas"]
136139
target_dir = "Content/Paks/~mods/"
137140

141+
138142
mappings = []
139143

144+
140145
for ext in pak_extensions:
141146
mappings.append(mobase.Mapping(ext, target_dir, False))
142147

148+
143149
source_dirs = ["Paks/", "~mods/", "Content/Paks/~mods/"]
144150
for source_dir in source_dirs:
145151
for ext in pak_extensions:
146152
mappings.append(mobase.Mapping(f"{source_dir}{ext}", target_dir, False))
147153

154+
148155
return mappings
149156

150157
def gameDirectory(self) -> QDir:
@@ -156,6 +163,7 @@ def paksDirectory(self) -> QDir:
156163
)
157164
return QDir(path)
158165

166+
159167
def paksModsDirectory(self) -> QDir:
160168
try:
161169
path = os.path.join(self.paksDirectory().absolutePath(), "~mods")
@@ -170,6 +178,7 @@ def paksModsDirectory(self) -> QDir:
170178
)
171179
return QDir(fallback)
172180

181+
173182
def logicModsDirectory(self) -> QDir:
174183
path = os.path.join(
175184
self.gameDirectory().absolutePath(),
@@ -180,6 +189,7 @@ def logicModsDirectory(self) -> QDir:
180189
)
181190
return QDir(path)
182191

192+
183193
def binariesDirectory(self) -> QDir:
184194
path = os.path.join(
185195
self.gameDirectory().absolutePath(),

games/stalker2heartofchornobyl/paks/model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def dropMimeData(
204204
before_paks_p: list[_PakInfo] = []
205205
moved_paks_p: list[_PakInfo] = []
206206
after_paks_p: list[_PakInfo] = []
207-
207+
208208
for row, paks in sorted(self.paks.items()):
209209
if row < new_priority:
210210
if row in source_rows:

games/stalker2heartofchornobyl/paks/widget.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def _parse_pak_files(self):
123123
pak_source: dict[str, str] = {}
124124
existing_folders: set[int] = set()
125125
<<<<<<< HEAD
126-
126+
127127
=======
128128

129129
print(f"[PAK Debug] Starting scan of {len(mods)} mods")
@@ -150,7 +150,7 @@ def _parse_pak_files(self):
150150
<<<<<<< HEAD
151151
except ValueError:
152152
pass
153-
153+
154154
=======
155155
print(
156156
f"[PAK Debug] Found existing numbered folder: {folder_num}"
@@ -230,7 +230,7 @@ def _parse_pak_files(self):
230230

231231
sorted_paks = dict(sorted(paks.items(), key=cmp_to_key(pak_sort)))
232232
shaken_paks: list[str] = self._shake_paks(sorted_paks)
233-
233+
234234
=======
235235
print(
236236
f"[PAK Debug] ✅ Added loose PAK from ~mods: {pak_name}"
@@ -263,7 +263,7 @@ def _parse_pak_files(self):
263263
while pak_index in existing_folders:
264264
pak_index -= 1
265265
<<<<<<< HEAD
266-
266+
267267
=======
268268

269269
# If PAK is already in a numbered folder, keep its current assignment
@@ -279,7 +279,7 @@ def _parse_pak_files(self):
279279

280280
final_paks[pak] = (pak_source[pak], pak_paths[pak][0], target_dir)
281281
<<<<<<< HEAD
282-
282+
283283
=======
284284

285285
# Convert to model format (4-tuple matching Oblivion Remastered)
@@ -291,7 +291,7 @@ def _parse_pak_files(self):
291291
new_data_paks[i] = (pak, source, current_path, target_path)
292292
i += 1
293293
<<<<<<< HEAD
294-
294+
295295
=======
296296

297297
print(f"[PAK Debug] Final PAK count: {len(new_data_paks)}")

0 commit comments

Comments
 (0)