Skip to content

Commit 0776dd2

Browse files
committed
Update save game detection for Mount & Blade II: Bannerlord
1 parent deabf2a commit 0776dd2

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

games/game_mountandblade2.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
from PyQt6.QtCore import QFileInfo
1+
from pathlib import Path
2+
3+
from PyQt6.QtCore import QFileInfo, QDir
24

35
import mobase
46

5-
from ..basic_game import BasicGame
7+
from ..basic_game import BasicGame, BasicGameSaveGame
68

79

810
class MountAndBladeIIModDataChecker(mobase.ModDataChecker):
@@ -33,7 +35,7 @@ def dataLooksValid(
3335
class MountAndBladeIIGame(BasicGame):
3436
Name = "Mount & Blade II: Bannerlord"
3537
Author = "Holt59"
36-
Version = "0.1.0"
38+
Version = "0.1.1"
3739
Description = "Adds support for Mount & Blade II: Bannerlord"
3840

3941
GameName = "Mount & Blade II: Bannerlord"
@@ -47,8 +49,7 @@ class MountAndBladeIIGame(BasicGame):
4749
GameBinary = "bin/Win64_Shipping_Client/TaleWorlds.MountAndBlade.Launcher.exe"
4850

4951
GameDocumentsDirectory = "%DOCUMENTS%/Mount and Blade II Bannerlord/Configs"
50-
GameSaveExtension = "sav"
51-
GameSavesDirectory = "%DOCUMENTS%/Mount and Blade II Bannerlord/Game Saves/Native"
52+
GameSavesDirectory = "%DOCUMENTS%/Mount and Blade II Bannerlord/Game Saves"
5253

5354
GameNexusId = 3174
5455
GameSteamId = 261550
@@ -58,6 +59,12 @@ def init(self, organizer: mobase.IOrganizer):
5859
self._register_feature(MountAndBladeIIModDataChecker())
5960
return True
6061

62+
def listSaves(self, folder: QDir) -> list[mobase.ISaveGame]:
63+
save_paths = list(Path(folder.absolutePath()).glob("*.sav")) + list(
64+
Path(folder.absolutePath()).glob("*.sav.cleaner_backup_*")
65+
)
66+
return [BasicGameSaveGame(path) for path in save_paths]
67+
6168
def executables(self):
6269
return [
6370
mobase.ExecutableInfo(

0 commit comments

Comments
 (0)