mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Seem to have missed minimap again
This commit is contained in:
parent
399795dbf1
commit
9018ead8d0
@ -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
|
||||
|
@ -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 => {},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user