added log lines
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use std::{collections::HashMap, fmt::Display};
|
||||
|
||||
use log::{debug, warn};
|
||||
|
||||
use crate::fomod::{
|
||||
CompositeDependency, Config, DependencyOperator, DependencyState, FileList, FileTypeEnum,
|
||||
Group, GroupType, Plugin, PluginTypeDescriptorEnum, PluginTypeEnum,
|
||||
@@ -20,6 +22,7 @@ impl InstallerState {
|
||||
}
|
||||
|
||||
fn set_flag(&mut self, name: &str, value: &str) {
|
||||
debug!("Setting flag: {} to {}", name, value);
|
||||
self.flags.insert(name.to_string(), value.to_string());
|
||||
}
|
||||
|
||||
@@ -29,6 +32,7 @@ impl InstallerState {
|
||||
|
||||
fn add_files(&mut self, files: &FileList) {
|
||||
let Some(list) = &files.list else {
|
||||
debug!("Adding empty file list to installer state");
|
||||
return;
|
||||
};
|
||||
|
||||
@@ -66,12 +70,20 @@ fn evaluate_dependency(
|
||||
CompositeDependency::Game(version) => {
|
||||
// TODO: Check the game version
|
||||
let _ = version;
|
||||
warn!(
|
||||
"Trying to eveluate game version dependency: {} - Not implemented yet.",
|
||||
version.version
|
||||
);
|
||||
true
|
||||
}
|
||||
|
||||
CompositeDependency::Fomm(version) => {
|
||||
// TODO: Check the fomm version
|
||||
let _ = version;
|
||||
warn!(
|
||||
"Trying to eveluate FOMM dependency: {} - Not implemented yet.",
|
||||
version.version
|
||||
);
|
||||
true
|
||||
}
|
||||
|
||||
@@ -189,13 +201,15 @@ impl FomodInstaller {
|
||||
if let Some(install_steps) = &self.config.install_steps {
|
||||
let steps = &install_steps.install_step;
|
||||
|
||||
for (step_index, step) in steps.iter().enumerate() {
|
||||
for step in steps {
|
||||
// Check if the step should be visible
|
||||
if let Some(visible) = &step.visible {
|
||||
if !evaluate_dependency(visible, &state, &self.installed_plugins) {
|
||||
// Dependency to show the step not meet. Skipping.
|
||||
continue;
|
||||
}
|
||||
if step
|
||||
.visible
|
||||
.as_ref()
|
||||
.is_some_and(|v| !evaluate_dependency(v, &state, &self.installed_plugins))
|
||||
{
|
||||
// Dependency to show the step not meet. Skipping.
|
||||
continue;
|
||||
}
|
||||
|
||||
for group in &step.optional_file_groups.group {
|
||||
|
||||
Reference in New Issue
Block a user