From e4d594ce8ee749166cda9a4f0621d409377cef98 Mon Sep 17 00:00:00 2001 From: Qudix <17361645+Qudix@users.noreply.github.com> Date: Sat, 7 Nov 2020 01:56:29 -0600 Subject: [PATCH] Improved data checker for STALKER Anomaly --- games/game_stalkeranomaly.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/games/game_stalkeranomaly.py b/games/game_stalkeranomaly.py index 28717e2..24fa0e5 100644 --- a/games/game_stalkeranomaly.py +++ b/games/game_stalkeranomaly.py @@ -10,22 +10,30 @@ class StalkerAnomalyModDataChecker(mobase.ModDataChecker): + _valid_folders: List[str] = [ + "db", + "appdata", + "gamedata", + ] + def __init__(self): super().__init__() def dataLooksValid( self, tree: mobase.IFileTree ) -> mobase.ModDataChecker.CheckReturn: - if tree.exists("db") or tree.exists("appdata") or tree.exists("gamedata"): - return mobase.ModDataChecker.VALID - else: - return mobase.ModDataChecker.INVALID + for e in tree: + if e.isDir(): + if e.name().lower() in self._valid_folders: + return mobase.ModDataChecker.VALID + + return mobase.ModDataChecker.INVALID class StalkerAnomalyGame(BasicGame, mobase.IPluginFileMapper): Name = "STALKER Anomaly" Author = "Qudix" - Version = "0.3.0" + Version = "0.3.1" Description = "Adds support for STALKER Anomaly" GameName = "STALKER Anomaly"