diff --git a/README.md b/README.md index 6fbed59b..d9ac6045 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ You can rename `modorganizer-basic_games-xxx` to whatever you want (e.g., `basic | Mount & Blade II: Bannerlord — [GOG](https://www.gog.com/game/mount_blade_ii_bannerlord) / [STEAM](https://store.steampowered.com/app/261550/Mount__Blade_II_Bannerlord/) | [Holt59](https://github.com/holt59/) | [game_mountandblade2.py](games/game_mountandblade2.py) | | | Need for Speed: High Stakes | [uwx](https://github.com/uwx) | [game_nfshs.py](games/game_nfshs.py) | | | No Man's Sky - [GOG](https://www.gog.com/game/no_mans_sky) / [Steam](https://store.steampowered.com/app/275850/No_Mans_Sky/)|[EzioTheDeadPoet](https://eziothedeadpoet.github.io/AboutMe/)|[game_nomanssky.py](games/game_nomanssky.py)| | +| Norland — [STEAM](https://store.steampowered.com/app/1857090/Norland/) | [hkyss](https://github.com/hkyss) | [game_norland.py](games/game_norland.py) | | | Slay the Spire 2 — [STEAM](s.team/a/2868840) | [Azlle](https://github.com/Azlle) | [game_sts2.py](games/game_sts2.py) | | | S.T.A.L.K.E.R. Anomaly — [MOD](https://www.stalker-anomaly.com/) | [Qudix](https://github.com/Qudix) | [game_stalkeranomaly.py](games/game_stalkeranomaly.py) | | | Stardew Valley — [GOG](https://www.gog.com/game/stardew_valley) / [STEAM](https://store.steampowered.com/app/413150/Stardew_Valley/) | [Syer10](https://github.com/Syer10), [Holt59](https://github.com/holt59/) | [game_stardewvalley.py](games/game_stardewvalley.py) | | diff --git a/games/game_norland.py b/games/game_norland.py new file mode 100644 index 00000000..f637a651 --- /dev/null +++ b/games/game_norland.py @@ -0,0 +1,50 @@ +from PyQt6.QtCore import QDir + +import mobase + +from ..basic_game import BasicGame + + +class NorlandModDataChecker(mobase.ModDataChecker): + def dataLooksValid( + self, filetree: mobase.IFileTree + ) -> mobase.ModDataChecker.CheckReturn: + entries = list(filetree) + if entries and all(self._belongs(entry) for entry in entries): + return mobase.ModDataChecker.VALID + return mobase.ModDataChecker.INVALID + + @staticmethod + def _belongs(entry: mobase.FileTreeEntry) -> bool: + name = entry.name().casefold() + if isinstance(entry, mobase.IFileTree): + return name == "nlse" or entry.exists("mod.json", mobase.IFileTree.FILE) + return name == "nlse.dll" + + +class NorlandGame(BasicGame): + Name = "Norland Support Plugin" + Author = "hkyss" + Version = "0.3.1" + + GameName = "Norland" + GameShortName = "norland" + GameNexusName = "norland" + GameNexusId = 10369 + GameSteamId = 1857090 + GameBinary = "Norland.exe" + GameDataPath = "mods" + GameDocumentsDirectory = "%USERPROFILE%/AppData/Local/Strategy" + GameSavesDirectory = "%GAME_DOCUMENTS%/saves" + GameSaveExtension = "norland" + + def init(self, organizer: mobase.IOrganizer) -> bool: + super().init(organizer) + self._register_feature(NorlandModDataChecker()) + return True + + def executableForcedLoads(self) -> list[mobase.ExecutableForcedLoadSetting]: + path = self.dataDirectory().absoluteFilePath("nlse.dll") + loader = QDir.toNativeSeparators(path) + setting = mobase.ExecutableForcedLoadSetting(self.binaryName(), loader) + return [setting.withEnabled(True)]