From 5881cc0b0ba1a9dfafcc4b3e5ec93ef6fcddf196 Mon Sep 17 00:00:00 2001 From: Zachary Lockwood Date: Fri, 26 Jul 2024 14:38:10 -0400 Subject: [PATCH] adjustments to how packages are located --- Projects/LuaSpore/config.properties | 6 +++--- Projects/LuaSpore/modloader/moddef.lua | 3 +++ Spore LuaAPI/SourceCode/LuaSpore.cpp | 8 +++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Projects/LuaSpore/config.properties b/Projects/LuaSpore/config.properties index 0671230..4ffd753 100644 --- a/Projects/LuaSpore/config.properties +++ b/Projects/LuaSpore/config.properties @@ -1,8 +1,8 @@ -#Tue Jan 23 23:58:33 EST 2024 -lastTimeUsed=1706072313134 +#Fri Jul 26 14:37:06 EDT 2024 +lastTimeUsed=1722018023190 isReadOnly=false sources= -packPathType=GALACTIC_ADVENTURES +packPathType=SPORE packPath= packageName=LuaSpore.package embeddedEditorPackages=None diff --git a/Projects/LuaSpore/modloader/moddef.lua b/Projects/LuaSpore/modloader/moddef.lua index 1cacac6..e86d375 100644 --- a/Projects/LuaSpore/modloader/moddef.lua +++ b/Projects/LuaSpore/modloader/moddef.lua @@ -34,6 +34,9 @@ function ModDefinition:LoadModInfo() printf.ModLoader("Package %s could not be loaded because the SporeLuaAPI version %d is too low, expected: %d", self.dbpf_name, cur_version, self.modinfo.base_api_version) self.invalid_modinfo = true end + else + printf.ModLoader("Package %s could not be loaded because the minimum SporeLuaAPI version was missing", self.dbpf_name) + self.invalid_modinfo = true end if self.modinfo.cpp_mod_requirements then diff --git a/Spore LuaAPI/SourceCode/LuaSpore.cpp b/Spore LuaAPI/SourceCode/LuaSpore.cpp index de44a3c..a8ef3fa 100644 --- a/Spore LuaAPI/SourceCode/LuaSpore.cpp +++ b/Spore LuaAPI/SourceCode/LuaSpore.cpp @@ -665,13 +665,15 @@ static eastl::string16 GetPackageNameFromDatabase(const Resource::Database* data void LuaSpore::LocateLuaMods() { - Resource::IResourceManager::DatabaseList databases; - ResourceManager.GetDatabaseList(databases); + ResourceKey base_package{id("main"), id("lua"), id("scripts")}; + ResourceKey mods{id("main"), id("lua"), id("mod")}; + Resource::IResourceManager::DatabaseList databases; + ResourceManager.GetDatabaseList(databases, &base_package); + ResourceManager.GetDatabaseList(databases, &mods); for (const auto database : databases) { auto package_name = GetPackageNameFromDatabase(database); - if (!package_name.empty()) { mLuaDatabases[package_name] = database;