|
1 |
| -use bevy::prelude::*; |
2 |
| - |
3 |
| -use serde::{Deserialize, Serialize}; |
4 |
| - |
5 |
| -#[derive(Debug, Clone, PartialEq, Reflect, Asset, Serialize, Deserialize, Default, Resource)] |
6 |
| -#[reflect(Serialize, Deserialize, Resource)] |
7 |
| -pub(crate) struct GameConfig { |
8 |
| - pub(crate) camera: Camera, |
9 |
| - pub(crate) player: PlayerEffects, |
10 |
| -} |
11 |
| - |
12 |
| -#[derive(Debug, Clone, PartialEq, Reflect, Serialize, Deserialize, Default)] |
13 |
| -#[reflect(Serialize, Deserialize)] |
14 |
| -pub(crate) struct Camera { |
15 |
| - pub(crate) fixed_angle: FixedAngle, |
16 |
| - pub(crate) first_person: FirstPerson, |
17 |
| - pub(crate) third_person: ThirdPerson, |
18 |
| - pub(crate) mouse_sensitivity_x: f32, |
19 |
| - pub(crate) mouse_sensitivity_y: f32, |
20 |
| -} |
21 |
| - |
22 |
| -#[derive(Debug, Clone, PartialEq, Reflect, Serialize, Deserialize, Default)] |
23 |
| -#[reflect(Serialize, Deserialize)] |
24 |
| -pub(crate) struct FixedAngle { |
25 |
| - pub(crate) min_distance: f32, |
26 |
| - pub(crate) max_distance: f32, |
27 |
| - pub(crate) zoom_speed: f32, |
28 |
| - pub(crate) rotation_smoothing: f32, |
29 |
| - pub(crate) translation_smoothing: f32, |
30 |
| - pub(crate) zoom_in_smoothing: f32, |
31 |
| - pub(crate) zoom_out_smoothing: f32, |
32 |
| - pub(crate) pitch: f32, |
33 |
| -} |
34 |
| - |
35 |
| -#[derive(Debug, Clone, PartialEq, Reflect, Serialize, Deserialize, Default)] |
36 |
| -#[reflect(Serialize, Deserialize)] |
37 |
| -pub(crate) struct FirstPerson { |
38 |
| - pub(crate) translation_smoothing: f32, |
39 |
| - pub(crate) rotation_smoothing: f32, |
40 |
| - pub(crate) max_pitch: f32, |
41 |
| - pub(crate) min_pitch: f32, |
42 |
| - pub(crate) tracking_smoothing: f32, |
43 |
| -} |
44 |
| - |
45 |
| -#[derive(Debug, Clone, PartialEq, Reflect, Serialize, Deserialize, Default)] |
46 |
| -#[reflect(Serialize, Deserialize)] |
47 |
| -pub(crate) struct ThirdPerson { |
48 |
| - pub(crate) translation_smoothing: f32, |
49 |
| - pub(crate) rotation_smoothing: f32, |
50 |
| - pub(crate) max_pitch: f32, |
51 |
| - pub(crate) min_pitch: f32, |
52 |
| - pub(crate) min_distance: f32, |
53 |
| - pub(crate) max_distance: f32, |
54 |
| - pub(crate) zoom_speed: f32, |
55 |
| - pub(crate) min_distance_to_objects: f32, |
56 |
| - pub(crate) tracking_smoothing: f32, |
57 |
| - pub(crate) zoom_in_smoothing: f32, |
58 |
| - pub(crate) zoom_out_smoothing: f32, |
59 |
| -} |
60 |
| - |
61 |
| -#[derive(Debug, Clone, PartialEq, Reflect, Serialize, Deserialize, Default)] |
62 |
| -#[reflect(Serialize, Deserialize)] |
63 |
| -pub(crate) struct PlayerEffects { |
64 |
| - pub(crate) sprint_effect_speed_threshold: f32, |
65 |
| -} |
| 1 | +use bevy::prelude::*; |
| 2 | + |
| 3 | +use serde::{Deserialize, Serialize}; |
| 4 | + |
| 5 | +#[derive(Debug, Clone, PartialEq, Reflect, Asset, Serialize, Deserialize, Default, Resource)] |
| 6 | +#[reflect(Serialize, Deserialize, Resource)] |
| 7 | +pub(crate) struct GameConfig { |
| 8 | + pub(crate) camera: Camera, |
| 9 | + pub(crate) player: PlayerEffects, |
| 10 | +} |
| 11 | + |
| 12 | +#[derive(Debug, Clone, PartialEq, Reflect, Serialize, Deserialize, Default)] |
| 13 | +#[reflect(Serialize, Deserialize)] |
| 14 | +pub(crate) struct Camera { |
| 15 | + pub(crate) fixed_angle: FixedAngle, |
| 16 | + pub(crate) first_person: FirstPerson, |
| 17 | + pub(crate) third_person: ThirdPerson, |
| 18 | + pub(crate) mouse_sensitivity_x: f32, |
| 19 | + pub(crate) mouse_sensitivity_y: f32, |
| 20 | +} |
| 21 | + |
| 22 | +#[derive(Debug, Clone, PartialEq, Reflect, Serialize, Deserialize, Default)] |
| 23 | +#[reflect(Serialize, Deserialize)] |
| 24 | +pub(crate) struct FixedAngle { |
| 25 | + pub(crate) min_distance: f32, |
| 26 | + pub(crate) max_distance: f32, |
| 27 | + pub(crate) zoom_speed: f32, |
| 28 | + pub(crate) rotation_smoothing: f32, |
| 29 | + pub(crate) translation_smoothing: f32, |
| 30 | + pub(crate) zoom_in_smoothing: f32, |
| 31 | + pub(crate) zoom_out_smoothing: f32, |
| 32 | + pub(crate) pitch: f32, |
| 33 | +} |
| 34 | + |
| 35 | +#[derive(Debug, Clone, PartialEq, Reflect, Serialize, Deserialize, Default)] |
| 36 | +#[reflect(Serialize, Deserialize)] |
| 37 | +pub(crate) struct FirstPerson { |
| 38 | + pub(crate) translation_smoothing: f32, |
| 39 | + pub(crate) rotation_smoothing: f32, |
| 40 | + pub(crate) max_pitch: f32, |
| 41 | + pub(crate) min_pitch: f32, |
| 42 | + pub(crate) tracking_smoothing: f32, |
| 43 | +} |
| 44 | + |
| 45 | +#[derive(Debug, Clone, PartialEq, Reflect, Serialize, Deserialize, Default)] |
| 46 | +#[reflect(Serialize, Deserialize)] |
| 47 | +pub(crate) struct ThirdPerson { |
| 48 | + pub(crate) translation_smoothing: f32, |
| 49 | + pub(crate) rotation_smoothing: f32, |
| 50 | + pub(crate) max_pitch: f32, |
| 51 | + pub(crate) min_pitch: f32, |
| 52 | + pub(crate) min_distance: f32, |
| 53 | + pub(crate) max_distance: f32, |
| 54 | + pub(crate) zoom_speed: f32, |
| 55 | + pub(crate) min_distance_to_objects: f32, |
| 56 | + pub(crate) tracking_smoothing: f32, |
| 57 | + pub(crate) zoom_in_smoothing: f32, |
| 58 | + pub(crate) zoom_out_smoothing: f32, |
| 59 | +} |
| 60 | + |
| 61 | +#[derive(Debug, Clone, PartialEq, Reflect, Serialize, Deserialize, Default)] |
| 62 | +#[reflect(Serialize, Deserialize)] |
| 63 | +pub(crate) struct PlayerEffects { |
| 64 | + pub(crate) sprint_effect_speed_threshold: f32, |
| 65 | +} |
0 commit comments