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
This commit is contained in:
Zash
2023-10-08 09:12:14 +02:00
committed by GitHub
parent 27d17eec70
commit 583bb78977
6 changed files with 36 additions and 62 deletions
+21
View File
@@ -0,0 +1,21 @@
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()