mirror of
https://github.com/Noratrieb/game-wip-dontplay.git
synced 2026-01-16 04:25:00 +01:00
Console, experimental tile graphic for continuous tiles
This commit is contained in:
parent
8ee0c9d535
commit
4dfb0ff7d7
12 changed files with 201 additions and 23 deletions
11
src/input.rs
11
src/input.rs
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue