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