forgot to add minimap to settings_change

This commit is contained in:
hqurve 2021-04-14 09:29:22 -04:00
parent 56deb5919f
commit 4503d5160c
3 changed files with 15 additions and 12 deletions

View File

@ -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 => {},
}

View File

@ -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);
},

View File

@ -95,6 +95,9 @@ pub enum Interface {
BuffPosition(BuffPosition),
UiScale(ScaleChange),
//Minimap
MinimapShow(bool),
MinimapFaceNorth(bool),
//Map settings
MapZoom(f64),
MapDrag(Vec2<f64>),
@ -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;
},