Files

53 lines
1.6 KiB
Python
Raw Permalink Normal View History

from pathlib import Path
from typing import List
from PyQt6.QtCore import QDir
2021-07-18 10:33:08 +02:00
2025-04-25 08:23:10 +02:00
import mobase
2020-06-12 21:36:38 +02:00
from ..basic_features import BasicGameSaveGameInfo
2021-07-18 10:33:08 +02:00
from ..basic_features.basic_save_game_info import BasicGameSaveGame
from ..basic_game import BasicGame
2020-06-10 23:22:53 +02:00
2020-10-17 12:53:31 +02:00
class Witcher3SaveGame(BasicGameSaveGame):
def allFiles(self):
return [self._filepath.name, self._filepath.name.replace(".sav", ".png")]
2020-10-17 12:53:31 +02:00
2020-06-10 23:22:53 +02:00
class Witcher3Game(BasicGame):
2020-06-13 20:07:21 +02:00
Name = "Witcher 3 Support Plugin"
Author = "Holt59"
Version = "1.0.0a"
2020-06-10 23:22:53 +02:00
2020-06-13 21:01:18 +02:00
GameName = "The Witcher 3: Wild Hunt"
2020-06-13 20:07:21 +02:00
GameShortName = "witcher3"
GaneNexusHame = "witcher3"
GameNexusId = 952
GameSteamId = [499450, 292030]
GameGogId = [1640424747, 1495134320, 1207664663, 1207664643]
2020-06-13 20:07:21 +02:00
GameBinary = "bin/x64/witcher3.exe"
GameDataPath = "Mods"
GameSaveExtension = "sav"
GameDocumentsDirectory = "%DOCUMENTS%/The Witcher 3"
GameSavesDirectory = "%GAME_DOCUMENTS%/gamesaves"
2021-12-27 00:57:18 -07:00
GameSupportURL = (
r"https://github.com/ModOrganizer2/modorganizer-basic_games/wiki/"
"Game:-The-Witcher-3"
)
2020-06-10 23:22:53 +02:00
2020-06-12 00:06:01 +02:00
def init(self, organizer: mobase.IOrganizer):
super().init(organizer)
self._register_feature(BasicGameSaveGameInfo(lambda s: s.with_suffix(".png")))
2020-06-12 00:06:01 +02:00
return True
2020-09-27 15:42:23 +02:00
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}")
]