diff --git a/BuildLibrary.hpp b/BuildLibrary.hpp index 2272b68..661b8b5 100644 --- a/BuildLibrary.hpp +++ b/BuildLibrary.hpp @@ -14,7 +14,9 @@ class BuildLibrary { static PkmnLib::Library::TimeOfDay GetTime() { return PkmnLib::Library::TimeOfDay::Morning; } public: - static PkmnLib::Battling::BattleLibrary* Build(const std::string& pathString) { + static PkmnLib::Battling::BattleLibrary* + Build(const std::string& pathString, + std::function onScriptInitialize = {}) { auto path = std::filesystem::path(pathString); auto* typesLibrary = BuildTypes::Build(path / "Types.csv"); auto* natureLibrary = BuildNatures::Build(path / "Natures.csv"); @@ -41,6 +43,9 @@ public: scriptResolver->Initialize(battleLib); + if (onScriptInitialize) { + onScriptInitialize(scriptResolver); + } auto asScriptResolver = dynamic_cast(scriptResolver); for (const auto& dirEntry : std::filesystem::recursive_directory_iterator(scriptsPath)) {