Add MDC for Mount & Blade II.

This commit is contained in:
Mikaël Capelle
2020-07-29 19:01:49 +02:00
parent 66ec8c1f4f
commit f71b568e97
2 changed files with 37 additions and 2 deletions
+2 -1
View File
@@ -50,7 +50,8 @@ git clone https://github.com/Holt59/modorganizer-basic_games basic_games
| [Dark Messiah of Might & Magic](https://store.steampowered.com/app/2100/Dark_Messiah_of_Might__Magic/) | Holt59 | [game_darkmessiah[...].py](games/game_darkmessiahofmightandmagic.py) | <ul><li>steam detection</li><li>save game preview</li></ul> |
| [Darkest Dungeon](https://store.steampowered.com/app/262060/Darkest_Dungeon/) | [erri120](https://github.com/erri120) | [game_darkestdungeon.py](games/game_darkestdungeon.py) | <ul><li>steam detection</li></ul> |
| [Dungeon Siege II](https://store.steampowered.com/app/39200/Dungeon_Siege_II/) | Holt59 | [game_dungeonsiege2.py](games/game_dungeonsiege2.py) | <ul><li>steam detection</li><li>mod data checker</li></ul> |
| S.T.A.L.K.E.R. Anomaly| [Qudix](https://github.com/Qudix) | [game_stalkeranomaly.py](games/game_stalkeranomaly.py) | |
| [Mount & Blade II: Bannerlord](https://store.steampowered.com/app/261550/Mount__Blade_II_Bannerlord/) | Holt59 | | <ul><li>steam detection</li><li>mod data checker</li></ul> |
| [S.T.A.L.K.E.R. Anomaly](https://www.stalker-anomaly.com/) | [Qudix](https://github.com/Qudix) | [game_stalkeranomaly.py](games/game_stalkeranomaly.py) | |
| [Stardew Valley](https://store.steampowered.com/app/413150/Stardew_Valley/) | [Syer10](https://github.com/Syer10), Holt59 | [game_stardewvalley.py](games/game_stardewvalley.py) | <ul><li>steam detection</li><li>mod data checker</li></ul> |
| [The Witcher 3: Wild Hunt](https://store.steampowered.com/app/292030/The_Witcher_3_Wild_Hunt/) | Holt59 | [game_witcher3.py](games/game_witcher3.py) | <ul><li>steam detection</li><li>save game preview</li></ul> |
+35 -1
View File
@@ -2,11 +2,40 @@
from PyQt5.QtCore import QFileInfo
from typing import List
import mobase
from ..basic_game import BasicGame
class MountAndBladeIIModDataChecker(mobase.ModDataChecker):
_valid_folders: List[str] = [
"native",
"sandbox",
"sandboxcore",
"storymode",
"custombattle",
]
def __init__(self):
super().__init__()
def dataLooksValid(
self, tree: mobase.IFileTree
) -> mobase.ModDataChecker.CheckReturn:
for e in tree:
if e.isDir():
if e.name().lower() in self._valid_folders:
return mobase.ModDataChecker.VALID
if e.exists("SubModule.xml", mobase.IFileTree.FILE): # type: ignore
return mobase.ModDataChecker.VALID
return mobase.ModDataChecker.INVALID
class MountAndBladeIIGame(BasicGame):
Name = "Mount & Blade II: Bannerlord"
Author = "Holt59"
@@ -26,6 +55,11 @@ class MountAndBladeIIGame(BasicGame):
GameNexusId = 3174
GameSteamId = 261550
def init(self, organizer: mobase.IOrganizer):
super().init(organizer)
self._featureMap[mobase.ModDataChecker] = MountAndBladeIIModDataChecker()
return True
def executables(self):
return [
mobase.ExecutableInfo(
@@ -54,4 +88,4 @@ class MountAndBladeIIGame(BasicGame):
self.gameDirectory(), "bin/Win64_Shipping_Client/Bannerlord_BE.exe",
),
),
]
]