Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions games/game_mountandblade2.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
from PyQt6.QtCore import QFileInfo
from pathlib import Path

from PyQt6.QtCore import QDir, QFileInfo

import mobase

from ..basic_game import BasicGame
from ..basic_features import BasicLocalSavegames
from ..basic_game import BasicGame, BasicGameSaveGame


class MountAndBladeIIModDataChecker(mobase.ModDataChecker):
Expand Down Expand Up @@ -33,7 +36,7 @@ def dataLooksValid(
class MountAndBladeIIGame(BasicGame):
Name = "Mount & Blade II: Bannerlord"
Author = "Holt59"
Version = "0.1.0"
Version = "0.1.1"
Description = "Adds support for Mount & Blade II: Bannerlord"

GameName = "Mount & Blade II: Bannerlord"
Expand All @@ -47,17 +50,23 @@ class MountAndBladeIIGame(BasicGame):
GameBinary = "bin/Win64_Shipping_Client/TaleWorlds.MountAndBlade.Launcher.exe"

GameDocumentsDirectory = "%DOCUMENTS%/Mount and Blade II Bannerlord/Configs"
GameSaveExtension = "sav"
GameSavesDirectory = "%DOCUMENTS%/Mount and Blade II Bannerlord/Game Saves/Native"
GameSavesDirectory = "%DOCUMENTS%/Mount and Blade II Bannerlord/Game Saves"

GameNexusId = 3174
GameSteamId = 261550

def init(self, organizer: mobase.IOrganizer):
super().init(organizer)
self._register_feature(MountAndBladeIIModDataChecker())
self._register_feature(BasicLocalSavegames(self.savesDirectory()))
return True

def listSaves(self, folder: QDir) -> list[mobase.ISaveGame]:
save_paths = list(Path(folder.absolutePath()).glob("*.sav")) + list(
Path(folder.absolutePath()).glob("*.sav.cleaner_backup_*")
)
return [BasicGameSaveGame(path) for path in save_paths]

def executables(self):
return [
mobase.ExecutableInfo(
Expand Down