Skip to content

Commit

Permalink
Add MDC for Mount & Blade II.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Jul 29, 2020
1 parent 66ec8c1 commit f71b568
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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> |

Expand Down
36 changes: 35 additions & 1 deletion games/game_mountandblade2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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(
Expand Down Expand Up @@ -54,4 +88,4 @@ def executables(self):
self.gameDirectory(), "bin/Win64_Shipping_Client/Bannerlord_BE.exe",
),
),
]
]

0 comments on commit f71b568

Please sign in to comment.