Fix collapsible_if in main game loop
This commit is contained in:
parent
c2e3ddb805
commit
132b40c19e
22
src/main.rs
22
src/main.rs
|
@ -507,18 +507,16 @@ fn handle_window_event<T>(
|
||||||
game.focused = true;
|
game.focused = true;
|
||||||
window.window().set_cursor_grab(true).unwrap();
|
window.window().set_cursor_grab(true).unwrap();
|
||||||
window.window().set_cursor_visible(false);
|
window.window().set_cursor_visible(false);
|
||||||
} else {
|
} else if !game.focused {
|
||||||
if !game.focused {
|
window.window().set_cursor_grab(false).unwrap();
|
||||||
window.window().set_cursor_grab(false).unwrap();
|
window.window().set_cursor_visible(true);
|
||||||
window.window().set_cursor_visible(true);
|
ui_container.click_at(
|
||||||
ui_container.click_at(
|
game,
|
||||||
game,
|
game.last_mouse_x,
|
||||||
game.last_mouse_x,
|
game.last_mouse_y,
|
||||||
game.last_mouse_y,
|
width,
|
||||||
width,
|
height,
|
||||||
height,
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(ElementState::Pressed, MouseButton::Right) => {
|
(ElementState::Pressed, MouseButton::Right) => {
|
||||||
|
|
Loading…
Reference in New Issue