release+unhide mouse cursor in menu
This commit is contained in:
parent
16a578d294
commit
8b0d4d3df9
|
@ -219,6 +219,14 @@ pub fn handle_game_event(
|
|||
}
|
||||
GameEvent::SetMenu(turn) => {
|
||||
settings.menu_active = turn.to_bool(settings.menu_active);
|
||||
for mut window in &mut q_window {
|
||||
window.cursor.grab_mode = if settings.menu_active {
|
||||
bevy::window::CursorGrabMode::None
|
||||
} else {
|
||||
bevy::window::CursorGrabMode::Locked
|
||||
};
|
||||
window.cursor.visible = settings.menu_active;
|
||||
}
|
||||
ew_updatemenu.send(menu::UpdateMenuEvent);
|
||||
}
|
||||
GameEvent::SetThirdPerson(turn) => {
|
||||
|
|
Loading…
Reference in a new issue