From 7e606215e0cae24d9b9c4ca7f3d42a9d8e0096f0 Mon Sep 17 00:00:00 2001 From: Zash Date: Sun, 19 Oct 2025 13:37:00 +0200 Subject: [PATCH 1/7] Add GameThunderstoreName to BasicGame --- basic_game.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/basic_game.py b/basic_game.py index b3d8073..e0f7ba5 100644 --- a/basic_game.py +++ b/basic_game.py @@ -199,6 +199,7 @@ class BasicGameMappings: gameName: BasicGameMapping[str] gameShortName: BasicGameMapping[str] gameNexusName: BasicGameMapping[str] + gameThunderstoreName: BasicGameMapping[str] validShortNames: BasicGameMapping[list[str]] nexusGameId: BasicGameMapping[int] binaryName: BasicGameMapping[str] @@ -265,6 +266,12 @@ def __init__(self, game: BasicGame): "gameNexusName", default=lambda g: g.gameShortName(), ) + self.gameThunderstoreName = BasicGameMapping( + game, + "GameThunderstoreName", + "gameThunderstoreName", + default=lambda g: "", + ) self.validShortNames = BasicGameMapping( game, "GameValidShortNames", @@ -529,6 +536,9 @@ def validShortNames(self) -> list[str]: def gameNexusName(self) -> str: return self._mappings.gameNexusName.get() + def gameThunderstoreName(self) -> str: + return self._mappings.gameThunderstoreName.get() + def nexusModOrganizerID(self) -> int: return 0 From 6a308b976a4ea313c250b8c58f89f6bb4baecadb Mon Sep 17 00:00:00 2001 From: Zash Date: Sun, 19 Oct 2025 13:38:42 +0200 Subject: [PATCH 2/7] Add thunderstore community names: - Valheim: valheim - Subnautica: subnautica - Subnautica below zero: subnautica-below-zero --- games/game_subnautica-below-zero.py | 1 + games/game_subnautica.py | 1 + games/game_valheim.py | 1 + 3 files changed, 3 insertions(+) diff --git a/games/game_subnautica-below-zero.py b/games/game_subnautica-below-zero.py index d16cff1..3999b29 100644 --- a/games/game_subnautica-below-zero.py +++ b/games/game_subnautica-below-zero.py @@ -12,6 +12,7 @@ class SubnauticaBelowZeroGame(game_subnautica.SubnauticaGame): GameName = "Subnautica: Below Zero" GameShortName = "subnauticabelowzero" GameNexusName = "subnauticabelowzero" + GameThunderstoreName = "subnautica-below-zero" GameSteamId = 848450 GameEpicId = "foxglove" GameBinary = "SubnauticaZero.exe" diff --git a/games/game_subnautica.py b/games/game_subnautica.py index 0c33876..b74d363 100644 --- a/games/game_subnautica.py +++ b/games/game_subnautica.py @@ -92,6 +92,7 @@ class SubnauticaGame(BasicGame, mobase.IPluginFileMapper): GameName = "Subnautica" GameShortName = "subnautica" GameNexusName = "subnautica" + GameThunderstoreName = "subnautica" GameSteamId = 264710 GameEpicId = "Jaguar" GameBinary = "Subnautica.exe" diff --git a/games/game_valheim.py b/games/game_valheim.py index 18a1c94..31110da 100644 --- a/games/game_valheim.py +++ b/games/game_valheim.py @@ -294,6 +294,7 @@ class ValheimGame(BasicGame): GameName = "Valheim" GameShortName = "valheim" + GameThunderstoreName = "valheim" GameNexusId = 3667 GameSteamId = [892970, 896660, 1223920] GameBinary = "valheim.exe" From 0f008e63b9592e374fe257680e8b459f63012f82 Mon Sep 17 00:00:00 2001 From: Zash Date: Sun, 19 Oct 2025 13:39:14 +0200 Subject: [PATCH 3/7] Add ignore option to BasicModDataChecker --- basic_features/basic_mod_data_checker.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/basic_features/basic_mod_data_checker.py b/basic_features/basic_mod_data_checker.py index f6d5864..1d061eb 100644 --- a/basic_features/basic_mod_data_checker.py +++ b/basic_features/basic_mod_data_checker.py @@ -50,6 +50,7 @@ def __init__(self, globs: GlobPatterns) -> None: self.move = { key: re.compile(fnmatch.translate(key), re.I) for key in globs.move } + self.ignore = OptionalRegexPattern(globs.ignore) def move_match(self, value: str) -> str | None: """ @@ -79,6 +80,7 @@ class GlobPatterns: valid: list[str] | None = None delete: list[str] | None = None move: dict[str, str] = field(default_factory=dict[str, str]) + ignore: list[str] | None = None def merge( self, other: GlobPatterns, mode: Literal["merge", "replace"] = "replace" @@ -106,6 +108,7 @@ def merge( valid=_merge_list(self.valid, other.valid), delete=_merge_list(self.delete, other.delete), move=self.move | other.move, + ignore=_merge_list(self.ignore, other.ignore), ) else: return GlobPatterns( @@ -113,6 +116,7 @@ def merge( valid=other.valid or self.valid, delete=other.delete or self.delete, move=other.move or self.move, + ignore=other.ignore or self.ignore, ) @@ -125,6 +129,8 @@ class BasicModDataChecker(mobase.ModDataChecker): Args: file_patterns (optional): A GlobPatterns object, with the following attributes: + ignore: [ "list of files and folders to ignore." ] + # Check result: unchanged unfold: [ "list of folders to unfold" ], # (remove and move contents to parent), after being checked and # fixed recursively. @@ -175,6 +181,8 @@ def dataLooksValid( for entry in filetree: name = entry.name().casefold() + if rp.ignore.match(name): + continue if rp.unfold.match(name): if is_directory(entry): status = self.dataLooksValid(entry) @@ -196,6 +204,8 @@ def fix(self, filetree: mobase.IFileTree) -> mobase.IFileTree: for entry in list(filetree): name = entry.name() + if rp.ignore.match(name): + continue # unfold first - if this match, entry is a directory (checked in # dataLooksValid) if rp.unfold.match(name): From 9411e949ff0674a5400c2b91d8e9bfbf83ec1fcf Mon Sep 17 00:00:00 2001 From: Zash Date: Sun, 19 Oct 2025 13:41:26 +0200 Subject: [PATCH 4/7] Ignore *.mohidden in thunderstore games (BasicModDataChecker) to support thunderstore installer --- games/game_subnautica.py | 1 + games/game_valheim.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/games/game_subnautica.py b/games/game_subnautica.py index b74d363..a969b0a 100644 --- a/games/game_subnautica.py +++ b/games/game_subnautica.py @@ -37,6 +37,7 @@ def __init__(self, patterns: GlobPatterns | None = None, use_qmods: bool = False "changelog.txt", "libdoorstop.dylib", ], + ignore=["*.mohidden"], delete=[ "*.txt", "*.md", diff --git a/games/game_valheim.py b/games/game_valheim.py index 31110da..456eeab 100644 --- a/games/game_valheim.py +++ b/games/game_valheim.py @@ -334,6 +334,9 @@ def init(self, organizer: mobase.IOrganizer) -> bool: # "AdvancedBuilder", ], + ignore=[ + "*.mohidden", + ], delete=[ "*.txt", "*.md", From 96e2210b73efdc7211677796cbe81b0df5689f13 Mon Sep 17 00:00:00 2001 From: Zash Date: Sun, 19 Oct 2025 13:45:00 +0200 Subject: [PATCH 5/7] Valheim v1.3 --- games/game_valheim.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/games/game_valheim.py b/games/game_valheim.py index 456eeab..a43343b 100644 --- a/games/game_valheim.py +++ b/games/game_valheim.py @@ -290,7 +290,7 @@ def allFiles(self) -> list[str]: class ValheimGame(BasicGame): Name = "Valheim Support Plugin" Author = "Zash" - Version = "1.2.2" + Version = "1.3" GameName = "Valheim" GameShortName = "valheim" From ec82d0f71a76d7e3b8212011415c6a19bbe0a3f7 Mon Sep 17 00:00:00 2001 From: Zash Date: Sun, 19 Oct 2025 13:45:20 +0200 Subject: [PATCH 6/7] Subnautica v2.3 --- games/game_subnautica.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/games/game_subnautica.py b/games/game_subnautica.py index a969b0a..f9e5128 100644 --- a/games/game_subnautica.py +++ b/games/game_subnautica.py @@ -88,7 +88,7 @@ def fix(self, filetree: mobase.IFileTree) -> mobase.IFileTree: class SubnauticaGame(BasicGame, mobase.IPluginFileMapper): Name = "Subnautica Support Plugin" Author = "dekart811, Zash" - Version = "2.2" + Version = "2.3" GameName = "Subnautica" GameShortName = "subnautica" From 755506c41bd7ae303111df9e707fdee593b39ca6 Mon Sep 17 00:00:00 2001 From: Zash Date: Sun, 19 Oct 2025 13:49:30 +0200 Subject: [PATCH 7/7] Subnautica BZ: remove inherited fields --- games/game_subnautica-below-zero.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/games/game_subnautica-below-zero.py b/games/game_subnautica-below-zero.py index 3999b29..297049f 100644 --- a/games/game_subnautica-below-zero.py +++ b/games/game_subnautica-below-zero.py @@ -6,8 +6,6 @@ class SubnauticaBelowZeroGame(game_subnautica.SubnauticaGame): Name = "Subnautica Below Zero Support Plugin" - Author = "dekart811, Zash" - Version = "2.2" GameName = "Subnautica: Below Zero" GameShortName = "subnauticabelowzero" @@ -16,13 +14,10 @@ class SubnauticaBelowZeroGame(game_subnautica.SubnauticaGame): GameSteamId = 848450 GameEpicId = "foxglove" GameBinary = "SubnauticaZero.exe" - GameDataPath = "_ROOT" - GameDocumentsDirectory = "%GAME_PATH%" GameSupportURL = ( r"https://github.com/ModOrganizer2/modorganizer-basic_games/wiki/" "Game:-Subnautica:-Below-Zero" ) - GameSavesDirectory = r"%GAME_PATH%\SNAppData\SavedGames" _game_extra_save_paths = [ r"%USERPROFILE%\Appdata\LocalLow\Unknown Worlds"