forked from ModOrganizer2/modorganizer-basic_games
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgame_stardewvalley.py
56 lines (43 loc) · 1.52 KB
/
game_stardewvalley.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# -*- encoding: utf-8 -*-
from PyQt5.QtCore import QFileInfo
import mobase
from ..basic_game import BasicGame
class StardewValleyModDataChecker(mobase.ModDataChecker):
def __init__(self):
super().__init__()
def dataLooksValid(
self, tree: mobase.IFileTree
) -> mobase.ModDataChecker.CheckReturn:
for e in tree:
if e.isDir() and e.exists( # type: ignore
"manifest.json", mobase.IFileTree.FILE
):
return mobase.ModDataChecker.VALID
return mobase.ModDataChecker.INVALID
class StardewValleyGame(BasicGame):
Name = "Stardew Valley Support Plugin"
Author = "Syer10"
Version = "0.1.0a"
GameName = "Stardew Valley"
GameShortName = "stardewvalley"
GameNexusName = "stardewvalley"
GameNexusId = 1303
GameSteamId = 413150
GameGogId = 1453375253
GameBinary = "Stardew Valley.exe"
GameDataPath = "mods"
GameDocumentsDirectory = "%DOCUMENTS%/StardewValley"
GameSavesDirectory = "%GAME_DOCUMENTS%/Saves"
def init(self, organizer: mobase.IOrganizer):
super().init(organizer)
self._featureMap[mobase.ModDataChecker] = StardewValleyModDataChecker()
return True
def executables(self):
return [
mobase.ExecutableInfo(
"SMAPI", QFileInfo(self.gameDirectory(), "StardewModdingAPI.exe")
),
mobase.ExecutableInfo(
"Stardew Valley", QFileInfo(self.gameDirectory(), "Stardew Valley.exe")
),
]