Skip to content

Commit

Permalink
adjustments to how packages are located
Browse files Browse the repository at this point in the history
  • Loading branch information
Zarklord committed Jul 26, 2024
1 parent 4e15ab8 commit 5881cc0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
6 changes: 3 additions & 3 deletions Projects/LuaSpore/config.properties
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions Projects/LuaSpore/modloader/moddef.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions Spore LuaAPI/SourceCode/LuaSpore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 5881cc0

Please sign in to comment.