From b5105ff4c511a5256d1fd9d85bdc8ce38fad8d98 Mon Sep 17 00:00:00 2001 From: yuni Date: Sat, 5 Oct 2024 04:23:47 +0200 Subject: [PATCH] tweak default values for preferences --- src/var.rs | 9 +++++++++ 1 file changed, 9 insertions(+) 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,