Fix collapsible_if in main game loop

This commit is contained in:
ice_iix 2020-06-29 18:06:51 -07:00
parent c2e3ddb805
commit 132b40c19e
1 changed files with 10 additions and 12 deletions

View File

@ -507,8 +507,7 @@ fn handle_window_event<T>(
game.focused = true;
window.window().set_cursor_grab(true).unwrap();
window.window().set_cursor_visible(false);
} else {
if !game.focused {
} else if !game.focused {
window.window().set_cursor_grab(false).unwrap();
window.window().set_cursor_visible(true);
ui_container.click_at(
@ -520,7 +519,6 @@ fn handle_window_event<T>(
);
}
}
}
(ElementState::Pressed, MouseButton::Right) => {
if game.focused {
game.server.on_right_click(&mut game.renderer);