2021-04-13 13:24:47 +00:00
|
|
|
use crate::{
|
|
|
|
hud::{BarNumbers, BuffPosition, CrosshairType, Intro, ShortcutNumbers, XpBar},
|
|
|
|
ui::ScaleMode,
|
|
|
|
};
|
2022-11-22 11:52:39 +00:00
|
|
|
use common::comp::skillset::SkillGroupKind;
|
2021-04-13 13:24:47 +00:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
/// `InterfaceSettings` contains UI, HUD and Map options.
|
|
|
|
#[derive(Clone, Debug, Serialize, Deserialize)]
|
|
|
|
#[serde(default)]
|
|
|
|
pub struct InterfaceSettings {
|
|
|
|
pub toggle_debug: bool,
|
2021-08-06 18:57:34 +00:00
|
|
|
pub toggle_egui_debug: bool,
|
2021-05-04 20:12:26 +00:00
|
|
|
pub toggle_hitboxes: bool,
|
2021-06-21 19:16:03 +00:00
|
|
|
pub toggle_chat: bool,
|
2021-09-24 16:03:05 +00:00
|
|
|
pub toggle_hotkey_hints: bool,
|
2023-08-17 15:24:05 +00:00
|
|
|
pub slots_use_prefixes: bool,
|
|
|
|
pub slots_prefix_switch_point: u32,
|
2021-04-13 13:24:47 +00:00
|
|
|
pub sct: bool,
|
2022-04-18 14:41:49 +00:00
|
|
|
pub sct_damage_rounding: bool,
|
2022-04-19 16:37:28 +00:00
|
|
|
pub sct_dmg_accum_duration: f32,
|
2022-06-14 21:11:58 +00:00
|
|
|
pub sct_inc_dmg: bool,
|
2022-04-19 16:37:28 +00:00
|
|
|
pub sct_inc_dmg_accum_duration: f32,
|
2021-12-31 21:42:01 +00:00
|
|
|
pub speech_bubble_self: bool,
|
2021-04-13 13:24:47 +00:00
|
|
|
pub speech_bubble_dark_mode: bool,
|
|
|
|
pub speech_bubble_icon: bool,
|
2021-08-01 19:40:06 +00:00
|
|
|
pub crosshair_opacity: f32,
|
2021-04-13 13:24:47 +00:00
|
|
|
pub crosshair_type: CrosshairType,
|
|
|
|
pub intro_show: Intro,
|
|
|
|
pub xp_bar: XpBar,
|
|
|
|
pub shortcut_numbers: ShortcutNumbers,
|
|
|
|
pub buff_position: BuffPosition,
|
|
|
|
pub bar_numbers: BarNumbers,
|
2021-09-15 12:04:44 +00:00
|
|
|
pub always_show_bars: bool,
|
2022-10-24 11:44:11 +00:00
|
|
|
pub enable_poise_bar: bool,
|
2021-04-13 13:24:47 +00:00
|
|
|
pub ui_scale: ScaleMode,
|
|
|
|
pub map_zoom: f64,
|
|
|
|
pub map_show_topo_map: bool,
|
|
|
|
pub map_show_difficulty: bool,
|
|
|
|
pub map_show_towns: bool,
|
|
|
|
pub map_show_dungeons: bool,
|
|
|
|
pub map_show_castles: bool,
|
2022-09-26 14:46:30 +00:00
|
|
|
pub map_show_bridges: bool,
|
2021-04-13 13:24:47 +00:00
|
|
|
pub loading_tips: bool,
|
|
|
|
pub map_show_caves: bool,
|
|
|
|
pub map_show_trees: bool,
|
2021-05-03 02:00:23 +00:00
|
|
|
pub map_show_peaks: bool,
|
2022-01-17 22:45:51 +00:00
|
|
|
pub map_show_biomes: bool,
|
2021-05-14 00:46:17 +00:00
|
|
|
pub map_show_voxel_map: bool,
|
2021-04-13 13:24:47 +00:00
|
|
|
pub minimap_show: bool,
|
|
|
|
pub minimap_face_north: bool,
|
2021-04-19 18:51:53 +00:00
|
|
|
pub minimap_zoom: f64,
|
2022-06-14 21:11:58 +00:00
|
|
|
pub accum_experience: bool,
|
2022-11-22 11:52:39 +00:00
|
|
|
pub xp_bar_skillgroup: Option<SkillGroupKind>,
|
2021-04-13 13:24:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Default for InterfaceSettings {
|
|
|
|
fn default() -> Self {
|
|
|
|
Self {
|
|
|
|
toggle_debug: false,
|
2021-08-06 18:57:34 +00:00
|
|
|
toggle_egui_debug: false,
|
2021-05-04 20:12:26 +00:00
|
|
|
toggle_hitboxes: false,
|
2021-06-21 19:16:03 +00:00
|
|
|
toggle_chat: true,
|
2021-09-24 16:03:05 +00:00
|
|
|
toggle_hotkey_hints: true,
|
2023-08-17 15:24:05 +00:00
|
|
|
slots_use_prefixes: true,
|
|
|
|
slots_prefix_switch_point: 5,
|
2021-04-13 13:24:47 +00:00
|
|
|
sct: true,
|
2022-04-18 14:41:49 +00:00
|
|
|
sct_damage_rounding: false,
|
2022-05-17 19:30:51 +00:00
|
|
|
sct_dmg_accum_duration: 0.45,
|
2022-06-14 21:11:58 +00:00
|
|
|
sct_inc_dmg: true,
|
2022-05-17 19:30:51 +00:00
|
|
|
sct_inc_dmg_accum_duration: 0.45,
|
2022-01-02 23:24:11 +00:00
|
|
|
speech_bubble_self: true,
|
2021-04-13 13:24:47 +00:00
|
|
|
speech_bubble_dark_mode: false,
|
|
|
|
speech_bubble_icon: true,
|
2021-08-01 19:40:06 +00:00
|
|
|
crosshair_opacity: 0.6,
|
2021-04-13 13:24:47 +00:00
|
|
|
crosshair_type: CrosshairType::Round,
|
|
|
|
intro_show: Intro::Show,
|
|
|
|
xp_bar: XpBar::Always,
|
|
|
|
shortcut_numbers: ShortcutNumbers::On,
|
|
|
|
buff_position: BuffPosition::Bar,
|
|
|
|
bar_numbers: BarNumbers::Values,
|
2021-09-15 12:04:44 +00:00
|
|
|
always_show_bars: false,
|
2022-10-24 11:44:11 +00:00
|
|
|
enable_poise_bar: false,
|
2021-04-13 13:24:47 +00:00
|
|
|
ui_scale: ScaleMode::RelativeToWindow([1920.0, 1080.0].into()),
|
|
|
|
map_zoom: 10.0,
|
2021-09-10 08:34:01 +00:00
|
|
|
map_show_topo_map: true,
|
2021-04-13 13:24:47 +00:00
|
|
|
map_show_difficulty: true,
|
|
|
|
map_show_towns: true,
|
|
|
|
map_show_dungeons: true,
|
2021-05-03 02:00:23 +00:00
|
|
|
map_show_castles: false,
|
2022-09-26 14:46:30 +00:00
|
|
|
map_show_bridges: false,
|
2021-04-13 13:24:47 +00:00
|
|
|
loading_tips: true,
|
|
|
|
map_show_caves: true,
|
2021-05-03 02:00:23 +00:00
|
|
|
map_show_trees: false,
|
|
|
|
map_show_peaks: false,
|
2022-01-17 22:45:51 +00:00
|
|
|
map_show_biomes: false,
|
2021-09-10 08:34:01 +00:00
|
|
|
map_show_voxel_map: true,
|
2021-04-13 13:24:47 +00:00
|
|
|
minimap_show: true,
|
2021-09-10 08:34:01 +00:00
|
|
|
minimap_face_north: true,
|
|
|
|
minimap_zoom: 160.0,
|
2022-06-14 21:11:58 +00:00
|
|
|
accum_experience: true,
|
2022-11-22 11:52:39 +00:00
|
|
|
xp_bar_skillgroup: Some(SkillGroupKind::General),
|
2021-04-13 13:24:47 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-08-31 16:21:13 +00:00
|
|
|
|
|
|
|
#[cfg(feature = "egui-ui")]
|
|
|
|
impl InterfaceSettings {
|
2022-01-24 06:40:55 +00:00
|
|
|
pub fn egui_enabled(&self) -> bool { self.toggle_egui_debug }
|
2021-08-31 16:21:13 +00:00
|
|
|
}
|