From e6ced0577e6cbbea59292ddf5682986971885bed Mon Sep 17 00:00:00 2001 From: ninefox Date: Tue, 25 Jan 2022 22:47:26 -0800 Subject: [PATCH 1/2] Persist interface debug checkbox --- voxygen/src/hud/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 76ca59d59b..8c8e796463 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -1037,7 +1037,7 @@ impl Hud { show: Show { help: false, intro: false, - debug: false, + debug: global_state.settings.interface.toggle_debug, bag: false, bag_inv: false, trade: false, From 2e902c1c5c94336b08e8f4fdfed32c9be9cf395d Mon Sep 17 00:00:00 2001 From: ninefox Date: Wed, 9 Feb 2022 18:31:46 -0800 Subject: [PATCH 2/2] swapped show.debug for interface.toggle_debug --- voxygen/src/hud/mod.rs | 7 ------- voxygen/src/hud/settings_window/interface.rs | 4 ++-- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 8c8e796463..9327787a7b 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -643,7 +643,6 @@ pub struct Show { intro: bool, help: bool, crafting: bool, - debug: bool, bag: bool, bag_inv: bool, trade: bool, @@ -1037,7 +1036,6 @@ impl Hud { show: Show { help: false, intro: false, - debug: global_state.settings.interface.toggle_debug, bag: false, bag_inv: false, trade: false, @@ -3150,12 +3148,8 @@ impl Hud { InterfaceChange::ToggleHelp(toggle_help) => { self.show.help = *toggle_help; }, - InterfaceChange::ToggleDebug(toggle_debug) => { - self.show.debug = *toggle_debug; - }, InterfaceChange::ResetInterfaceSettings => { self.show.help = false; - self.show.debug = false; }, _ => {}, }, @@ -4015,7 +4009,6 @@ impl Hud { GameInput::ToggleDebug if state => { global_state.settings.interface.toggle_debug = !global_state.settings.interface.toggle_debug; - self.show.debug = global_state.settings.interface.toggle_debug; true }, #[cfg(feature = "egui-ui")] diff --git a/voxygen/src/hud/settings_window/interface.rs b/voxygen/src/hud/settings_window/interface.rs index ff868cc3f2..28accc1e3e 100644 --- a/voxygen/src/hud/settings_window/interface.rs +++ b/voxygen/src/hud/settings_window/interface.rs @@ -228,7 +228,7 @@ impl<'a> Widget for Interface<'a> { // Debug let show_debug = ToggleButton::new( - self.show.debug, + self.global_state.settings.interface.toggle_debug, self.imgs.checkbox, self.imgs.checkbox_checked, ) @@ -238,7 +238,7 @@ impl<'a> Widget for Interface<'a> { .press_images(self.imgs.checkbox_press, self.imgs.checkbox_checked) .set(state.ids.debug_button, ui); - if self.show.debug != show_debug { + if self.global_state.settings.interface.toggle_debug != show_debug { events.push(ToggleDebug(show_debug)); }