forked from ModOrganizer2/modorganizer-basic_games
-
Notifications
You must be signed in to change notification settings - Fork 0
/
game_mountandblade2.py
93 lines (74 loc) · 2.73 KB
/
game_mountandblade2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# -*- encoding: utf-8 -*-
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"
Version = "0.1.0"
Description = "Adds support for Mount & Blade II: Bannerlord"
GameName = "Mount & Blade II: Bannerlord"
GameShortName = "mountandblade2bannerlord"
GameDataPath = "Modules"
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"
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(
"Mount & Blade II: Bannerlord (Launcher)",
QFileInfo(
self.gameDirectory(),
"bin/Win64_Shipping_Client/TaleWorlds.MountAndBlade.Launcher.exe",
),
),
mobase.ExecutableInfo(
"Mount & Blade II: Bannerlord",
QFileInfo(
self.gameDirectory(),
"bin/Win64_Shipping_Client/Bannerlord.exe",
),
),
mobase.ExecutableInfo(
"Mount & Blade II: Bannerlord (Native)",
QFileInfo(
self.gameDirectory(),
"bin/Win64_Shipping_Client/Bannerlord.Native.exe",
),
),
mobase.ExecutableInfo(
"Mount & Blade II: Bannerlord (BE)",
QFileInfo(
self.gameDirectory(),
"bin/Win64_Shipping_Client/Bannerlord_BE.exe",
),
),
]