added load_order to moddedInstance
This commit is contained in:
@@ -1,16 +1,15 @@
|
||||
use quick_xml::se;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{
|
||||
error::Error,
|
||||
fs::{self, read_to_string},
|
||||
io::{self, Write},
|
||||
io::Write,
|
||||
path::{Path, PathBuf},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
conflict_resolver::{Conflict, ConflictSolver},
|
||||
conflict_resolver::ConflictSolver,
|
||||
fomod::{FileType, FileTypeEnum},
|
||||
utils::{path_to_lowercase, walk_files_recursive},
|
||||
utils::walk_files_recursive,
|
||||
};
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, PartialEq)]
|
||||
@@ -72,7 +71,12 @@ impl ModConfig {
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
|
||||
pub struct ModdedInstance {
|
||||
pub name: String,
|
||||
|
||||
#[serde(default)]
|
||||
pub mods: Vec<InstalledMod>,
|
||||
|
||||
#[serde(default)]
|
||||
pub load_order: Vec<String>,
|
||||
}
|
||||
|
||||
impl ModdedInstance {
|
||||
@@ -80,6 +84,7 @@ impl ModdedInstance {
|
||||
Self {
|
||||
name: name.to_owned(),
|
||||
mods: Vec::new(),
|
||||
load_order: Vec::new(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,6 +135,14 @@ impl ModdedInstance {
|
||||
|
||||
self.mods.push(new_mod);
|
||||
}
|
||||
|
||||
pub fn set_load_order(&mut self, order: Vec<String>) {
|
||||
self.load_order = order;
|
||||
}
|
||||
|
||||
pub fn load_order(&self) -> &[String] {
|
||||
&self.load_order
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize, Serialize, PartialEq)]
|
||||
|
||||
Reference in New Issue
Block a user