Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) | <ul><li>mod data checker</li></ul> |
| 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) | <ul><li>mod data checker</li></ul> |
| Slay the Spire 2 — [STEAM](s.team/a/2868840) | [Azlle](https://github.com/Azlle) | [game_sts2.py](games/game_sts2.py) | <ul><li>mod data checker</li></ul> |
| 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) | <ul><li>mod data checker</li></ul> |
| 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) | <ul><li>mod data checker</li></ul> |
Expand Down
50 changes: 50 additions & 0 deletions games/game_norland.py
Original file line number Diff line number Diff line change
@@ -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)]
Loading