@@ -56,15 +56,15 @@ def __init__(self):
5656
5757 def resolve_path (self , path : str ) -> str :
5858 path = path .replace ("%USERPROFILE%" , os .environ .get ("USERPROFILE" , "" ))
59-
59+
6060 if "%GAME_DOCUMENTS%" in path :
6161 game_docs = self .GameDocumentsDirectory .replace ("%USERPROFILE%" , os .environ .get ("USERPROFILE" , "" ))
6262 path = path .replace ("%GAME_DOCUMENTS%" , game_docs )
63-
63+
6464 if "%GAME_PATH%" in path :
6565 game_path = self ._gamePath if hasattr (self , '_gamePath' ) else ""
6666 path = path .replace ("%GAME_PATH%" , game_path )
67-
67+
6868 return path
6969
7070 def init (self , organizer : mobase .IOrganizer ) -> bool :
@@ -74,7 +74,7 @@ def init(self, organizer: mobase.IOrganizer) -> bool:
7474 BasicLocalSavegames (QDir (self .resolve_path (self .GameSavesDirectory )))
7575 )
7676< << << << HEAD
77-
77+
7878== == == =
7979
8080 # Create the directory more reliably
@@ -93,7 +93,7 @@ def init(self, organizer: mobase.IOrganizer) -> bool:
9393 except Exception as e :
9494< << << << HEAD
9595 self ._organizer .log (mobase .LogLevel .ERROR , f"Unexpected error creating mod directory: { e } " )
96-
96+
9797 organizer .onUserInterfaceInitialized (self .init_tab )
9898== == == =
9999 print (f"Error creating mod directory: { e } " )
@@ -135,17 +135,17 @@ def init_tab(self, main_window: QMainWindow):
135135 def mappings (self ) -> List [mobase .Mapping ]:
136136 pak_extensions = ["*.pak" , "*.utoc" , "*.ucas" ]
137137 target_dir = "Content/Paks/~mods/"
138-
138+
139139 mappings = []
140-
140+
141141 for ext in pak_extensions :
142142 mappings .append (mobase .Mapping (ext , target_dir , False ))
143-
143+
144144 source_dirs = ["Paks/" , "~mods/" , "Content/Paks/~mods/" ]
145145 for source_dir in source_dirs :
146146 for ext in pak_extensions :
147147 mappings .append (mobase .Mapping (f"{ source_dir } { ext } " , target_dir , False ))
148-
148+
149149 return mappings
150150
151151 def gameDirectory (self ) -> QDir :
@@ -155,23 +155,23 @@ def paksDirectory(self) -> QDir:
155155< << << << HEAD
156156 path = os .path .join (self .gameDirectory ().absolutePath (), self .GameDataPath , "Content" , "Paks" )
157157 return QDir (path )
158-
158+
159159 def paksModsDirectory (self ) -> QDir :
160160 try :
161161 path = os .path .join (self .paksDirectory ().absolutePath (), "~mods" )
162162 return QDir (path )
163163 except Exception as e :
164164 fallback = os .path .join (self .gameDirectory ().absolutePath (), self .GameDataPath , "Content" , "Paks" , "~mods" )
165165 return QDir (fallback )
166-
166+
167167 def logicModsDirectory (self ) -> QDir :
168168 path = os .path .join (self .gameDirectory ().absolutePath (), self .GameDataPath , "Content" , "Paks" , "LogicMods" )
169169 return QDir (path )
170-
170+
171171 def binariesDirectory (self ) -> QDir :
172172 path = os .path .join (self .gameDirectory ().absolutePath (), self .GameDataPath , "Binaries" , "Win64" )
173173 return QDir (path )
174-
174+
175175== == == =
176176 return QDir (self .gameDirectory ().absolutePath () + "/Stalker2/Content/Paks" )
177177
@@ -199,16 +199,16 @@ def activeProblems(self) -> list[int]:
199199 problems = set ()
200200 if self ._organizer .managedGame () == self :
201201< << << << HEAD
202-
202+
203203 mod_path = self .paksModsDirectory ().absolutePath ()
204204 if not os .path .isdir (mod_path ):
205205 problems .add (Problems .MISSING_MOD_DIRECTORIES )
206206 self ._organizer .log (mobase .LogLevel .DEBUG , f"Missing mod directory: { mod_path } " )
207-
207+
208208 for mod in self ._organizer .modList ().allMods ():
209209 mod_info = self ._organizer .modList ().getMod (mod )
210210 filetree = mod_info .fileTree ()
211-
211+
212212== == == =
213213 # More reliable directory check using os.path
214214 mod_path = self .paksModsDirectory ().absolutePath ()
0 commit comments