2023-02-21 01:55:49 +00:00
|
|
|
use crate::hud::{AutoPressBehavior, PressBehavior};
|
2021-04-13 13:24:47 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
/// `GameplaySettings` contains sensitivity and gameplay options.
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
|
|
#[serde(default)]
|
|
|
|
pub struct GameplaySettings {
|
|
|
|
pub pan_sensitivity: u32,
|
|
|
|
pub zoom_sensitivity: u32,
|
|
|
|
pub camera_clamp_angle: u32,
|
2023-10-13 19:28:56 +00:00
|
|
|
pub walking_speed: f32,
|
2021-04-13 13:24:47 +00:00
|
|
|
pub zoom_inversion: bool,
|
|
|
|
pub mouse_y_inversion: bool,
|
|
|
|
pub smooth_pan_enable: bool,
|
|
|
|
pub free_look_behavior: PressBehavior,
|
|
|
|
pub auto_walk_behavior: PressBehavior,
|
2023-10-13 19:28:56 +00:00
|
|
|
pub walking_speed_behavior: PressBehavior,
|
2021-04-13 13:24:47 +00:00
|
|
|
pub camera_clamp_behavior: PressBehavior,
|
2023-02-21 01:55:49 +00:00
|
|
|
pub zoom_lock_behavior: AutoPressBehavior,
|
2021-04-13 13:24:47 +00:00
|
|
|
pub stop_auto_walk_on_input: bool,
|
|
|
|
pub auto_camera: bool,
|
2022-05-23 23:09:47 +00:00
|
|
|
pub bow_zoom: bool,
|
2023-02-21 01:55:49 +00:00
|
|
|
pub zoom_lock: bool,
|
2024-01-28 14:11:21 +00:00
|
|
|
pub aim_offset_x: f32,
|
|
|
|
pub aim_offset_y: f32,
|
2021-04-13 13:24:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for GameplaySettings {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self {
|
|
|
|
pan_sensitivity: 100,
|
|
|
|
zoom_sensitivity: 100,
|
|
|
|
camera_clamp_angle: 45,
|
2023-10-13 19:28:56 +00:00
|
|
|
walking_speed: 0.35,
|
2021-04-13 13:24:47 +00:00
|
|
|
zoom_inversion: false,
|
|
|
|
mouse_y_inversion: false,
|
|
|
|
smooth_pan_enable: false,
|
|
|
|
free_look_behavior: PressBehavior::Toggle,
|
|
|
|
auto_walk_behavior: PressBehavior::Toggle,
|
2023-10-13 19:28:56 +00:00
|
|
|
walking_speed_behavior: PressBehavior::Toggle,
|
2021-04-13 13:24:47 +00:00
|
|
|
camera_clamp_behavior: PressBehavior::Toggle,
|
2023-02-21 01:55:49 +00:00
|
|
|
zoom_lock_behavior: AutoPressBehavior::Auto,
|
2021-04-13 13:24:47 +00:00
|
|
|
stop_auto_walk_on_input: true,
|
|
|
|
auto_camera: false,
|
2022-05-23 23:09:47 +00:00
|
|
|
bow_zoom: true,
|
2023-02-21 01:55:49 +00:00
|
|
|
zoom_lock: false,
|
2024-01-28 14:11:21 +00:00
|
|
|
aim_offset_x: 1.0,
|
|
|
|
aim_offset_y: 0.0,
|
2021-04-13 13:24:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|