|
| 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) |
0 commit comments