Skip to content

Commit 3b70bc8

Browse files
committed
Extra variable for optional MWS category support
Fixed Content Flags being set incorrectly
1 parent 23f7fac commit 3b70bc8

16 files changed

Lines changed: 109 additions & 88 deletions

games/game_cassettebeasts.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ def getMetadata(p: Path, save: mobase.ISaveGame) -> Mapping[str, str] | None:
180180
class CassetteBeastsGame(BasicGame):
181181
Name = "Cassette Beasts Support Plugin"
182182
Author = "ModWorkshop"
183+
CategorySource = "modworkshop"
183184
Version = "1"
184185
GameName = "Cassette Beasts"
185186
GameShortName = "cassette-beasts"

games/game_crimeboss.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,23 @@ def walkContent(self, path: str, entry: mobase.FileTreeEntry):
4646
if entry.isFile():
4747
match entry.suffix().casefold():
4848
case "utoc":
49-
self.content.append(Content.UTOC)
49+
self.contents.append(Content.UTOC)
5050
case "ucas":
51-
self.content.append(Content.UCAS)
51+
self.contents.append(Content.UCAS)
5252
case "pak":
53-
self.content.append(Content.PAK)
53+
self.contents.append(Content.PAK)
5454
case "lua":
55-
self.content.append(Content.UE4SS)
55+
self.contents.append(Content.UE4SS)
5656
case "dll":
57-
self.content.append(Content.DLL)
57+
self.contents.append(Content.DLL)
5858
case "bk2":
59-
self.contents.add(Content.BK2)
59+
self.contents.append(Content.BK2)
6060
case _:
6161
pass
6262
return mobase.IFileTree.WalkReturn.CONTINUE
6363

6464
def getContentsFor(self, filetree: mobase.IFileTree) -> list[int]:
65-
self.contents: set[int] = set()
65+
self.contents: list[int] = []
6666
filetree.walk(self.walkContent, "/")
6767
return list(self.contents)
6868

@@ -242,6 +242,7 @@ def fix(self, filetree: mobase.IFileTree) -> mobase.IFileTree | None:
242242
class CrimeBossGame(BasicGame):
243243
Name = "Crime Boss Support Plugin"
244244
Author = "ModWorkshop, MaskPlague and Silarn"
245+
CategorySource = "modworkshop"
245246
Version = "1"
246247
GameName = "Crime Boss Rockay City"
247248
GameShortName = "crimeboss"

games/game_emuvr.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def fix(self, filetree: mobase.IFileTree) -> mobase.IFileTree | None:
5555
class EmuVRGame(BasicGame):
5656
Name = "Emu VR Support Plugin"
5757
Author = "ModWorkshop"
58+
CategorySource = "modworkshop"
5859
Version = "1"
5960
GameName = "Emu VR"
6061
GameShortName = "emuvr"

games/game_noita.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ def fix(self, filetree: mobase.IFileTree) -> mobase.IFileTree | None:
8888
class NoitaGame(BasicGame):
8989
Name = "Noita Support Plugin"
9090
Author = "ModWorkshop"
91+
CategorySource = "modworkshop"
9192
Version = "1"
9293
GameName = "Noita"
9394
GameShortName = "noita"

games/game_ovkwalkingdead.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,23 @@ def walkContent(self, path: str, entry: mobase.FileTreeEntry):
4646
if entry.isFile():
4747
match entry.suffix().casefold():
4848
case "utoc":
49-
self.content.append(Content.UTOC)
49+
self.contents.append(Content.UTOC)
5050
case "ucas":
51-
self.content.append(Content.UCAS)
51+
self.contents.append(Content.UCAS)
5252
case "pak":
53-
self.content.append(Content.PAK)
53+
self.contents.append(Content.PAK)
5454
case "lua":
55-
self.content.append(Content.UE4SS)
55+
self.contents.append(Content.UE4SS)
5656
case "dll":
57-
self.content.append(Content.DLL)
57+
self.contents.append(Content.DLL)
5858
case "bk2":
59-
self.content.append(Content.BK2)
59+
self.contents.append(Content.BK2)
6060
case _:
6161
pass
6262
return mobase.IFileTree.WalkReturn.CONTINUE
6363

6464
def getContentsFor(self, filetree: mobase.IFileTree) -> list[int]:
65-
self.contents: set[int] = set()
65+
self.contents: list[int] = []
6666
filetree.walk(self.walkContent, "/")
6767
return list(self.contents)
6868

@@ -208,6 +208,7 @@ def fix(self, filetree: mobase.IFileTree) -> mobase.IFileTree | None:
208208
class OTWDGame(BasicGame):
209209
Name = "OVERKILL's The Walking Dead Support Plugin"
210210
Author = "ModWorkshop, MaskPlague and Silarn"
211+
CategorySource = "modworkshop"
211212
Version = "1"
212213
GameName = "OVERKILL's The Walking Dead"
213214
GameShortName = "otwd"

games/game_pacificdrive.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,23 +46,23 @@ def walkContent(self, path: str, entry: mobase.FileTreeEntry):
4646
if entry.isFile():
4747
match entry.suffix().casefold():
4848
case "utoc":
49-
self.content.append(Content.UTOC)
49+
self.contents.append(Content.UTOC)
5050
case "ucas":
51-
self.content.append(Content.UCAS)
51+
self.contents.append(Content.UCAS)
5252
case "pak":
53-
self.content.append(Content.PAK)
53+
self.contents.append(Content.PAK)
5454
case "lua":
55-
self.content.append(Content.UE4SS)
55+
self.contents.append(Content.UE4SS)
5656
case "dll":
57-
self.content.append(Content.DLL)
57+
self.contents.append(Content.DLL)
5858
case "bk2":
59-
self.content.append(Content.BK2)
59+
self.contents.append(Content.BK2)
6060
case _:
6161
pass
6262
return mobase.IFileTree.WalkReturn.CONTINUE
6363

6464
def getContentsFor(self, filetree: mobase.IFileTree) -> list[int]:
65-
self.contents: set[int] = set()
65+
self.contents: list[int] = []
6666
filetree.walk(self.walkContent, "/")
6767
return list(self.contents)
6868

games/game_payday1.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,25 @@ def walkContent(self, path: str, entry: mobase.FileTreeEntry):
5050
if entry.isFile():
5151
match entry.suffix().casefold():
5252
case "texture":
53-
self.content.append(Content.TEXTURE)
53+
self.contents.append(Content.TEXTURE)
5454
case "model":
55-
self.content.append(Content.MESH)
55+
self.contents.append(Content.MESH)
5656
case "lua":
57-
self.content.append(Content.SCRIPT)
57+
self.contents.append(Content.SCRIPT)
5858
case "stream":
59-
self.content.append(Content.SOUND)
59+
self.contents.append(Content.SOUND)
6060
case "txt":
61-
self.content.append(Content.STRING)
61+
self.contents.append(Content.STRING)
6262
case "json":
63-
self.content.append(Content.CONFIG)
63+
self.contents.append(Content.CONFIG)
6464
case _:
6565
pass
6666
return mobase.IFileTree.WalkReturn.CONTINUE
6767

6868
def getContentsFor(self, filetree: mobase.IFileTree) -> list[int]:
69+
self.contents: list[int] = []
6970
filetree.walk(self.walkContent, "/")
70-
return list(self.content)
71+
return list(self.contents)
7172

7273

7374
class ModDetectionCandidate(TypedDict):
@@ -179,6 +180,10 @@ def dataLooksValid(
179180
return mobase.ModDataChecker.VALID
180181
if filetree.exists("WSOCK32.dll", mobase.IFileTree.FILE):
181182
return mobase.ModDataChecker.VALID
183+
if filetree.exists("DINPUT8.dll", mobase.IFileTree.FILE):
184+
return mobase.ModDataChecker.VALID
185+
if filetree.exists("PDTHModOverrides.dll", mobase.IFileTree.FILE):
186+
return mobase.ModDataChecker.VALID
182187
return mobase.ModDataChecker.FIXABLE
183188

184189
def moveTreeContent(
@@ -356,6 +361,7 @@ def fix(self, filetree: mobase.IFileTree) -> mobase.IFileTree | None:
356361
class Payday1Game(BasicGame):
357362
Name = "Payday 1 Support Plugin"
358363
Author = "ModWorkshop"
364+
CategorySource = "modworkshop"
359365
Version = "1"
360366
GameName = "Payday: The Heist"
361367
GameShortName = "pdth"

games/game_payday2.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,25 @@ def walkContent(self, path: str, entry: mobase.FileTreeEntry):
5050
if entry.isFile():
5151
match entry.suffix().casefold():
5252
case "texture":
53-
self.content.append(Content.TEXTURE)
53+
self.contents.append(Content.TEXTURE)
5454
case "model":
55-
self.content.append(Content.MESH)
55+
self.contents.append(Content.MESH)
5656
case "lua":
57-
self.content.append(Content.SCRIPT)
57+
self.contents.append(Content.SCRIPT)
5858
case "stream":
59-
self.content.append(Content.SOUND)
59+
self.contents.append(Content.SOUND)
6060
case "txt":
61-
self.content.append(Content.STRING)
61+
self.contents.append(Content.STRING)
6262
case "json":
63-
self.content.append(Content.CONFIG)
63+
self.contents.append(Content.CONFIG)
6464
case _:
6565
pass
6666
return mobase.IFileTree.WalkReturn.CONTINUE
6767

6868
def getContentsFor(self, filetree: mobase.IFileTree) -> list[int]:
69+
self.contents: list[int] = []
6970
filetree.walk(self.walkContent, "/")
70-
return list(self.content)
71+
return list(self.contents)
7172

7273

7374
class ModDetectionCandidate(TypedDict):
@@ -355,6 +356,7 @@ def fix(self, filetree: mobase.IFileTree) -> mobase.IFileTree | None:
355356
class Payday2Game(BasicGame):
356357
Name = "Payday 2 Support Plugin"
357358
Author = "ModWorkshop"
359+
CategorySource = "modworkshop"
358360
Version = "1"
359361
GameName = "Payday 2"
360362
GameShortName = "payday-2"

games/game_payday3.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,23 @@ def walkContent(self, path: str, entry: mobase.FileTreeEntry):
4747
if entry.isFile():
4848
match entry.suffix().casefold():
4949
case "utoc":
50-
self.content.append(Content.UTOC)
50+
self.contents.append(Content.UTOC)
5151
case "ucas":
52-
self.content.append(Content.UCAS)
52+
self.contents.append(Content.UCAS)
5353
case "pak":
54-
self.content.append(Content.PAK)
54+
self.contents.append(Content.PAK)
5555
case "lua":
56-
self.content.append(Content.UE4SS)
56+
self.contents.append(Content.UE4SS)
5757
case "dll":
58-
self.content.append(Content.DLL)
58+
self.contents.append(Content.DLL)
5959
case "bk2":
60-
self.content.append(Content.BK2)
60+
self.contents.append(Content.BK2)
6161
case _:
6262
pass
6363
return mobase.IFileTree.WalkReturn.CONTINUE
6464

6565
def getContentsFor(self, filetree: mobase.IFileTree) -> list[int]:
66-
self.contents: set[int] = set()
66+
self.contents: list[int] = []
6767
filetree.walk(self.walkContent, "/")
6868
return list(self.contents)
6969

@@ -209,6 +209,7 @@ def fix(self, filetree: mobase.IFileTree) -> mobase.IFileTree | None:
209209
class Payday3Game(BasicGame):
210210
Name = "Payday 3 Support Plugin"
211211
Author = "ModWorkshop, MaskPlague and Silarn"
212+
CategorySource = "modworkshop"
212213
Version = "1"
213214
GameName = "Payday 3"
214215
GameLauncher = "PAYDAY3.exe"

games/game_raid2.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,25 @@ def walkContent(self, path: str, entry: mobase.FileTreeEntry):
5050
if entry.isFile():
5151
match entry.suffix().casefold():
5252
case "texture":
53-
self.content.append(Content.TEXTURE)
53+
self.contents.append(Content.TEXTURE)
5454
case "model":
55-
self.content.append(Content.MESH)
55+
self.contents.append(Content.MESH)
5656
case "lua":
57-
self.content.append(Content.SCRIPT)
57+
self.contents.append(Content.SCRIPT)
5858
case "stream":
59-
self.content.append(Content.SOUND)
59+
self.contents.append(Content.SOUND)
6060
case "txt":
61-
self.content.append(Content.STRING)
61+
self.contents.append(Content.STRING)
6262
case "json":
63-
self.content.append(Content.CONFIG)
63+
self.contents.append(Content.CONFIG)
6464
case _:
6565
pass
6666
return mobase.IFileTree.WalkReturn.CONTINUE
6767

6868
def getContentsFor(self, filetree: mobase.IFileTree) -> list[int]:
69+
self.contents: list[int] = []
6970
filetree.walk(self.walkContent, "/")
70-
return list(self.content)
71+
return list(self.contents)
7172

7273

7374
class ModDetectionCandidate(TypedDict):
@@ -316,6 +317,7 @@ def fix(self, filetree: mobase.IFileTree) -> mobase.IFileTree | None:
316317
class RaidWW2Game(BasicGame):
317318
Name = "RAID World War II Support Plugin"
318319
Author = "ModWorkshop"
320+
CategorySource = "modworkshop"
319321
Version = "1"
320322
GameName = "RAID World War II"
321323
GameShortName = "raidww2"

0 commit comments

Comments
 (0)