From e3c0ceb9fa50a82a4119e88558da737ab03b6ab8 Mon Sep 17 00:00:00 2001 From: PersianKnight Date: Sat, 13 Mar 2021 17:38:34 +0330 Subject: [PATCH 1/3] Fixed Toggle Debug Info from Settings --- voxygen/src/hud/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 3969b39237..d788dfd024 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -2431,7 +2431,10 @@ impl Hud { events.push(Event::SctDamageBatch(sct_damage_batch)); }, settings_window::Event::ToggleHelp => self.show.help = !self.show.help, - settings_window::Event::ToggleDebug => self.show.debug = !self.show.debug, + settings_window::Event::ToggleDebug => { + self.show.debug = !self.show.debug; + events.push(Event::ToggleDebug(self.show.debug)); + }, settings_window::Event::ToggleTips(loading_tips) => { events.push(Event::ToggleTips(loading_tips)); }, From 42d57ccb92ae2e66c71519a4adb1dd152d13395c Mon Sep 17 00:00:00 2001 From: PersianKnight Date: Sat, 13 Mar 2021 17:42:52 +0330 Subject: [PATCH 2/3] The appearance of the reset buttons has improved. --- voxygen/src/hud/settings_window.rs | 39 +++++++++++++++++------------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/voxygen/src/hud/settings_window.rs b/voxygen/src/hud/settings_window.rs index 43ac0339aa..9d0d3b7c5c 100644 --- a/voxygen/src/hud/settings_window.rs +++ b/voxygen/src/hud/settings_window.rs @@ -241,6 +241,9 @@ widget_ids! { } } +const RESET_BUTTONS_HEIGHT: f64 = 34.0; +const RESET_BUTTONS_WIDTH: f64 = 155.0; + pub enum SettingsTab { Interface, Video, @@ -1323,7 +1326,7 @@ impl<'a> Widget for SettingsWindow<'a> { // Reset the interface settings to the default settings if Button::image(self.imgs.button) - .w_h(31.0 * 5.0, 12.0 * 2.0) + .w_h(RESET_BUTTONS_WIDTH, RESET_BUTTONS_HEIGHT) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .down_from(state.ids.buff_pos_map_button, 12.0) @@ -1653,7 +1656,7 @@ impl<'a> Widget for SettingsWindow<'a> { // Reset the gameplay settings to the default settings if Button::image(self.imgs.button) - .w_h(31.0 * 5.0, 12.0 * 2.0) + .w_h(RESET_BUTTONS_WIDTH, RESET_BUTTONS_HEIGHT) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .down_from(state.ids.free_look_behavior_list, 12.0) @@ -1778,23 +1781,24 @@ impl<'a> Widget for SettingsWindow<'a> { // Reset the KeyBindings settings to the default settings if let Some(prev_id) = previous_element_id { - let key_string = self.localized_strings.get("hud.settings.reset_keybinds"); - let button_widget = Button::new() - .label(&key_string) + if Button::image(self.imgs.button) + .w_h(RESET_BUTTONS_WIDTH, RESET_BUTTONS_HEIGHT) + .hover_image(self.imgs.button_hover) + .press_image(self.imgs.button_press) + .down_from(prev_id, 20.0) + .label(&self.localized_strings.get("hud.settings.reset_keybinds")) + .label_font_size(self.fonts.cyri.scale(14)) .label_color(TEXT_COLOR) .label_font_id(self.fonts.cyri.conrod_id) - .label_font_size(self.fonts.cyri.scale(18)) - .down_from(prev_id, 20.0) - .w(200.0) - .rgba(0.0, 0.0, 0.0, 0.0) - .border_rgba(0.0, 0.0, 0.0, 255.0) - .label_y(Relative::Scalar(3.0)) - .set(state.ids.reset_controls_button, ui); - if button_widget.was_clicked() { + .label_y(Relative::Scalar(2.0)) + .set(state.ids.reset_controls_button, ui) + .was_clicked() + { events.push(Event::ResetKeyBindings); } previous_element_id = Some(state.ids.reset_controls_button) } + // Add an empty text widget to simulate some bottom margin, because conrod sucks if let Some(prev_id) = previous_element_id { Rectangle::fill_with([1.0, 1.0], color::TRANSPARENT) @@ -2739,7 +2743,7 @@ impl<'a> Widget for SettingsWindow<'a> { // Save current screen size if Button::image(self.imgs.button) - .w_h(31.0 * 5.0, 12.0 * 2.0) + .w_h(RESET_BUTTONS_WIDTH, RESET_BUTTONS_HEIGHT) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .down_from(state.ids.fullscreen_mode_list, 12.0) @@ -2762,10 +2766,11 @@ impl<'a> Widget for SettingsWindow<'a> { // Reset the graphics settings to the default settings if Button::image(self.imgs.button) - .w_h(31.0 * 5.0, 12.0 * 2.0) + .w_h(RESET_BUTTONS_WIDTH, RESET_BUTTONS_HEIGHT) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) - .down_from(state.ids.save_window_size_button, 12.0) + .down_from(state.ids.fullscreen_mode_list, 12.0) + .right_from(state.ids.save_window_size_button, 12.0) .label(&self.localized_strings.get("hud.settings.reset_graphics")) .label_font_size(self.fonts.cyri.scale(14)) .label_color(TEXT_COLOR) @@ -2884,7 +2889,7 @@ impl<'a> Widget for SettingsWindow<'a> { // Reset the sound settings to the default settings if Button::image(self.imgs.button) - .w_h(31.0 * 5.0, 12.0 * 2.0) + .w_h(RESET_BUTTONS_WIDTH, RESET_BUTTONS_HEIGHT) .hover_image(self.imgs.button_hover) .press_image(self.imgs.button_press) .down_from(state.ids.sfx_volume_slider, 12.0) From 7c0fe7045387e5c19d8df11b0ae3560b9f5e8bd9 Mon Sep 17 00:00:00 2001 From: PersianKnight Date: Sat, 13 Mar 2021 19:09:38 +0330 Subject: [PATCH 3/3] Improve default value of windows_size in Graphics and Help Windows in Interface Settings. --- voxygen/src/hud/mod.rs | 2 +- voxygen/src/settings.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index d788dfd024..35a7b34553 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -2554,7 +2554,7 @@ impl Hud { events.push(Event::ChangeStopAutoWalkOnInput(state)); }, settings_window::Event::ResetInterfaceSettings => { - self.show.help = true; + self.show.help = false; self.show.debug = false; events.push(Event::ResetInterfaceSettings); }, diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs index 163a400868..4217044003 100644 --- a/voxygen/src/settings.rs +++ b/voxygen/src/settings.rs @@ -636,7 +636,7 @@ impl Default for GraphicsSettings { exposure: 1.0, ambiance: 10.0, render_mode: RenderMode::default(), - window_size: [1920, 1080], + window_size: [1280, 720], fullscreen: FullScreenSettings::default(), lod_detail: 250, }