mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'PersianKnight/InterfaceSettings' into 'master'
Separated InterfaceSettings from GameplaySettings See merge request veloren/veloren!1887
This commit is contained in:
commit
4022937da7
@ -105,7 +105,7 @@ impl<'a> Widget for BuffsBar<'a> {
|
||||
let buff_ani = ((self.pulse * 4.0/* speed factor */).cos() * 0.5 + 0.8) + 0.5; //Animation timer
|
||||
let pulsating_col = Color::Rgba(1.0, 1.0, 1.0, buff_ani);
|
||||
let norm_col = Color::Rgba(1.0, 1.0, 1.0, 1.0);
|
||||
let buff_position = self.global_state.settings.gameplay.buff_position;
|
||||
let buff_position = self.global_state.settings.interface.buff_position;
|
||||
let buffs_tooltip = Tooltip::new({
|
||||
// Edge images [t, b, r, l]
|
||||
// Corner images [tr, tl, br, bl]
|
||||
|
@ -178,7 +178,7 @@ impl<'a> Widget for Chat<'a> {
|
||||
#[allow(clippy::single_match)] // TODO: Pending review in #587
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
let widget::UpdateArgs { id, state, ui, .. } = args;
|
||||
let transp = self.global_state.settings.gameplay.chat_transp;
|
||||
let transp = self.global_state.settings.interface.chat_transp;
|
||||
// Maintain scrolling.
|
||||
if !self.new_messages.is_empty() {
|
||||
state.update(|s| s.messages.extend(self.new_messages.drain(..)));
|
||||
@ -364,7 +364,7 @@ impl<'a> Widget for Chat<'a> {
|
||||
});
|
||||
}
|
||||
|
||||
let show_char_name = self.global_state.settings.gameplay.chat_character_name;
|
||||
let show_char_name = self.global_state.settings.interface.chat_character_name;
|
||||
while let Some(item) = items.next(ui) {
|
||||
// This would be easier if conrod used the v-metrics from rusttype.
|
||||
if item.i < state.messages.len() {
|
||||
|
@ -150,7 +150,7 @@ impl<'a> Widget for Group<'a> {
|
||||
let mut events = Vec::new();
|
||||
let localized_strings = self.localized_strings;
|
||||
let buff_ani = ((self.pulse * 4.0/* speed factor */).cos() * 0.5 + 0.8) + 0.5; //Animation timer
|
||||
let debug_on = self.global_state.settings.gameplay.toggle_debug;
|
||||
let debug_on = self.global_state.settings.interface.toggle_debug;
|
||||
let offset = if debug_on { 270.0 } else { 0.0 };
|
||||
let buffs_tooltip = Tooltip::new({
|
||||
// Edge images [t, b, r, l]
|
||||
|
@ -141,13 +141,13 @@ impl<'a> Widget for Map<'a> {
|
||||
#[allow(clippy::useless_format)] // TODO: Pending review in #587
|
||||
fn update(self, args: widget::UpdateArgs<Self>) -> Self::Event {
|
||||
let widget::UpdateArgs { state, ui, .. } = args;
|
||||
let zoom = self.global_state.settings.gameplay.map_zoom * 0.8;
|
||||
let show_difficulty = self.global_state.settings.gameplay.map_show_difficulty;
|
||||
let show_towns = self.global_state.settings.gameplay.map_show_towns;
|
||||
let show_dungeons = self.global_state.settings.gameplay.map_show_dungeons;
|
||||
let show_castles = self.global_state.settings.gameplay.map_show_castles;
|
||||
let show_caves = self.global_state.settings.gameplay.map_show_caves;
|
||||
let show_trees = self.global_state.settings.gameplay.map_show_trees;
|
||||
let zoom = self.global_state.settings.interface.map_zoom * 0.8;
|
||||
let show_difficulty = self.global_state.settings.interface.map_show_difficulty;
|
||||
let show_towns = self.global_state.settings.interface.map_show_towns;
|
||||
let show_dungeons = self.global_state.settings.interface.map_show_dungeons;
|
||||
let show_castles = self.global_state.settings.interface.map_show_castles;
|
||||
let show_caves = self.global_state.settings.interface.map_show_caves;
|
||||
let show_trees = self.global_state.settings.interface.map_show_trees;
|
||||
let mut events = Vec::new();
|
||||
let i18n = &self.localized_strings;
|
||||
// Tooltips
|
||||
@ -254,7 +254,7 @@ impl<'a> Widget for Map<'a> {
|
||||
let w_src = max_zoom / zoom;
|
||||
let h_src = max_zoom / zoom;
|
||||
// Handle dragging
|
||||
let drag = self.global_state.settings.gameplay.map_drag;
|
||||
let drag = self.global_state.settings.interface.map_drag;
|
||||
let dragged: Vec2<f64> = ui
|
||||
.widget_input(state.ids.grid)
|
||||
.drags()
|
||||
@ -296,7 +296,7 @@ impl<'a> Widget for Map<'a> {
|
||||
.scrolls()
|
||||
.map(|scroll| scroll.y)
|
||||
.sum();
|
||||
let new_zoom_lvl = (self.global_state.settings.gameplay.map_zoom
|
||||
let new_zoom_lvl = (self.global_state.settings.interface.map_zoom
|
||||
* (scrolled * 0.05 * -1.0).exp2())
|
||||
.clamped(1.25, max_zoom / 64.0);
|
||||
events.push(Event::MapZoom(new_zoom_lvl as f64));
|
||||
|
@ -116,8 +116,8 @@ impl<'a> Widget for MiniMap<'a> {
|
||||
let widget::UpdateArgs { state, ui, .. } = args;
|
||||
let zoom = state.zoom;
|
||||
const SCALE: f64 = 1.5; // TODO Make this a setting
|
||||
let show_minimap = self.global_state.settings.gameplay.minimap_show;
|
||||
let is_facing_north = self.global_state.settings.gameplay.minimap_face_north;
|
||||
let show_minimap = self.global_state.settings.interface.minimap_show;
|
||||
let is_facing_north = self.global_state.settings.interface.minimap_face_north;
|
||||
let orientation = if is_facing_north {
|
||||
Vec3::new(0.0, 1.0, 0.0)
|
||||
} else {
|
||||
|
@ -750,7 +750,7 @@ impl Hud {
|
||||
let settings = &global_state.settings;
|
||||
|
||||
let mut ui = Ui::new(window).unwrap();
|
||||
ui.set_scaling_mode(settings.gameplay.ui_scale);
|
||||
ui.set_scaling_mode(settings.interface.ui_scale);
|
||||
// Generate ids.
|
||||
let ids = Ids::new(ui.id_generator());
|
||||
// NOTE: Use a border the same color as the LOD ocean color (but with a
|
||||
@ -950,7 +950,7 @@ impl Hud {
|
||||
if !self.show.help {
|
||||
Image::new(
|
||||
// TODO: Do we want to match on this every frame?
|
||||
match global_state.settings.gameplay.crosshair_type {
|
||||
match global_state.settings.interface.crosshair_type {
|
||||
CrosshairType::Round => self.imgs.crosshair_outer_round,
|
||||
CrosshairType::RoundEdges => self.imgs.crosshair_outer_round_edges,
|
||||
CrosshairType::Edges => self.imgs.crosshair_outer_edges,
|
||||
@ -962,7 +962,7 @@ impl Hud {
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
self.crosshair_opacity * global_state.settings.gameplay.crosshair_transp,
|
||||
self.crosshair_opacity * global_state.settings.interface.crosshair_transp,
|
||||
)))
|
||||
.set(self.ids.crosshair_outer, ui_widgets);
|
||||
Image::new(self.imgs.crosshair_inner)
|
||||
@ -985,7 +985,7 @@ impl Hud {
|
||||
.map_or(Vec3::zero(), |pos| pos.0);
|
||||
// SCT Output values are called hp_damage and floater.hp_change
|
||||
// Numbers are currently divided by 10 and rounded
|
||||
if global_state.settings.gameplay.sct {
|
||||
if global_state.settings.interface.sct {
|
||||
// Render Player SCT numbers
|
||||
let mut player_sct_bg_id_walker = self.ids.player_sct_bgs.walk();
|
||||
let mut player_sct_id_walker = self.ids.player_scts.walk();
|
||||
@ -995,7 +995,7 @@ impl Hud {
|
||||
.filter(|fl| !fl.floaters.is_empty()),
|
||||
healths.get(me),
|
||||
) {
|
||||
if global_state.settings.gameplay.sct_player_batch {
|
||||
if global_state.settings.interface.sct_player_batch {
|
||||
let number_speed = 100.0; // Player Batched Numbers Speed
|
||||
let player_sct_bg_id = player_sct_bg_id_walker.next(
|
||||
&mut self.ids.player_sct_bgs,
|
||||
@ -1053,7 +1053,7 @@ impl Hud {
|
||||
for floater in floaters {
|
||||
// Healing always single numbers so just skip damage when in batch mode
|
||||
|
||||
if global_state.settings.gameplay.sct_player_batch && floater.hp_change < 0
|
||||
if global_state.settings.interface.sct_player_batch && floater.hp_change < 0
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@ -1439,7 +1439,7 @@ impl Hud {
|
||||
info,
|
||||
bubble,
|
||||
in_group,
|
||||
&global_state.settings.gameplay,
|
||||
&global_state.settings.interface,
|
||||
self.pulse,
|
||||
i18n,
|
||||
&self.imgs,
|
||||
@ -1450,7 +1450,7 @@ impl Hud {
|
||||
.set(overhead_id, ui_widgets);
|
||||
|
||||
// Enemy SCT
|
||||
if global_state.settings.gameplay.sct && !hpfl.floaters.is_empty() {
|
||||
if global_state.settings.interface.sct && !hpfl.floaters.is_empty() {
|
||||
let floaters = &hpfl.floaters;
|
||||
|
||||
// Colors
|
||||
@ -1474,7 +1474,7 @@ impl Hud {
|
||||
DAMAGE_COLORS[(font_size.saturating_sub(36) / 5).min(5) as usize]
|
||||
};
|
||||
|
||||
if global_state.settings.gameplay.sct_damage_batch {
|
||||
if global_state.settings.interface.sct_damage_batch {
|
||||
let number_speed = 50.0; // Damage number speed
|
||||
let sct_id = sct_walker
|
||||
.next(&mut self.ids.scts, &mut ui_widgets.widget_id_generator());
|
||||
@ -1646,7 +1646,7 @@ impl Hud {
|
||||
.get_binding(GameInput::ToggleCursor)
|
||||
{
|
||||
if !self.show.intro {
|
||||
match global_state.settings.gameplay.intro_show {
|
||||
match global_state.settings.interface.intro_show {
|
||||
Intro::Show => {
|
||||
if Button::image(self.imgs.button)
|
||||
.w_h(150.0, 40.0)
|
||||
@ -1699,7 +1699,7 @@ impl Hud {
|
||||
}
|
||||
// TODO: Add event/stat based tutorial system
|
||||
if self.show.intro && !self.show.esc_menu {
|
||||
match global_state.settings.gameplay.intro_show {
|
||||
match global_state.settings.interface.intro_show {
|
||||
Intro::Show => {
|
||||
if self.show.intro {
|
||||
self.show.want_grab = false;
|
||||
@ -2690,7 +2690,7 @@ impl Hud {
|
||||
}
|
||||
} else {
|
||||
// Reset the map position when it's not showing
|
||||
let drag = &global_state.settings.gameplay.map_drag;
|
||||
let drag = &global_state.settings.interface.map_drag;
|
||||
if drag.x != 0.0 || drag.y != 0.0 {
|
||||
events.push(Event::MapDrag(Vec2::zero()))
|
||||
}
|
||||
@ -3107,8 +3107,8 @@ impl Hud {
|
||||
true
|
||||
},
|
||||
GameInput::ToggleDebug if state => {
|
||||
global_state.settings.gameplay.toggle_debug =
|
||||
!global_state.settings.gameplay.toggle_debug;
|
||||
global_state.settings.interface.toggle_debug =
|
||||
!global_state.settings.interface.toggle_debug;
|
||||
true
|
||||
},
|
||||
GameInput::ToggleIngameUi if state => {
|
||||
|
@ -6,7 +6,7 @@ use super::{
|
||||
use crate::{
|
||||
hud::{get_buff_image, get_buff_info},
|
||||
i18n::Localization,
|
||||
settings::GameplaySettings,
|
||||
settings::InterfaceSettings,
|
||||
ui::{fonts::Fonts, Ingameable},
|
||||
};
|
||||
use common::comp::{Buffs, Energy, Health, SpeechBubble, SpeechBubbleType};
|
||||
@ -73,7 +73,7 @@ pub struct Overhead<'a> {
|
||||
info: Option<Info<'a>>,
|
||||
bubble: Option<&'a SpeechBubble>,
|
||||
in_group: bool,
|
||||
settings: &'a GameplaySettings,
|
||||
settings: &'a InterfaceSettings,
|
||||
pulse: f32,
|
||||
i18n: &'a Localization,
|
||||
imgs: &'a Imgs,
|
||||
@ -89,7 +89,7 @@ impl<'a> Overhead<'a> {
|
||||
info: Option<Info<'a>>,
|
||||
bubble: Option<&'a SpeechBubble>,
|
||||
in_group: bool,
|
||||
settings: &'a GameplaySettings,
|
||||
settings: &'a InterfaceSettings,
|
||||
pulse: f32,
|
||||
i18n: &'a Localization,
|
||||
imgs: &'a Imgs,
|
||||
|
@ -377,10 +377,10 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
let widget::UpdateArgs { state, ui, .. } = args;
|
||||
|
||||
let mut events = Vec::new();
|
||||
let bar_values = self.global_state.settings.gameplay.bar_numbers;
|
||||
let bar_values = self.global_state.settings.interface.bar_numbers;
|
||||
let tab_font_scale = 18;
|
||||
|
||||
//let mut xp_bar = self.global_state.settings.gameplay.xp_bar;
|
||||
//let mut xp_bar = self.global_state.settings.interface.xp_bar;
|
||||
|
||||
// Frame
|
||||
Image::new(self.imgs.settings_bg)
|
||||
@ -470,10 +470,10 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
|
||||
// Contents Left Side
|
||||
if let SettingsTab::Interface = self.show.settings_tab {
|
||||
let crosshair_transp = self.global_state.settings.gameplay.crosshair_transp;
|
||||
let crosshair_type = self.global_state.settings.gameplay.crosshair_type;
|
||||
let ui_scale = self.global_state.settings.gameplay.ui_scale;
|
||||
let chat_transp = self.global_state.settings.gameplay.chat_transp;
|
||||
let crosshair_transp = self.global_state.settings.interface.crosshair_transp;
|
||||
let crosshair_type = self.global_state.settings.interface.crosshair_type;
|
||||
let ui_scale = self.global_state.settings.interface.ui_scale;
|
||||
let chat_transp = self.global_state.settings.interface.chat_transp;
|
||||
|
||||
Text::new(&self.localized_strings.get("hud.settings.general"))
|
||||
.top_left_with_margins_on(state.ids.settings_content, 5.0, 5.0)
|
||||
@ -508,7 +508,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
|
||||
// Loading Screen Tips
|
||||
let show_tips = ToggleButton::new(
|
||||
self.global_state.settings.gameplay.loading_tips,
|
||||
self.global_state.settings.interface.loading_tips,
|
||||
self.imgs.checkbox,
|
||||
self.imgs.checkbox_checked,
|
||||
)
|
||||
@ -518,9 +518,9 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked)
|
||||
.set(state.ids.load_tips_button, ui);
|
||||
|
||||
if self.global_state.settings.gameplay.loading_tips != show_tips {
|
||||
if self.global_state.settings.interface.loading_tips != show_tips {
|
||||
events.push(Event::ToggleTips(
|
||||
!self.global_state.settings.gameplay.loading_tips,
|
||||
!self.global_state.settings.interface.loading_tips,
|
||||
));
|
||||
}
|
||||
|
||||
@ -705,7 +705,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
self.global_state.settings.gameplay.crosshair_transp,
|
||||
self.global_state.settings.interface.crosshair_transp,
|
||||
)))
|
||||
.graphics_for(state.ids.ch_1_bg)
|
||||
.set(state.ids.crosshair_outer_1, ui);
|
||||
@ -748,7 +748,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
self.global_state.settings.gameplay.crosshair_transp,
|
||||
self.global_state.settings.interface.crosshair_transp,
|
||||
)))
|
||||
.graphics_for(state.ids.ch_2_bg)
|
||||
.set(state.ids.crosshair_outer_2, ui);
|
||||
@ -791,7 +791,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
self.global_state.settings.gameplay.crosshair_transp,
|
||||
self.global_state.settings.interface.crosshair_transp,
|
||||
)))
|
||||
.graphics_for(state.ids.ch_3_bg)
|
||||
.set(state.ids.crosshair_outer_3, ui);
|
||||
@ -848,24 +848,30 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.hotbar_title, ui);
|
||||
// Show Shortcut Numbers
|
||||
if Button::image(match self.global_state.settings.gameplay.shortcut_numbers {
|
||||
ShortcutNumbers::On => self.imgs.checkbox_checked,
|
||||
ShortcutNumbers::Off => self.imgs.checkbox,
|
||||
})
|
||||
if Button::image(
|
||||
match self.global_state.settings.interface.shortcut_numbers {
|
||||
ShortcutNumbers::On => self.imgs.checkbox_checked,
|
||||
ShortcutNumbers::Off => self.imgs.checkbox,
|
||||
},
|
||||
)
|
||||
.w_h(18.0, 18.0)
|
||||
.hover_image(match self.global_state.settings.gameplay.shortcut_numbers {
|
||||
ShortcutNumbers::On => self.imgs.checkbox_checked_mo,
|
||||
ShortcutNumbers::Off => self.imgs.checkbox_mo,
|
||||
})
|
||||
.press_image(match self.global_state.settings.gameplay.shortcut_numbers {
|
||||
ShortcutNumbers::On => self.imgs.checkbox_checked,
|
||||
ShortcutNumbers::Off => self.imgs.checkbox_press,
|
||||
})
|
||||
.hover_image(
|
||||
match self.global_state.settings.interface.shortcut_numbers {
|
||||
ShortcutNumbers::On => self.imgs.checkbox_checked_mo,
|
||||
ShortcutNumbers::Off => self.imgs.checkbox_mo,
|
||||
},
|
||||
)
|
||||
.press_image(
|
||||
match self.global_state.settings.interface.shortcut_numbers {
|
||||
ShortcutNumbers::On => self.imgs.checkbox_checked,
|
||||
ShortcutNumbers::Off => self.imgs.checkbox_press,
|
||||
},
|
||||
)
|
||||
.down_from(state.ids.hotbar_title, 8.0)
|
||||
.set(state.ids.show_shortcuts_button, ui)
|
||||
.was_clicked()
|
||||
{
|
||||
match self.global_state.settings.gameplay.shortcut_numbers {
|
||||
match self.global_state.settings.interface.shortcut_numbers {
|
||||
ShortcutNumbers::On => {
|
||||
events.push(Event::ToggleShortcutNumbers(ShortcutNumbers::Off))
|
||||
},
|
||||
@ -883,16 +889,16 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.set(state.ids.show_shortcuts_text, ui);
|
||||
// Buff Position
|
||||
// Buffs above skills
|
||||
if Button::image(match self.global_state.settings.gameplay.buff_position {
|
||||
if Button::image(match self.global_state.settings.interface.buff_position {
|
||||
BuffPosition::Bar => self.imgs.check_checked,
|
||||
BuffPosition::Map => self.imgs.check,
|
||||
})
|
||||
.w_h(12.0, 12.0)
|
||||
.hover_image(match self.global_state.settings.gameplay.buff_position {
|
||||
.hover_image(match self.global_state.settings.interface.buff_position {
|
||||
BuffPosition::Bar => self.imgs.check_checked_mo,
|
||||
BuffPosition::Map => self.imgs.check_mo,
|
||||
})
|
||||
.press_image(match self.global_state.settings.gameplay.buff_position {
|
||||
.press_image(match self.global_state.settings.interface.buff_position {
|
||||
BuffPosition::Bar => self.imgs.check_checked,
|
||||
BuffPosition::Map => self.imgs.check_press,
|
||||
})
|
||||
@ -910,16 +916,16 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.buff_pos_bar_text, ui);
|
||||
// Buffs left from minimap
|
||||
if Button::image(match self.global_state.settings.gameplay.buff_position {
|
||||
if Button::image(match self.global_state.settings.interface.buff_position {
|
||||
BuffPosition::Map => self.imgs.check_checked,
|
||||
BuffPosition::Bar => self.imgs.check,
|
||||
})
|
||||
.w_h(12.0, 12.0)
|
||||
.hover_image(match self.global_state.settings.gameplay.buff_position {
|
||||
.hover_image(match self.global_state.settings.interface.buff_position {
|
||||
BuffPosition::Map => self.imgs.check_checked_mo,
|
||||
BuffPosition::Bar => self.imgs.check_mo,
|
||||
})
|
||||
.press_image(match self.global_state.settings.gameplay.buff_position {
|
||||
.press_image(match self.global_state.settings.interface.buff_position {
|
||||
BuffPosition::Map => self.imgs.check_checked,
|
||||
BuffPosition::Bar => self.imgs.check_press,
|
||||
})
|
||||
@ -962,7 +968,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.set(state.ids.sct_title, ui);
|
||||
// Generally toggle the SCT
|
||||
let show_sct = ToggleButton::new(
|
||||
self.global_state.settings.gameplay.sct,
|
||||
self.global_state.settings.interface.sct,
|
||||
self.imgs.checkbox,
|
||||
self.imgs.checkbox_checked,
|
||||
)
|
||||
@ -972,8 +978,8 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked)
|
||||
.set(state.ids.sct_show_radio, ui);
|
||||
|
||||
if self.global_state.settings.gameplay.sct != show_sct {
|
||||
events.push(Event::Sct(!self.global_state.settings.gameplay.sct))
|
||||
if self.global_state.settings.interface.sct != show_sct {
|
||||
events.push(Event::Sct(!self.global_state.settings.interface.sct))
|
||||
}
|
||||
Text::new(
|
||||
&self
|
||||
@ -986,10 +992,10 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.graphics_for(state.ids.sct_show_radio)
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.sct_show_text, ui);
|
||||
if self.global_state.settings.gameplay.sct {
|
||||
if self.global_state.settings.interface.sct {
|
||||
// Toggle single damage numbers
|
||||
let show_sct_damage_batch = !ToggleButton::new(
|
||||
!self.global_state.settings.gameplay.sct_damage_batch,
|
||||
!self.global_state.settings.interface.sct_damage_batch,
|
||||
self.imgs.checkbox,
|
||||
self.imgs.checkbox_checked,
|
||||
)
|
||||
@ -1022,9 +1028,9 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked)
|
||||
.set(state.ids.sct_show_batch_radio, ui);
|
||||
|
||||
if self.global_state.settings.gameplay.sct_damage_batch != show_sct_damage_batch {
|
||||
if self.global_state.settings.interface.sct_damage_batch != show_sct_damage_batch {
|
||||
events.push(Event::SctDamageBatch(
|
||||
!self.global_state.settings.gameplay.sct_damage_batch,
|
||||
!self.global_state.settings.interface.sct_damage_batch,
|
||||
))
|
||||
}
|
||||
Text::new(&self.localized_strings.get("hud.settings.cumulated_damage"))
|
||||
@ -1036,7 +1042,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.set(state.ids.sct_show_batch_text, ui);
|
||||
// Toggle Incoming Damage
|
||||
let show_sct_player_batch = !ToggleButton::new(
|
||||
!self.global_state.settings.gameplay.sct_player_batch,
|
||||
!self.global_state.settings.interface.sct_player_batch,
|
||||
self.imgs.checkbox,
|
||||
self.imgs.checkbox_checked,
|
||||
)
|
||||
@ -1065,9 +1071,9 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked)
|
||||
.set(state.ids.sct_batch_inc_radio, ui);
|
||||
|
||||
if self.global_state.settings.gameplay.sct_player_batch != show_sct_player_batch {
|
||||
if self.global_state.settings.interface.sct_player_batch != show_sct_player_batch {
|
||||
events.push(Event::SctPlayerBatch(
|
||||
!self.global_state.settings.gameplay.sct_player_batch,
|
||||
!self.global_state.settings.interface.sct_player_batch,
|
||||
))
|
||||
}
|
||||
Text::new(
|
||||
@ -1086,7 +1092,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
// Speech bubble dark mode
|
||||
Text::new(&self.localized_strings.get("hud.settings.speech_bubble"))
|
||||
.down_from(
|
||||
if self.global_state.settings.gameplay.sct {
|
||||
if self.global_state.settings.interface.sct {
|
||||
state.ids.sct_batch_inc_radio
|
||||
} else {
|
||||
state.ids.sct_show_radio
|
||||
@ -1100,7 +1106,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.color(TEXT_COLOR)
|
||||
.set(state.ids.speech_bubble_text, ui);
|
||||
let speech_bubble_dark_mode = ToggleButton::new(
|
||||
self.global_state.settings.gameplay.speech_bubble_dark_mode,
|
||||
self.global_state.settings.interface.speech_bubble_dark_mode,
|
||||
self.imgs.checkbox,
|
||||
self.imgs.checkbox_checked,
|
||||
)
|
||||
@ -1109,7 +1115,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.hover_images(self.imgs.checkbox_mo, self.imgs.checkbox_checked_mo)
|
||||
.press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked)
|
||||
.set(state.ids.speech_bubble_dark_mode_button, ui);
|
||||
if self.global_state.settings.gameplay.speech_bubble_dark_mode
|
||||
if self.global_state.settings.interface.speech_bubble_dark_mode
|
||||
!= speech_bubble_dark_mode
|
||||
{
|
||||
events.push(Event::SpeechBubbleDarkMode(speech_bubble_dark_mode));
|
||||
@ -1126,7 +1132,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.set(state.ids.speech_bubble_dark_mode_text, ui);
|
||||
// Speech bubble icon
|
||||
let speech_bubble_icon = ToggleButton::new(
|
||||
self.global_state.settings.gameplay.speech_bubble_icon,
|
||||
self.global_state.settings.interface.speech_bubble_icon,
|
||||
self.imgs.checkbox,
|
||||
self.imgs.checkbox_checked,
|
||||
)
|
||||
@ -1135,7 +1141,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.hover_images(self.imgs.checkbox_mo, self.imgs.checkbox_checked_mo)
|
||||
.press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked)
|
||||
.set(state.ids.speech_bubble_icon_button, ui);
|
||||
if self.global_state.settings.gameplay.speech_bubble_icon != speech_bubble_icon {
|
||||
if self.global_state.settings.interface.speech_bubble_icon != speech_bubble_icon {
|
||||
events.push(Event::SpeechBubbleIcon(speech_bubble_icon));
|
||||
}
|
||||
Text::new(
|
||||
@ -1288,7 +1294,7 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
|
||||
// "Show character names in chat" toggle button
|
||||
let chat_char_name = ToggleButton::new(
|
||||
self.global_state.settings.gameplay.chat_character_name,
|
||||
self.global_state.settings.interface.chat_character_name,
|
||||
self.imgs.checkbox,
|
||||
self.imgs.checkbox_checked,
|
||||
)
|
||||
@ -1297,9 +1303,9 @@ impl<'a> Widget for SettingsWindow<'a> {
|
||||
.hover_images(self.imgs.checkbox_mo, self.imgs.checkbox_checked_mo)
|
||||
.press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked)
|
||||
.set(state.ids.chat_char_name_button, ui);
|
||||
if self.global_state.settings.gameplay.chat_character_name != chat_char_name {
|
||||
if self.global_state.settings.interface.chat_character_name != chat_char_name {
|
||||
events.push(Event::ChatCharName(
|
||||
!self.global_state.settings.gameplay.chat_character_name,
|
||||
!self.global_state.settings.interface.chat_character_name,
|
||||
));
|
||||
}
|
||||
Text::new(
|
||||
|
@ -225,8 +225,8 @@ impl<'a> Widget for Skillbar<'a> {
|
||||
energy_percentage = 0.0;
|
||||
};
|
||||
|
||||
let bar_values = self.global_state.settings.gameplay.bar_numbers;
|
||||
let shortcuts = self.global_state.settings.gameplay.shortcut_numbers;
|
||||
let bar_values = self.global_state.settings.interface.bar_numbers;
|
||||
let shortcuts = self.global_state.settings.interface.shortcut_numbers;
|
||||
|
||||
let hp_ani = (self.pulse * 4.0/* speed factor */).cos() * 0.5 + 0.8; //Animation timer
|
||||
let crit_hp_color: Color = Color::Rgba(0.79, 0.19, 0.17, hp_ani);
|
||||
|
@ -70,7 +70,7 @@ impl PlayState for CharSelectionState {
|
||||
self.char_selection_ui.update_language(global_state.i18n);
|
||||
// Set scale mode in case it was change
|
||||
self.char_selection_ui
|
||||
.set_scale_mode(global_state.settings.gameplay.ui_scale);
|
||||
.set_scale_mode(global_state.settings.interface.ui_scale);
|
||||
}
|
||||
|
||||
fn tick(&mut self, global_state: &mut GlobalState, events: Vec<WinEvent>) -> PlayStateResult {
|
||||
|
@ -1401,7 +1401,7 @@ impl CharSelectionUi {
|
||||
let mut ui = Ui::new(
|
||||
&mut global_state.window,
|
||||
font,
|
||||
global_state.settings.gameplay.ui_scale,
|
||||
global_state.settings.interface.ui_scale,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
|
@ -57,7 +57,7 @@ impl PlayState for MainMenuState {
|
||||
.update_language(global_state.i18n, &global_state.settings);
|
||||
// Set scale mode in case it was change
|
||||
self.main_menu_ui
|
||||
.set_scale_mode(global_state.settings.gameplay.ui_scale);
|
||||
.set_scale_mode(global_state.settings.interface.ui_scale);
|
||||
}
|
||||
|
||||
#[allow(clippy::single_match)] // TODO: remove when event match has multiple arms
|
||||
|
@ -305,7 +305,7 @@ impl Controls {
|
||||
self.time,
|
||||
&self.i18n.read(),
|
||||
button_style,
|
||||
settings.gameplay.loading_tips,
|
||||
settings.interface.loading_tips,
|
||||
),
|
||||
};
|
||||
|
||||
@ -488,7 +488,7 @@ impl<'a> MainMenuUi {
|
||||
let mut ui = Ui::new(
|
||||
&mut global_state.window,
|
||||
font,
|
||||
global_state.settings.gameplay.ui_scale,
|
||||
global_state.settings.interface.ui_scale,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
|
@ -31,6 +31,7 @@ use common_net::{
|
||||
|
||||
use crate::{
|
||||
audio::sfx::SfxEvent,
|
||||
controller::ControllerSettings,
|
||||
ecs::MyEntity,
|
||||
hud::{DebugInfo, Event as HudEvent, Hud, HudInfo, PressBehavior, PromptDialogSettings},
|
||||
i18n::{i18n_asset_key, Localization},
|
||||
@ -40,7 +41,7 @@ use crate::{
|
||||
scene::{camera, CameraMode, Scene, SceneData},
|
||||
settings::{
|
||||
AudioSettings, ControlSettings, GamepadSettings, GameplaySettings, GraphicsSettings,
|
||||
Settings,
|
||||
InterfaceSettings, Settings,
|
||||
},
|
||||
window::{AnalogGameInput, Event, GameInput},
|
||||
Direction, Error, GlobalState, PlayState, PlayStateResult,
|
||||
@ -778,7 +779,7 @@ impl PlayState for SessionState {
|
||||
// as well avoid it unless we need it).
|
||||
let debug_info = global_state
|
||||
.settings
|
||||
.gameplay
|
||||
.interface
|
||||
.toggle_debug
|
||||
.then(|| DebugInfo {
|
||||
tps: global_state.clock.stats().average_tps,
|
||||
@ -877,31 +878,31 @@ impl PlayState for SessionState {
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::Sct(sct) => {
|
||||
global_state.settings.gameplay.sct = sct;
|
||||
global_state.settings.interface.sct = sct;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::SctPlayerBatch(sct_player_batch) => {
|
||||
global_state.settings.gameplay.sct_player_batch = sct_player_batch;
|
||||
global_state.settings.interface.sct_player_batch = sct_player_batch;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ToggleTips(loading_tips) => {
|
||||
global_state.settings.gameplay.loading_tips = loading_tips;
|
||||
global_state.settings.interface.loading_tips = loading_tips;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::SctDamageBatch(sct_damage_batch) => {
|
||||
global_state.settings.gameplay.sct_damage_batch = sct_damage_batch;
|
||||
global_state.settings.interface.sct_damage_batch = sct_damage_batch;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::SpeechBubbleDarkMode(sbdm) => {
|
||||
global_state.settings.gameplay.speech_bubble_dark_mode = sbdm;
|
||||
global_state.settings.interface.speech_bubble_dark_mode = sbdm;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::SpeechBubbleIcon(sbi) => {
|
||||
global_state.settings.gameplay.speech_bubble_icon = sbi;
|
||||
global_state.settings.interface.speech_bubble_icon = sbi;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ToggleDebug(toggle_debug) => {
|
||||
global_state.settings.gameplay.toggle_debug = toggle_debug;
|
||||
global_state.settings.interface.toggle_debug = toggle_debug;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ToggleMouseYInvert(mouse_y_inverted) => {
|
||||
@ -942,43 +943,43 @@ impl PlayState for SessionState {
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::CrosshairTransp(crosshair_transp) => {
|
||||
global_state.settings.gameplay.crosshair_transp = crosshair_transp;
|
||||
global_state.settings.interface.crosshair_transp = crosshair_transp;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ChatTransp(chat_transp) => {
|
||||
global_state.settings.gameplay.chat_transp = chat_transp;
|
||||
global_state.settings.interface.chat_transp = chat_transp;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ChatCharName(chat_char_name) => {
|
||||
global_state.settings.gameplay.chat_character_name = chat_char_name;
|
||||
global_state.settings.interface.chat_character_name = chat_char_name;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::CrosshairType(crosshair_type) => {
|
||||
global_state.settings.gameplay.crosshair_type = crosshair_type;
|
||||
global_state.settings.interface.crosshair_type = crosshair_type;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::Intro(intro_show) => {
|
||||
global_state.settings.gameplay.intro_show = intro_show;
|
||||
global_state.settings.interface.intro_show = intro_show;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ToggleXpBar(xp_bar) => {
|
||||
global_state.settings.gameplay.xp_bar = xp_bar;
|
||||
global_state.settings.interface.xp_bar = xp_bar;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ToggleBarNumbers(bar_numbers) => {
|
||||
global_state.settings.gameplay.bar_numbers = bar_numbers;
|
||||
global_state.settings.interface.bar_numbers = bar_numbers;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ToggleShortcutNumbers(shortcut_numbers) => {
|
||||
global_state.settings.gameplay.shortcut_numbers = shortcut_numbers;
|
||||
global_state.settings.interface.shortcut_numbers = shortcut_numbers;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::BuffPosition(buff_position) => {
|
||||
global_state.settings.gameplay.buff_position = buff_position;
|
||||
global_state.settings.interface.buff_position = buff_position;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::UiScale(scale_change) => {
|
||||
global_state.settings.gameplay.ui_scale =
|
||||
global_state.settings.interface.ui_scale =
|
||||
self.hud.scale_change(scale_change);
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
@ -1242,35 +1243,35 @@ impl PlayState for SessionState {
|
||||
.compute_dependents(&*self.client.borrow().state().terrain());
|
||||
},
|
||||
HudEvent::MapZoom(map_zoom) => {
|
||||
global_state.settings.gameplay.map_zoom = map_zoom;
|
||||
global_state.settings.interface.map_zoom = map_zoom;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::MapDrag(map_drag) => {
|
||||
global_state.settings.gameplay.map_drag = map_drag;
|
||||
global_state.settings.interface.map_drag = map_drag;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::MapShowDifficulty(map_show_difficulty) => {
|
||||
global_state.settings.gameplay.map_show_difficulty = map_show_difficulty;
|
||||
global_state.settings.interface.map_show_difficulty = map_show_difficulty;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::MapShowTowns(map_show_towns) => {
|
||||
global_state.settings.gameplay.map_show_towns = map_show_towns;
|
||||
global_state.settings.interface.map_show_towns = map_show_towns;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::MapShowDungeons(map_show_dungeons) => {
|
||||
global_state.settings.gameplay.map_show_dungeons = map_show_dungeons;
|
||||
global_state.settings.interface.map_show_dungeons = map_show_dungeons;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::MapShowCastles(map_show_castles) => {
|
||||
global_state.settings.gameplay.map_show_castles = map_show_castles;
|
||||
global_state.settings.interface.map_show_castles = map_show_castles;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::MapShowCaves(map_show_caves) => {
|
||||
global_state.settings.gameplay.map_show_caves = map_show_caves;
|
||||
global_state.settings.interface.map_show_caves = map_show_caves;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::MapShowTrees(map_show_trees) => {
|
||||
global_state.settings.gameplay.map_show_trees = map_show_trees;
|
||||
global_state.settings.interface.map_show_trees = map_show_trees;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ChangeGamma(new_gamma) => {
|
||||
@ -1354,96 +1355,43 @@ impl PlayState for SessionState {
|
||||
self.client.borrow_mut().assign_group_leader(uid);
|
||||
},
|
||||
HudEvent::MinimapShow(state) => {
|
||||
global_state.settings.gameplay.minimap_show = state;
|
||||
global_state.settings.interface.minimap_show = state;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::MinimapFaceNorth(state) => {
|
||||
global_state.settings.gameplay.minimap_face_north = state;
|
||||
global_state.settings.interface.minimap_face_north = state;
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ResetInterfaceSettings => {
|
||||
// Load Defaults
|
||||
let default = GameplaySettings::default();
|
||||
// General
|
||||
//global_state.settings.gameplay.intro_show = default.intro_show;
|
||||
global_state.settings.gameplay.loading_tips = default.loading_tips;
|
||||
global_state.settings.gameplay.toggle_debug = default.toggle_debug;
|
||||
// UI-Scale
|
||||
global_state.settings.gameplay.ui_scale = default.ui_scale;
|
||||
self.hud.set_scaling_mode(default.ui_scale);
|
||||
// Crosshair
|
||||
global_state.settings.gameplay.crosshair_type = default.crosshair_type;
|
||||
global_state.settings.gameplay.crosshair_transp = default.crosshair_transp;
|
||||
//Energybar Numbers
|
||||
global_state.settings.gameplay.bar_numbers = default.bar_numbers;
|
||||
// Hotbar
|
||||
global_state.settings.gameplay.xp_bar = default.xp_bar;
|
||||
global_state.settings.gameplay.shortcut_numbers = default.shortcut_numbers;
|
||||
global_state.settings.gameplay.buff_position = default.buff_position;
|
||||
// Scrolling Combat Text
|
||||
global_state.settings.gameplay.sct = default.sct;
|
||||
global_state.settings.gameplay.sct_player_batch = default.sct_player_batch;
|
||||
global_state.settings.gameplay.sct_damage_batch = default.sct_damage_batch;
|
||||
//Speech Bubble
|
||||
global_state.settings.gameplay.speech_bubble_dark_mode =
|
||||
default.speech_bubble_dark_mode;
|
||||
global_state.settings.gameplay.speech_bubble_icon =
|
||||
default.speech_bubble_icon;
|
||||
// Chat
|
||||
global_state.settings.gameplay.chat_transp = default.chat_transp;
|
||||
global_state.settings.gameplay.chat_character_name =
|
||||
default.chat_character_name;
|
||||
// Map
|
||||
global_state.settings.gameplay.map_zoom = default.map_zoom;
|
||||
global_state.settings.gameplay.map_drag = default.map_drag;
|
||||
global_state.settings.gameplay.map_show_difficulty =
|
||||
default.map_show_difficulty;
|
||||
global_state.settings.gameplay.map_show_towns = default.map_show_towns;
|
||||
global_state.settings.gameplay.map_show_dungeons =
|
||||
default.map_show_dungeons;
|
||||
global_state.settings.gameplay.map_show_castles = default.map_show_castles;
|
||||
global_state.settings.gameplay.map_show_caves = default.map_show_caves;
|
||||
global_state.settings.gameplay.map_show_trees = default.map_show_trees;
|
||||
global_state.settings.gameplay.minimap_show = default.minimap_show;
|
||||
global_state.settings.gameplay.minimap_face_north =
|
||||
default.minimap_face_north;
|
||||
// Reset Interface Settings
|
||||
let tmp = global_state.settings.interface.intro_show;
|
||||
global_state.settings.interface = InterfaceSettings::default();
|
||||
global_state.settings.interface.intro_show = tmp;
|
||||
// Update Current Scaling Mode
|
||||
self.hud
|
||||
.set_scaling_mode(global_state.settings.interface.ui_scale);
|
||||
// Save to File
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
HudEvent::ResetGameplaySettings => {
|
||||
// Load Defaults
|
||||
let default = GameplaySettings::default();
|
||||
// Reset Gameplay Settings
|
||||
global_state.settings.gameplay = GameplaySettings::default();
|
||||
// Reset Gamepad and Controller Settings
|
||||
global_state.settings.controller = GamepadSettings::default();
|
||||
global_state.window.controller_settings =
|
||||
ControllerSettings::from(&global_state.settings.controller);
|
||||
// Pan Sensitivity
|
||||
global_state.window.pan_sensitivity = default.pan_sensitivity;
|
||||
global_state.settings.gameplay.pan_sensitivity = default.pan_sensitivity;
|
||||
global_state.window.pan_sensitivity =
|
||||
global_state.settings.gameplay.pan_sensitivity;
|
||||
// Zoom Sensitivity
|
||||
global_state.window.zoom_sensitivity = default.zoom_sensitivity;
|
||||
global_state.settings.gameplay.zoom_sensitivity = default.zoom_sensitivity;
|
||||
global_state.window.zoom_sensitivity =
|
||||
global_state.settings.gameplay.zoom_sensitivity;
|
||||
// Invert Scroll Zoom
|
||||
global_state.window.zoom_inversion = default.zoom_inversion;
|
||||
global_state.settings.gameplay.zoom_inversion = default.zoom_inversion;
|
||||
global_state.window.zoom_inversion =
|
||||
global_state.settings.gameplay.zoom_inversion;
|
||||
// Invert Mouse Y Axis
|
||||
global_state.window.mouse_y_inversion = default.mouse_y_inversion;
|
||||
global_state.settings.gameplay.mouse_y_inversion =
|
||||
default.mouse_y_inversion;
|
||||
// Invert Controller Y Axis
|
||||
let default_gamepad = GamepadSettings::default();
|
||||
global_state.window.controller_settings.pan_invert_y =
|
||||
default_gamepad.pan_invert_y;
|
||||
global_state.settings.controller.pan_invert_y =
|
||||
default_gamepad.pan_invert_y;
|
||||
// Camera Smoothing
|
||||
global_state.settings.gameplay.smooth_pan_enable =
|
||||
default.smooth_pan_enable;
|
||||
// Free Look Behavior
|
||||
global_state.settings.gameplay.free_look_behavior =
|
||||
default.free_look_behavior;
|
||||
// Auto Walk Behavior
|
||||
global_state.settings.gameplay.auto_walk_behavior =
|
||||
default.auto_walk_behavior;
|
||||
// Stop Auto Walk on Movement
|
||||
global_state.settings.gameplay.stop_auto_walk_on_input =
|
||||
default.stop_auto_walk_on_input;
|
||||
global_state.window.mouse_y_inversion =
|
||||
global_state.settings.gameplay.mouse_y_inversion;
|
||||
// Save to File
|
||||
global_state.settings.save_to_file_warn();
|
||||
},
|
||||
|
@ -427,21 +427,16 @@ pub mod con_settings {
|
||||
}
|
||||
}
|
||||
|
||||
/// `GameplaySettings` contains sensitivity and gameplay options.
|
||||
/// `InterfaceSettings` contains UI, HUD and Map options.
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
pub struct GameplaySettings {
|
||||
pub pan_sensitivity: u32,
|
||||
pub zoom_sensitivity: u32,
|
||||
pub zoom_inversion: bool,
|
||||
pub struct InterfaceSettings {
|
||||
pub toggle_debug: bool,
|
||||
pub sct: bool,
|
||||
pub sct_player_batch: bool,
|
||||
pub sct_damage_batch: bool,
|
||||
pub speech_bubble_dark_mode: bool,
|
||||
pub speech_bubble_icon: bool,
|
||||
pub mouse_y_inversion: bool,
|
||||
pub smooth_pan_enable: bool,
|
||||
pub crosshair_transp: f32,
|
||||
pub chat_transp: f32,
|
||||
pub chat_character_name: bool,
|
||||
@ -452,9 +447,6 @@ pub struct GameplaySettings {
|
||||
pub buff_position: BuffPosition,
|
||||
pub bar_numbers: BarNumbers,
|
||||
pub ui_scale: ScaleMode,
|
||||
pub free_look_behavior: PressBehavior,
|
||||
pub auto_walk_behavior: PressBehavior,
|
||||
pub stop_auto_walk_on_input: bool,
|
||||
pub map_zoom: f64,
|
||||
pub map_drag: Vec2<f64>,
|
||||
pub map_show_difficulty: bool,
|
||||
@ -468,14 +460,9 @@ pub struct GameplaySettings {
|
||||
pub minimap_face_north: bool,
|
||||
}
|
||||
|
||||
impl Default for GameplaySettings {
|
||||
impl Default for InterfaceSettings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
pan_sensitivity: 100,
|
||||
zoom_sensitivity: 100,
|
||||
zoom_inversion: false,
|
||||
mouse_y_inversion: false,
|
||||
smooth_pan_enable: false,
|
||||
toggle_debug: false,
|
||||
sct: true,
|
||||
sct_player_batch: false,
|
||||
@ -492,9 +479,6 @@ impl Default for GameplaySettings {
|
||||
buff_position: BuffPosition::Bar,
|
||||
bar_numbers: BarNumbers::Values,
|
||||
ui_scale: ScaleMode::RelativeToWindow([1920.0, 1080.0].into()),
|
||||
free_look_behavior: PressBehavior::Toggle,
|
||||
auto_walk_behavior: PressBehavior::Toggle,
|
||||
stop_auto_walk_on_input: true,
|
||||
map_zoom: 10.0,
|
||||
map_drag: Vec2 { x: 0.0, y: 0.0 },
|
||||
map_show_difficulty: true,
|
||||
@ -510,6 +494,35 @@ impl Default for GameplaySettings {
|
||||
}
|
||||
}
|
||||
|
||||
/// `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 zoom_inversion: bool,
|
||||
pub mouse_y_inversion: bool,
|
||||
pub smooth_pan_enable: bool,
|
||||
pub free_look_behavior: PressBehavior,
|
||||
pub auto_walk_behavior: PressBehavior,
|
||||
pub stop_auto_walk_on_input: bool,
|
||||
}
|
||||
|
||||
impl Default for GameplaySettings {
|
||||
fn default() -> Self {
|
||||
Self {
|
||||
pan_sensitivity: 100,
|
||||
zoom_sensitivity: 100,
|
||||
zoom_inversion: false,
|
||||
mouse_y_inversion: false,
|
||||
smooth_pan_enable: false,
|
||||
free_look_behavior: PressBehavior::Toggle,
|
||||
auto_walk_behavior: PressBehavior::Toggle,
|
||||
stop_auto_walk_on_input: true,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// `NetworkingSettings` stores server and networking settings.
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[serde(default)]
|
||||
@ -691,6 +704,7 @@ impl Default for LanguageSettings {
|
||||
#[serde(default)]
|
||||
pub struct Settings {
|
||||
pub controls: ControlSettings,
|
||||
pub interface: InterfaceSettings,
|
||||
pub gameplay: GameplaySettings,
|
||||
pub networking: NetworkingSettings,
|
||||
pub log: Log,
|
||||
@ -726,6 +740,7 @@ impl Default for Settings {
|
||||
|
||||
Settings {
|
||||
controls: ControlSettings::default(),
|
||||
interface: InterfaceSettings::default(),
|
||||
gameplay: GameplaySettings::default(),
|
||||
networking: NetworkingSettings::default(),
|
||||
log: Log::default(),
|
||||
|
Loading…
Reference in New Issue
Block a user