Files
modorganizer-basic_games/basic_features/basic_local_savegames.py
T
Zash 583bb78977 Add BasicLocalSavegames (basic_feature) (#122)
* Add `basic_feature.BasicLocalSavegames`
(profile specific save games)

* Refactor Black & White 2 with BasicLocalSavegames

* Refactor Valheim with BasicLocalSavegames

* Refactor Vampire Bloodlines with BasicLocalSavegames

* Add info about basic local save games to readme
2023-10-08 09:12:14 +02:00

22 lines
631 B
Python

import mobase
from PyQt6.QtCore import QDir
class BasicLocalSavegames(mobase.LocalSavegames):
def __init__(self, game_save_dir: QDir):
super().__init__()
self._game_saves_dir = game_save_dir.absolutePath()
def mappings(self, profile_save_dir: QDir):
return [
mobase.Mapping(
source=profile_save_dir.absolutePath(),
destination=self._game_saves_dir,
is_directory=True,
create_target=True,
)
]
def prepareProfile(self, profile: mobase.IProfile) -> bool:
return profile.localSavesEnabled()