From 19c7c8556c05601f400ae3a4cf377294c30d8c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mika=C3=ABl=20Capelle?= Date: Sun, 3 Jan 2021 11:41:50 +0100 Subject: [PATCH] Multiple updates from master for 2.3.2 release. --- basic_game.py | 5 ++++ games/game_darkestdungeon.py | 13 +++++---- games/game_kingdomcomedeliverance.py | 42 ++++++++++++++++++++++++++++ games/game_nomanssky.py | 18 ++++++++++++ 4 files changed, 72 insertions(+), 6 deletions(-) create mode 100644 games/game_kingdomcomedeliverance.py create mode 100644 games/game_nomanssky.py diff --git a/basic_game.py b/basic_game.py index ec91729..7bbd785 100644 --- a/basic_game.py +++ b/basic_game.py @@ -20,6 +20,11 @@ def replace_variables(value: str, game: "BasicGame") -> str: "%DOCUMENTS%", QStandardPaths.writableLocation(QStandardPaths.DocumentsLocation), ) + if value.find("%USERPROFILE%") != -1: + value = value.replace( + "%USERPROFILE%", + QStandardPaths.writableLocation(QStandardPaths.HomeLocation), + ) if value.find("%GAME_DOCUMENTS%") != -1: value = value.replace( "%GAME_DOCUMENTS%", game.documentsDirectory().absolutePath() diff --git a/games/game_darkestdungeon.py b/games/game_darkestdungeon.py index 406c2e0..f0c3e59 100644 --- a/games/game_darkestdungeon.py +++ b/games/game_darkestdungeon.py @@ -10,22 +10,23 @@ from ..basic_game import BasicGame class DarkestDungeonGame(BasicGame): Name = "DarkestDungeon" Author = "erri120" - Version = "0.1.0" + Version = "0.1.1" GameName = "Darkest Dungeon" GameShortName = "darkestdungeon" GameNexusName = "darkestdungeon" GameNexusId = 804 GameSteamId = 262060 - GameBinary = "_windows//darkest.exe" + GameGogId = 1719198803 + GameBinary = "_windowsnosteam//darkest.exe" GameDataPath = "" def executables(self): + path = QFileInfo(self.gameDirectory(), "_windows/darkest.exe") + if not path.exists(): + path = QFileInfo(self.gameDirectory(), "_windowsnosteam/darkest.exe") return [ - mobase.ExecutableInfo( - "Darkest Dungeon", - QFileInfo(self.gameDirectory(), "_windows//darkest.exe"), - ), + mobase.ExecutableInfo("Darkest Dungeon", path), ] def savesDirectory(self): diff --git a/games/game_kingdomcomedeliverance.py b/games/game_kingdomcomedeliverance.py new file mode 100644 index 0000000..3d0a493 --- /dev/null +++ b/games/game_kingdomcomedeliverance.py @@ -0,0 +1,42 @@ +# -*- encoding: utf-8 -*- + +from ..basic_game import BasicGame + +import os +from PyQt5.QtCore import QDir + + +class KingdomComeDeliveranceGame(BasicGame): + Name = "Kingdom Come Deliverance Support Plugin" + Author = "Silencer711" + Version = "1.0.0" + + GameName = "Kingdom Come: Deliverance" + GameShortName = "kingdomcomedeliverance" + GameNexusName = "kingdomcomedeliverance" + GameNexusId = 2298 + GameSteamId = [379430] + GameGogId = [1719198803] + GameBinary = "bin/Win64/KingdomCome.exe" + GameDataPath = "mods" + GameSaveExtension = "whs" + GameDocumentsDirectory = "%GAME_PATH%" + GameSavesDirectory = "%USERPROFILE%/Saved Games/kingdomcome/saves" + + def iniFiles(self): + return ["custom.cfg", "system.cfg", "user.cfg"] + + def initializeProfile(self, path: QDir, settings: int): + # Create .cfg files if they don't exist + for iniFile in self.iniFiles(): + iniPath = self.documentsDirectory().absoluteFilePath(iniFile) + if not os.path.exists(iniPath): + with open(iniPath, "w") as _: + pass + + # Create the mods directory if it doesn't exist + modsPath = self.dataDirectory().absolutePath() + if not os.path.exists(modsPath): + os.mkdir(modsPath) + + super().initializeProfile(path, settings) diff --git a/games/game_nomanssky.py b/games/game_nomanssky.py new file mode 100644 index 0000000..cf6baba --- /dev/null +++ b/games/game_nomanssky.py @@ -0,0 +1,18 @@ +# -*- encoding: utf-8 -*- + +from ..basic_game import BasicGame + + +class NoMansSkyGame(BasicGame): + + Name = "Mo Man's Sky Support Plugin" + Author = "Luca/EzioTheDeadPoet" + Version = "1.0.0" + + GameName = "Mo Man's Sky" + GameShortName = "nomanssky" + GaneNexusHame = "nomanssky" + GameSteamId = 275850 + GameGogId = 1446213994 + GameBinary = "Binaries/NMS.exe" + GameDataPath = "GAMEDATA/PCBANKS/MODS"