Skip to content

Commit aef70d3

Browse files
Darkest Dungeon update (#205)
1 parent d7e0c5a commit aef70d3

File tree

1 file changed

+35
-27
lines changed

1 file changed

+35
-27
lines changed

games/game_darkestdungeon.py

Lines changed: 35 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
from pathlib import Path
33

4-
from PyQt6.QtCore import QDir, QFileInfo, QStandardPaths
4+
from PyQt6.QtCore import QDir, QFileInfo
55

66
import mobase
77

@@ -167,27 +167,38 @@ class DarkestDungeonGame(BasicGame):
167167
GameNexusId = 804
168168
GameSteamId = 262060
169169
GameGogId = 1719198803
170-
GameBinary = "_windowsnosteam/win64/darkest.exe"
170+
GameBinary = "_windows/win64/Darkest.exe"
171171
GameDataPath = ""
172-
GameSupportURL = (
173-
r"https://github.com/ModOrganizer2/modorganizer-basic_games/wiki/"
174-
"Game:-Darkest-Dungeon"
175-
)
172+
GameDocumentsDirectory = "%DOCUMENTS%/Darkest"
173+
GameSavesDirectory = "%GAME_DOCUMENTS%"
174+
GameSupportURL = "https://github.com/ModOrganizer2/modorganizer-basic_games/wiki/Game:-Darkest-Dungeon"
176175

177176
def init(self, organizer: mobase.IOrganizer) -> bool:
178177
super().init(organizer)
179178
self._register_feature(DarkestDungeonModDataChecker())
180179
return True
181180

182-
def executables(self):
183-
if self.is_steam():
184-
path = QFileInfo(self.gameDirectory(), "_windows/win64/darkest.exe")
185-
else:
186-
path = QFileInfo(self.gameDirectory(), "_windowsnosteam/win64/darkest.exe")
181+
def executables(self) -> list[mobase.ExecutableInfo]:
182+
game_name = self.gameName()
183+
game_dir = self.gameDirectory()
184+
187185
return [
188-
mobase.ExecutableInfo("Darkest Dungeon", path).withWorkingDirectory(
189-
self.gameDirectory()
190-
),
186+
mobase.ExecutableInfo(
187+
f"{game_name} Steam x64",
188+
QFileInfo(game_dir, "_windows/win64/Darkest.exe"),
189+
).withWorkingDirectory(game_dir),
190+
mobase.ExecutableInfo(
191+
f"{game_name} x64",
192+
QFileInfo(game_dir, "_windowsnosteam/win64/Darkest.exe"),
193+
).withWorkingDirectory(game_dir),
194+
mobase.ExecutableInfo(
195+
f"{game_name} Steam x32",
196+
QFileInfo(game_dir, "_windows/win32/Darkest.exe"),
197+
).withWorkingDirectory(game_dir),
198+
mobase.ExecutableInfo(
199+
f"{game_name} x32",
200+
QFileInfo(game_dir, "_windowsnosteam/win32/Darkest.exe"),
201+
).withWorkingDirectory(game_dir),
191202
]
192203

193204
@staticmethod
@@ -211,19 +222,16 @@ def getCloudSaveDirectory() -> str | None:
211222
return None
212223

213224
def savesDirectory(self) -> QDir:
214-
documentsSaves = QDir(
215-
"{}/Darkest".format(
216-
QStandardPaths.writableLocation(
217-
QStandardPaths.StandardLocation.DocumentsLocation
218-
)
219-
)
220-
)
221-
if self.is_steam():
222-
cloudSaves = self.getCloudSaveDirectory()
223-
if cloudSaves is None:
224-
return documentsSaves
225-
return QDir(cloudSaves)
226-
return documentsSaves
225+
documentsSaves = self.documentsDirectory()
226+
227+
if not self.is_steam():
228+
return documentsSaves
229+
230+
cloudSaves = self.getCloudSaveDirectory()
231+
if cloudSaves is None:
232+
return documentsSaves
233+
234+
return QDir(cloudSaves)
227235

228236
def listSaves(self, folder: QDir) -> list[mobase.ISaveGame]:
229237
profiles: list[Path] = []

0 commit comments

Comments
 (0)