mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-26 21:00:50 -04:00
impl platform-specific dependencies
This commit is contained in:
parent
6b82740fb3
commit
30c7d3f7c9
2 changed files with 16 additions and 2 deletions
loader/src/loader
|
@ -359,7 +359,10 @@ void Loader::Impl::buildModGraph() {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (dependency.importance != ModMetadata::Dependency::Importance::Required || dependency.mod == nullptr)
|
||||
if (
|
||||
dependency.importance != ModMetadata::Dependency::Importance::Required ||
|
||||
dependency.mod == nullptr
|
||||
)
|
||||
continue;
|
||||
|
||||
dependency.mod->m_impl->m_dependants.push_back(mod);
|
||||
|
|
|
@ -18,7 +18,8 @@ ModMetadata::Impl& ModMetadataImpl::getImpl(ModMetadata& info) {
|
|||
}
|
||||
|
||||
bool ModMetadata::Dependency::isResolved() const {
|
||||
return this->importance != Importance::Required ||
|
||||
return
|
||||
this->importance != Importance::Required ||
|
||||
this->mod && this->mod->isEnabled() && this->version.compare(this->mod->getVersion());
|
||||
}
|
||||
|
||||
|
@ -139,6 +140,16 @@ Result<ModMetadata> ModMetadata::Impl::createFromSchemaV010(ModJson const& rawJs
|
|||
for (auto& dep : root.has("dependencies").iterate()) {
|
||||
auto obj = dep.obj();
|
||||
|
||||
bool onThisPlatform = !obj.has("platforms");
|
||||
for (auto& plat : obj.has("platforms").iterate()) {
|
||||
if (PlatformID::from(plat.get<std::string>()) == GEODE_PLATFORM_TARGET) {
|
||||
onThisPlatform = true;
|
||||
}
|
||||
}
|
||||
if (!onThisPlatform) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Dependency dependency;
|
||||
obj.needs("id").validate(MiniFunction<bool(std::string const&)>(&ModMetadata::validateID)).into(dependency.id);
|
||||
obj.needs("version").into(dependency.version);
|
||||
|
|
Loading…
Add table
Reference in a new issue