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