Skip to content

Commit 4e2383c

Browse files
authored
Merge pull request #27 from Holt59/v2.3.x
Update on 2.3.x from master.
2 parents eb98170 + 19c7c85 commit 4e2383c

File tree

4 files changed

+77
-7
lines changed

4 files changed

+77
-7
lines changed

basic_game.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ def replace_variables(value: str, game: "BasicGame") -> str:
2020
"%DOCUMENTS%",
2121
QStandardPaths.writableLocation(QStandardPaths.DocumentsLocation),
2222
)
23+
if value.find("%USERPROFILE%") != -1:
24+
value = value.replace(
25+
"%USERPROFILE%",
26+
QStandardPaths.writableLocation(QStandardPaths.HomeLocation),
27+
)
2328
if value.find("%GAME_DOCUMENTS%") != -1:
2429
value = value.replace(
2530
"%GAME_DOCUMENTS%", game.documentsDirectory().absolutePath()
@@ -349,7 +354,11 @@ def version(self) -> mobase.VersionInfo:
349354
return self._mappings.version.get()
350355

351356
def isActive(self) -> bool:
352-
return True
357+
if not self._organizer.managedGame():
358+
return False
359+
360+
# Note: self is self._organizer.managedGame() does not work:
361+
return self.name() == self._organizer.managedGame().name()
353362

354363
def settings(self) -> List[mobase.PluginSetting]:
355364
return []

games/game_darkestdungeon.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,22 +10,23 @@
1010
class DarkestDungeonGame(BasicGame):
1111
Name = "DarkestDungeon"
1212
Author = "erri120"
13-
Version = "0.1.0"
13+
Version = "0.1.1"
1414

1515
GameName = "Darkest Dungeon"
1616
GameShortName = "darkestdungeon"
1717
GameNexusName = "darkestdungeon"
1818
GameNexusId = 804
1919
GameSteamId = 262060
20-
GameBinary = "_windows//darkest.exe"
20+
GameGogId = 1719198803
21+
GameBinary = "_windowsnosteam//darkest.exe"
2122
GameDataPath = ""
2223

2324
def executables(self):
25+
path = QFileInfo(self.gameDirectory(), "_windows/darkest.exe")
26+
if not path.exists():
27+
path = QFileInfo(self.gameDirectory(), "_windowsnosteam/darkest.exe")
2428
return [
25-
mobase.ExecutableInfo(
26-
"Darkest Dungeon",
27-
QFileInfo(self.gameDirectory(), "_windows//darkest.exe"),
28-
),
29+
mobase.ExecutableInfo("Darkest Dungeon", path),
2930
]
3031

3132
def savesDirectory(self):
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# -*- encoding: utf-8 -*-
2+
3+
from ..basic_game import BasicGame
4+
5+
import os
6+
from PyQt5.QtCore import QDir
7+
8+
9+
class KingdomComeDeliveranceGame(BasicGame):
10+
Name = "Kingdom Come Deliverance Support Plugin"
11+
Author = "Silencer711"
12+
Version = "1.0.0"
13+
14+
GameName = "Kingdom Come: Deliverance"
15+
GameShortName = "kingdomcomedeliverance"
16+
GameNexusName = "kingdomcomedeliverance"
17+
GameNexusId = 2298
18+
GameSteamId = [379430]
19+
GameGogId = [1719198803]
20+
GameBinary = "bin/Win64/KingdomCome.exe"
21+
GameDataPath = "mods"
22+
GameSaveExtension = "whs"
23+
GameDocumentsDirectory = "%GAME_PATH%"
24+
GameSavesDirectory = "%USERPROFILE%/Saved Games/kingdomcome/saves"
25+
26+
def iniFiles(self):
27+
return ["custom.cfg", "system.cfg", "user.cfg"]
28+
29+
def initializeProfile(self, path: QDir, settings: int):
30+
# Create .cfg files if they don't exist
31+
for iniFile in self.iniFiles():
32+
iniPath = self.documentsDirectory().absoluteFilePath(iniFile)
33+
if not os.path.exists(iniPath):
34+
with open(iniPath, "w") as _:
35+
pass
36+
37+
# Create the mods directory if it doesn't exist
38+
modsPath = self.dataDirectory().absolutePath()
39+
if not os.path.exists(modsPath):
40+
os.mkdir(modsPath)
41+
42+
super().initializeProfile(path, settings)

games/game_nomanssky.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# -*- encoding: utf-8 -*-
2+
3+
from ..basic_game import BasicGame
4+
5+
6+
class NoMansSkyGame(BasicGame):
7+
8+
Name = "Mo Man's Sky Support Plugin"
9+
Author = "Luca/EzioTheDeadPoet"
10+
Version = "1.0.0"
11+
12+
GameName = "Mo Man's Sky"
13+
GameShortName = "nomanssky"
14+
GaneNexusHame = "nomanssky"
15+
GameSteamId = 275850
16+
GameGogId = 1446213994
17+
GameBinary = "Binaries/NMS.exe"
18+
GameDataPath = "GAMEDATA/PCBANKS/MODS"

0 commit comments

Comments
 (0)