From bf22f631ca725ae3fde69936bf24afcea27bb134 Mon Sep 17 00:00:00 2001 From: hqurve Date: Wed, 14 Apr 2021 09:29:22 -0400 Subject: [PATCH] forgot to add minimap to settings_change --- voxygen/src/hud/mod.rs | 10 ++++++---- voxygen/src/session/mod.rs | 8 -------- voxygen/src/session/settings_change.rs | 9 +++++++++ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index 1bc768eaea..26ed0b4dbe 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -388,8 +388,6 @@ pub enum Event { AssignLeader(Uid), RemoveBuff(BuffKind), UnlockSkill(Skill), - MinimapShow(bool), - MinimapFaceNorth(bool), RequestSiteInfo(SiteId), SettingsChange(SettingsChange), @@ -2195,10 +2193,14 @@ impl Hud { .set(self.ids.minimap, ui_widgets) { Some(minimap::Event::Show(show)) => { - events.push(Event::MinimapShow(show)); + events.push(Event::SettingsChange( + InterfaceChange::MinimapShow(show).into(), + )); }, Some(minimap::Event::FaceNorth(should_face_north)) => { - events.push(Event::MinimapFaceNorth(should_face_north)) + events.push(Event::SettingsChange( + InterfaceChange::MinimapFaceNorth(should_face_north).into(), + )); }, None => {}, } diff --git a/voxygen/src/session/mod.rs b/voxygen/src/session/mod.rs index 1e01cad9e2..c7290a6f77 100644 --- a/voxygen/src/session/mod.rs +++ b/voxygen/src/session/mod.rs @@ -1195,14 +1195,6 @@ impl PlayState for SessionState { HudEvent::AssignLeader(uid) => { self.client.borrow_mut().assign_group_leader(uid); }, - HudEvent::MinimapShow(state) => { - global_state.settings.interface.minimap_show = state; - global_state.settings.save_to_file_warn(); - }, - HudEvent::MinimapFaceNorth(state) => { - global_state.settings.interface.minimap_face_north = state; - global_state.settings.save_to_file_warn(); - }, HudEvent::SettingsChange(settings_change) => { settings_change.process(global_state, self); }, diff --git a/voxygen/src/session/settings_change.rs b/voxygen/src/session/settings_change.rs index 6d31303996..b92f9c7745 100644 --- a/voxygen/src/session/settings_change.rs +++ b/voxygen/src/session/settings_change.rs @@ -95,6 +95,9 @@ pub enum Interface { BuffPosition(BuffPosition), UiScale(ScaleChange), + //Minimap + MinimapShow(bool), + MinimapFaceNorth(bool), //Map settings MapZoom(f64), MapDrag(Vec2), @@ -394,6 +397,12 @@ impl SettingsChange { Interface::UiScale(scale_change) => { settings.interface.ui_scale = session_state.hud.scale_change(scale_change); }, + Interface::MinimapShow(state) => { + settings.interface.minimap_show = state; + }, + Interface::MinimapFaceNorth(state) => { + settings.interface.minimap_face_north = state; + }, Interface::MapZoom(map_zoom) => { settings.interface.map_zoom = map_zoom; },