Console, experimental tile graphic for continuous tiles

This commit is contained in:
crumblingstatue 2023-04-16 01:03:12 +02:00
parent 8ee0c9d535
commit 4dfb0ff7d7
12 changed files with 201 additions and 23 deletions

View file

@ -14,7 +14,7 @@ pub struct Input {
}
impl Input {
pub fn update_from_event(&mut self, ev: &Event) {
pub fn update_from_event(&mut self, ev: &Event, egui_kbd: bool, egui_ptr: bool) {
match ev {
&Event::KeyPressed { code, .. } => {
self.pressed.insert(code);
@ -52,6 +52,15 @@ impl Input {
}
_ => {}
}
if egui_kbd {
self.pressed.clear();
self.down.clear();
}
if egui_ptr {
self.lmb_down = false;
self.rmb_down = false;
self.mid_pressed = false;
}
}
/// Pressed event should be cleared every frame
pub fn clear_pressed(&mut self) {