From e8cac6786bc2e91382316ef1023a494c3e812013 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Sun, 30 Apr 2023 20:11:10 +0200 Subject: added modloader default to config --- src/config.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs index 9064548..cf27257 100644 --- a/src/config.rs +++ b/src/config.rs @@ -6,12 +6,13 @@ use std::{ use serde::{Deserialize, Serialize}; -use crate::{db::db_setup, error::MLE}; +use crate::{db::db_setup, error::MLE, Modloader}; #[derive(Debug, Clone, Serialize, Deserialize)] pub struct Cfg { pub data: String, pub cache: String, + pub defaults: Defaults, pub apis: Apis, } @@ -20,6 +21,11 @@ pub struct Apis { pub modrinth: String, } +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct Defaults { + pub modloader: Modloader, +} + impl Cfg { pub fn init(path: Option) -> MLE { let configfile = match path.clone() { @@ -72,6 +78,9 @@ fn create_config(path: &str) -> MLE<()> { let default_cfg = Cfg { data: cache_dir.clone(), cache: format!("{}/cache", cache_dir), + defaults: Defaults { + modloader: Modloader::Fabric + }, apis: Apis { modrinth: String::from("https://api.modrinth.com/v2/"), }, -- cgit v1.2.3