From 43f0bce0596ec60434e48d8037ffed373bc13852 Mon Sep 17 00:00:00 2001 From: cat_or_not <41955154+catornot@users.noreply.github.com> Date: Thu, 14 Dec 2023 07:07:02 -0500 Subject: Add plugin dependency constants (#458) Adds dependency constants for plugins so mods can rely on plugins without always producing script errors when the plugin is missing --- NorthstarDLL/mods/modmanager.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'NorthstarDLL/mods/modmanager.h') diff --git a/NorthstarDLL/mods/modmanager.h b/NorthstarDLL/mods/modmanager.h index 813edec7..c141414f 100644 --- a/NorthstarDLL/mods/modmanager.h +++ b/NorthstarDLL/mods/modmanager.h @@ -7,6 +7,7 @@ #include #include #include +#include const std::string MOD_FOLDER_SUFFIX = "\\mods"; const std::string THUNDERSTORE_MOD_FOLDER_SUFFIX = "\\packages"; @@ -124,6 +125,7 @@ class Mod // hashed with STR_HASH std::unordered_map DependencyConstants; + std::vector PluginDependencyConstants; public: Mod(fs::path modPath, char* jsonBuf); @@ -134,6 +136,7 @@ class Mod void ParseScripts(rapidjson_document& json); void ParseLocalization(rapidjson_document& json); void ParseDependencies(rapidjson_document& json); + void ParsePluginDependencies(rapidjson_document& json); void ParseInitScript(rapidjson_document& json); }; @@ -160,6 +163,7 @@ class ModManager std::vector m_LoadedMods; std::unordered_map m_ModFiles; std::unordered_map m_DependencyConstants; + std::unordered_set m_PluginDependencyConstants; public: ModManager(); -- cgit v1.2.3