forked from ModOrganizer2/modorganizer-basic_games
-
Notifications
You must be signed in to change notification settings - Fork 2
/
game_witcher3.py
51 lines (41 loc) · 1.56 KB
/
game_witcher3.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
from pathlib import Path
from typing import List
import mobase
from PyQt6.QtCore import QDir
from ..basic_features import BasicGameSaveGameInfo
from ..basic_features.basic_save_game_info import BasicGameSaveGame
from ..basic_game import BasicGame
class Witcher3SaveGame(BasicGameSaveGame):
def allFiles(self):
return [self._filepath.name, self._filepath.name.replace(".sav", ".png")]
class Witcher3Game(BasicGame):
Name = "Witcher 3 Support Plugin"
Author = "Holt59"
Version = "1.0.0a"
GameName = "The Witcher 3: Wild Hunt"
GameShortName = "witcher3"
GaneNexusHame = "witcher3"
GameNexusId = 952
GameSteamId = [499450, 292030]
GameGogId = [1640424747, 1495134320, 1207664663, 1207664643]
GameBinary = "bin/x64/witcher3.exe"
GameDataPath = "Mods"
GameSaveExtension = "sav"
GameDocumentsDirectory = "%DOCUMENTS%/The Witcher 3"
GameSavesDirectory = "%GAME_DOCUMENTS%/gamesaves"
GameSupportURL = (
r"https://github.com/ModOrganizer2/modorganizer-basic_games/wiki/"
"Game:-The-Witcher-3"
)
def init(self, organizer: mobase.IOrganizer):
super().init(organizer)
self._register_feature(BasicGameSaveGameInfo(lambda s: s.with_suffix(".png")))
return True
def iniFiles(self):
return ["user.settings", "input.settings"]
def listSaves(self, folder: QDir) -> List[mobase.ISaveGame]:
ext = self._mappings.savegameExtension.get()
return [
Witcher3SaveGame(path)
for path in Path(folder.absolutePath()).glob(f"*.{ext}")
]