diff --git a/src/var.rs b/src/var.rs index 9b1451b..400e0d2 100644 --- a/src/var.rs +++ b/src/var.rs @@ -467,7 +467,9 @@ pub struct Preferences { pub third_person: bool, pub shadows_sun: bool, pub avatar: usize, + #[serde(default = "Preferences::default_light_amp")] pub light_amp: usize, // 0-3 + #[serde(default = "Preferences::default_flashlight_power")] pub flashlight_power: usize, // 0-2 pub thruster_boost: usize, // 0-2 @@ -476,6 +478,13 @@ pub struct Preferences { } impl Preferences { + pub fn default_light_amp() -> usize { + 1 + } + pub fn default_flashlight_power() -> usize { + 2 + } + pub fn get_fullscreen_mode(&self) -> WindowMode { match self.fullscreen_mode.as_str() { "legacy" => WindowMode::Fullscreen,