mirror of
https://github.com/ModOrganizer2/modorganizer-basic_games.git
synced 2026-07-27 14:07:29 -07:00
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:
@@ -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()
|
||||
Reference in New Issue
Block a user