Skip to content

Commit

Permalink
Merge pull request #27 from Holt59/v2.3.x
Browse files Browse the repository at this point in the history
Update on 2.3.x from master.
  • Loading branch information
Holt59 committed Jan 3, 2021
2 parents eb98170 + 19c7c85 commit 4e2383c
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 7 deletions.
11 changes: 10 additions & 1 deletion basic_game.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -349,7 +354,11 @@ def version(self) -> mobase.VersionInfo:
return self._mappings.version.get()

def isActive(self) -> bool:
return True
if not self._organizer.managedGame():
return False

# Note: self is self._organizer.managedGame() does not work:
return self.name() == self._organizer.managedGame().name()

def settings(self) -> List[mobase.PluginSetting]:
return []
Expand Down
13 changes: 7 additions & 6 deletions games/game_darkestdungeon.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,23 @@
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):
Expand Down
42 changes: 42 additions & 0 deletions games/game_kingdomcomedeliverance.py
Original file line number Diff line number Diff line change
@@ -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)
18 changes: 18 additions & 0 deletions games/game_nomanssky.py
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 4e2383c

Please sign in to comment.