|
1 | 1 | from __future__ import annotations |
2 | 2 |
|
3 | 3 | import fnmatch |
4 | | -import os |
5 | 4 | from pathlib import Path |
6 | 5 |
|
7 | | -import mobase |
8 | 6 | from PyQt6.QtCore import QDir |
9 | 7 |
|
| 8 | +import mobase |
| 9 | + |
10 | 10 | from ..basic_features import BasicModDataChecker, GlobPatterns |
11 | 11 | from ..basic_features.basic_save_game_info import ( |
12 | 12 | BasicGameSaveGame, |
@@ -100,10 +100,10 @@ class SubnauticaGame(BasicGame, mobase.IPluginFileMapper): |
100 | 100 | ) |
101 | 101 | GameSavesDirectory = r"%GAME_PATH%\SNAppData\SavedGames" |
102 | 102 |
|
103 | | - _game_extra_save_paths = [ |
| 103 | + _game_saves_directory_epic = ( |
104 | 104 | r"%USERPROFILE%\Appdata\LocalLow\Unknown Worlds" |
105 | 105 | r"\Subnautica\Subnautica\SavedGames" |
106 | | - ] |
| 106 | + ) |
107 | 107 |
|
108 | 108 | _forced_libraries = ["winhttp.dll"] |
109 | 109 |
|
@@ -157,14 +157,15 @@ def settings(self) -> list[mobase.PluginSetting]: |
157 | 157 | ) |
158 | 158 | ] |
159 | 159 |
|
| 160 | + def savesDirectory(self) -> QDir: |
| 161 | + if self.is_epic(): |
| 162 | + return QDir(self._game_saves_directory_epic) |
| 163 | + return super().savesDirectory() |
| 164 | + |
160 | 165 | def listSaves(self, folder: QDir) -> list[mobase.ISaveGame]: |
161 | 166 | return [ |
162 | | - BasicGameSaveGame(folder) |
163 | | - for save_path in ( |
164 | | - folder.absolutePath(), |
165 | | - *(os.path.expandvars(p) for p in self._game_extra_save_paths), |
166 | | - ) |
167 | | - for folder in Path(save_path).glob("slot*") |
| 167 | + BasicGameSaveGame(path) |
| 168 | + for path in Path(folder.absolutePath()).glob("slot*") |
168 | 169 | ] |
169 | 170 |
|
170 | 171 | def executables(self) -> list[mobase.ExecutableInfo]: |
|
0 commit comments