tweak default values for preferences

This commit is contained in:
yuni 2024-10-05 04:23:47 +02:00
parent 4af88bab15
commit b5105ff4c5

View file

@ -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,