veloren_voxygen/settings/
interface.rs1use crate::{
2 hud::{BarNumbers, BuffPosition, CrosshairType, Intro, ShortcutNumbers, XpBar},
3 ui::ScaleMode,
4};
5use common::comp::skillset::SkillGroupKind;
6use serde::{Deserialize, Serialize};
7
8#[derive(Clone, Debug, Serialize, Deserialize)]
10#[serde(default)]
11pub struct InterfaceSettings {
12 pub use_secure_service: bool,
13 pub toggle_debug: bool,
14 pub toggle_egui_debug: bool,
15 pub toggle_hitboxes: bool,
16 pub toggle_chat: bool,
17 pub slots_use_prefixes: bool,
18 pub slots_prefix_switch_point: u32,
19 pub sct: bool,
20 pub sct_damage_rounding: bool,
21 pub sct_dmg_accum_duration: f32,
22 pub sct_inc_dmg: bool,
23 pub sct_inc_dmg_accum_duration: f32,
24 pub speech_bubble_self: bool,
25 pub speech_bubble_dark_mode: bool,
26 pub speech_bubble_icon: bool,
27 pub crosshair_opacity: f32,
28 pub crosshair_type: CrosshairType,
29 pub intro_show: Intro,
30 pub xp_bar: XpBar,
31 pub shortcut_numbers: ShortcutNumbers,
32 pub buff_position: BuffPosition,
33 pub bar_numbers: BarNumbers,
34 pub always_show_bars: bool,
35 pub enable_poise_bar: bool,
36 pub use_health_prefixes: bool,
37 pub ui_scale: ScaleMode,
38 pub map_zoom: f64,
39 pub map_show_topo_map: bool,
40 pub map_show_difficulty: bool,
41 pub map_show_towns: bool,
42 pub map_show_dungeons: bool,
43 pub map_show_castles: bool,
44 pub map_show_bridges: bool,
45 pub map_show_glider_courses: bool,
46 pub loading_tips: bool,
47 pub map_show_caves: bool,
48 pub map_show_trees: bool,
49 pub map_show_peaks: bool,
50 pub map_show_biomes: bool,
51 pub map_show_voxel_map: bool,
52 pub map_show_quests: bool,
53 pub minimap_show: bool,
54 pub minimap_face_north: bool,
55 pub minimap_zoom: f64,
56 pub minimap_scale: f64,
57 pub minimap_colored_player_marker: bool,
58 pub accum_experience: bool,
59 pub xp_bar_skillgroup: Option<SkillGroupKind>,
60 pub row_background_opacity: f32,
61 pub toggle_draggable_windows: bool,
62 pub toggle_biome_change_popups: bool,
63 pub toggle_compact_item_slots: bool,
64 pub toggle_hotkey_hints: bool,
65 pub pause_menu_overlay_opacity: f32,
66}
67
68impl Default for InterfaceSettings {
69 fn default() -> Self {
70 Self {
71 use_secure_service: false,
72 toggle_debug: false,
73 toggle_egui_debug: false,
74 toggle_hitboxes: false,
75 toggle_chat: true,
76 slots_use_prefixes: true,
77 slots_prefix_switch_point: 5,
78 sct: true,
79 sct_damage_rounding: false,
80 sct_dmg_accum_duration: 0.45,
81 sct_inc_dmg: true,
82 sct_inc_dmg_accum_duration: 0.45,
83 speech_bubble_self: true,
84 speech_bubble_dark_mode: false,
85 speech_bubble_icon: true,
86 crosshair_opacity: 0.6,
87 crosshair_type: CrosshairType::Round,
88 intro_show: Intro::Show,
89 xp_bar: XpBar::Always,
90 shortcut_numbers: ShortcutNumbers::On,
91 buff_position: BuffPosition::Bar,
92 bar_numbers: BarNumbers::Values,
93 always_show_bars: false,
94 enable_poise_bar: true,
95 use_health_prefixes: true,
96 ui_scale: ScaleMode::RelativeToWindow([1920.0, 1080.0].into()),
97 map_zoom: 10.0,
98 map_show_topo_map: true,
99 map_show_difficulty: true,
100 map_show_towns: true,
101 map_show_dungeons: true,
102 map_show_castles: false,
103 map_show_bridges: false,
104 map_show_glider_courses: false,
105 loading_tips: true,
106 map_show_caves: true,
107 map_show_trees: false,
108 map_show_peaks: false,
109 map_show_biomes: false,
110 map_show_voxel_map: true,
111 map_show_quests: true,
112 minimap_show: true,
113 minimap_face_north: true,
114 minimap_zoom: 160.0,
115 minimap_scale: 1.5,
116 minimap_colored_player_marker: false,
117 accum_experience: true,
118 xp_bar_skillgroup: Some(SkillGroupKind::General),
119 row_background_opacity: 0.025,
120 pause_menu_overlay_opacity: 0.6,
121 toggle_draggable_windows: true,
122 toggle_biome_change_popups: true,
123 toggle_compact_item_slots: false,
124 toggle_hotkey_hints: true,
125 }
126 }
127}
128
129#[cfg(feature = "egui-ui")]
130impl InterfaceSettings {
131 pub fn egui_enabled(&self) -> bool { self.toggle_egui_debug }
132}