diff --git a/src/games/star_rail/config/schema/game/mod.rs b/src/games/star_rail/config/schema/game/mod.rs index af517e2..4385227 100644 --- a/src/games/star_rail/config/schema/game/mod.rs +++ b/src/games/star_rail/config/schema/game/mod.rs @@ -26,6 +26,7 @@ use prelude::*; #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Game { pub path: Paths, + pub voices: Vec, pub wine: Wine, pub dxvk: Dxvk, pub enhancements: Enhancements, @@ -38,6 +39,9 @@ impl Default for Game { fn default() -> Self { Self { path: Paths::default(), + voices: vec![ + String::from("en-us") + ], wine: Wine::default(), dxvk: Dxvk::default(), enhancements: Enhancements::default(), @@ -56,6 +60,24 @@ impl From<&JsonValue> for Game { .map(Paths::from) .unwrap_or(default.path), + voices: match value.get("voices") { + Some(value) => match value.as_array() { + Some(values) => { + let mut voices = Vec::new(); + + for value in values { + if let Some(voice) = value.as_str() { + voices.push(voice.to_string()); + } + } + + voices + }, + None => default.voices + }, + None => default.voices + }, + wine: value.get("wine") .map(Wine::from) .unwrap_or(default.wine),