Seem to have missed minimap again

This commit is contained in:
hqurve 2021-04-14 10:19:12 -04:00
parent 399795dbf1
commit 9018ead8d0
2 changed files with 6 additions and 13 deletions

View File

@ -4,6 +4,7 @@ use super::{
TEXT_COLOR, UI_HIGHLIGHT_0, UI_MAIN,
};
use crate::{
session::settings_change::{Interface as InterfaceChange, Interface::*},
ui::{fonts::Fonts, img_ids},
GlobalState,
};
@ -85,8 +86,7 @@ pub struct State {
}
pub enum Event {
Show(bool),
FaceNorth(bool),
SettingsChange(InterfaceChange),
}
impl<'a> Widget for MiniMap<'a> {
@ -227,7 +227,7 @@ impl<'a> Widget for MiniMap<'a> {
.set(state.ids.mmap_north_button, ui)
.was_clicked()
{
return Some(Event::FaceNorth(!is_facing_north));
return Some(Event::SettingsChange(MinimapFaceNorth(!is_facing_north)));
}
// Reload zoom in case it changed.
@ -502,7 +502,7 @@ impl<'a> Widget for MiniMap<'a> {
.set(state.ids.mmap_button, ui)
.was_clicked()
{
return Some(Event::Show(!show_minimap));
return Some(Event::SettingsChange(MinimapShow(!show_minimap)));
}
// TODO: Subregion name display

View File

@ -2192,15 +2192,8 @@ impl Hud {
)
.set(self.ids.minimap, ui_widgets)
{
Some(minimap::Event::Show(show)) => {
events.push(Event::SettingsChange(
InterfaceChange::MinimapShow(show).into(),
));
},
Some(minimap::Event::FaceNorth(should_face_north)) => {
events.push(Event::SettingsChange(
InterfaceChange::MinimapFaceNorth(should_face_north).into(),
));
Some(minimap::Event::SettingsChange(interface_change)) => {
events.push(Event::SettingsChange(interface_change.into()));
},
None => {},
}