fixed fomod plugin type deps

This commit is contained in:
2026-03-22 14:25:27 +01:00
parent b3126d1798
commit f404f597c1
2 changed files with 7 additions and 2 deletions

View File

@@ -118,6 +118,7 @@ pub enum PluginTypeDescriptorEnum {
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DependencyPluginType {
#[serde(rename = "defaultType")]
pub default_type: PluginType,
pub patterns: DependencyPatternList,
}
@@ -129,7 +130,7 @@ pub struct DependencyPatternList {
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct DependencyPattern {
pub dependencies: CompositeDependency,
pub dependencies: Vec<CompositeDependency>,
#[serde(rename = "type")]
pub typ: PluginType,
}

View File

@@ -176,7 +176,11 @@ fn resolve_plugin_type(
PluginTypeDescriptorEnum::PluginType(plugin_type) => plugin_type.name,
PluginTypeDescriptorEnum::DependencyType(dependency_plugin_type) => {
for dep in &dependency_plugin_type.patterns.pattern {
if evaluate_dependency(&dep.dependencies, state, installed_plugins) {
if dep
.dependencies
.iter()
.all(|e| evaluate_dependency(e, state, installed_plugins))
{
return dep.typ.name;
}
}